Skip to content

Allow 2.5MHz bandwidth on R2 use without filter optimization if needed. #107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions air.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,26 @@ static unsigned int chooseFc(unsigned int minF,unsigned int maxF,int filter)
int i,j;

if(filter) {
/* The reasoning and research for this is described here:
* https://tleconte.github.io/R820T/r820IF.html */

for(i=7;i>=0;i--)
if((r820t_hf[5]-r820t_lf[i])>=bw) break;

if(i<0) return 0;
if(i<0) {
fprintf(stderr, "Unable to use airspy R820T filter optimization, continuing.\n");
} else {
fprintf(stderr, "Enabling airspy R820T filter optimization.\n");

for(j=5;j>=0;j--)
if((r820t_hf[j]-r820t_lf[i])<=bw) break;
j++;
for(j=5;j>=0;j--)
if((r820t_hf[j]-r820t_lf[i])<=bw) break;
j++;

off=(r820t_hf[j]+r820t_lf[i])/2-AIRINRATE/4;
off=(r820t_hf[j]+r820t_lf[i])/2-AIRINRATE/4;

airspy_r820t_write(device, 10, 0xB0 | (15-j));
airspy_r820t_write(device, 11, 0xE0 | (15-i));
airspy_r820t_write(device, 10, 0xB0 | (15-j));
airspy_r820t_write(device, 11, 0xE0 | (15-i));
}
}

return(((maxF+minF)/2+off+INTRATE/2)/INTRATE*INTRATE);
Expand Down