diff --git a/src/leansdr/sdr.h b/src/leansdr/sdr.h index 1250dcf..47361d1 100644 --- a/src/leansdr/sdr.h +++ b/src/leansdr/sdr.h @@ -422,7 +422,7 @@ namespace leansdr { template struct sampler_interface { - virtual complex interp(complex *pin, float mu, float phase) = 0; + virtual complex interp(const complex *pin, float mu, float phase) = 0; virtual void update_freq(float freqw) { } // 65536 = 1 Hz virtual int readahead() { return 0; } }; @@ -434,7 +434,7 @@ namespace leansdr { template struct nearest_sampler : sampler_interface { int readahead() { return 0; } - complex interp(complex *pin, float mu, float phase) { + complex interp(const complex *pin, float mu, float phase) { return pin[0]*trig.expi(-phase); } private: @@ -448,7 +448,7 @@ namespace leansdr { struct linear_sampler : sampler_interface { int readahead() { return 1; } - complex interp(complex *pin, float mu, float phase) { + complex interp(const complex *pin, float mu, float phase) { // Derotate pin[0] and pin[1] complex s0 = pin[0]*trig.expi(-phase); complex s1 = pin[1]*trig.expi(-(phase+freqw)); @@ -477,7 +477,7 @@ namespace leansdr { int readahead() { return ncoeffs-1; } - complex interp(complex *pin, float mu, float phase) { + complex interp(const complex *pin, float mu, float phase) { // Apply FIR filter with subsampling complex acc(0, 0); complex *pc = shifted_coeffs + (int)((1-mu)*subsampling);