Working interpolator.

This commit is contained in:
ha7ilm 2017-02-19 16:06:08 +01:00
parent 9ef8cd4b45
commit 7e87ccb2a1
2 changed files with 5 additions and 3 deletions

2
csdr.c
View file

@ -860,7 +860,7 @@ int main(int argc, char *argv[])
sscanf(argv[2],"%d",&factor);
assert(factor >= 1);
float transition_bw = 0.05;
float transition_bw = 0.01;
if(argc>=4) sscanf(argv[3],"%g",&transition_bw);
assert(transition_bw >= 0 && transition_bw < 1.);

View file

@ -394,8 +394,10 @@ int fir_interpolate_cc(complexf *input, complexf *output, int input_size, int in
{
float acci=0;
float accq=0;
for(int ti=ip, si=0; ti<taps_length; ti+=interpolation, si++) acci += (iof(input,i+si)) * taps[ti]; //@fir_interpolate_cc: i loop
for(int ti=ip, si=0; ti<taps_length; ti+=interpolation, si++) accq += (qof(input,i+si)) * taps[ti]; //@fir_interpolate_cc: q loop
//int tistart = (interpolation-ip)%interpolation;
int tistart = (interpolation-ip); //why does this work? why don't we need the % part?
for(int ti=tistart, si=0; ti<taps_length; ti+=interpolation, si++) acci += (iof(input,i+si)) * taps[ti]; //@fir_interpolate_cc: i loop
for(int ti=tistart, si=0; ti<taps_length; ti+=interpolation, si++) accq += (qof(input,i+si)) * taps[ti]; //@fir_interpolate_cc: q loop
iof(output,oi)=acci;
qof(output,oi)=accq;
oi++;