Hi Johan and group,
You wrote..
Yes, but SAQrx uses a complex FIR filter for the main
selectivity so it will take some CPU power if you want:
1. narrow passband width AND...
2. small ripple in the passband AND...
3. steep skirts AND...
4. large stopband attenuation
i.e. a "brickwall" response.
A complex FIR with, for example:
Passband width = 100 Hz
Passband ripple <= 0.1 dB
Stopband width = 150 Hz
Stopband attenuation = 80 dB (either side of +/75 Hz)
designed with ParksMcClellan requires 2 * 1526 = 3052 taps.
The main filter in SAQrx is run at Fs = 11025 Hz.
I think ~3000 taps would work OK on a fast machine although
I haven't checked it. The existing 1000Hz filter has 2*206 taps.
As an alternative (since you already have the forward and inverse FFT in
your Clibrary) you could use FFT convolution for the filter, which
*greatly* speeds up large filter kernels. The basic principle is to
split up the incoming signal into overlapping FFTs (with say 4096 to
16384 points), preferably using 50 % overlap and a raised cosine window,
then do the filtering by multiplying the spectra with the filter's
amplitude, and finally transform back to the time domain using the
'inverse' FFT.
Because (sin(x)^2) + (cos(x)^2) = 1, there is no unwanted amplitude
modulation caused by the FFT windowing if a 50 % overlap is used. I use
this method in my own application, and it allows to run filters in 'real
time' which are impossible with the classic FIR implementation (with
convolution in the time domain). You don't even need to design the
filter coefficients; all the algorithm needs is the filter's frequency
response.
A similar method is described in 'The Scientist's Guide to Digital
Signal Processing" (look for the overlap/add method in chapter 18; it's
available online for free ).
Cheers,
Wolf DL4YHF
(happy to be back from hospital)
