Calculate Filter coeeficients dynamicaly

Status
Not open for further replies.
Calculate Filter coefficients dynamicly

I would like to filter input signal with 2 sorts of FIR.

Both of the inputs data are comming from adc1
AudioInputAnalog adc1; // Default is A2

The first FIR's coefficients are constants. Bandwith between 1500Hz and 6000Hz,
and the seconds coefficents are dinamicly calculated from a parameter :
FreqMin = (VBall*19.49-1600) , FreqMax = (VBall*19.49-315).

The difficulties for me is to implement the both filters with only one input...

The goal is to filter RADAR data, to capture a ball speed (sample filtered with the first FIR), and the second FIR, centered to the FreqMin(VBal) and FreqMax(VBal),
to capture the ball's spin, with the same samples..
The capture is during 0.5 seconds.

I understand doing like this:

AudioConnection patchCord1(adc1, fir1);
AudioConnection patchCord2(fir1, fft1024_1);
AudioConnection patchCord3(adc1, fir2);
AudioConnection patchCord4(fir2, fft1024_2);

loop(){
..
fir1.begin(band_pass, NUM_COEFFS);
..
if (fft1024_1.available()) {
VBall = TheMaxFreq(fft1024_1);
}
fir2.begin(CalculateFIR(VBall), NUM_COEFFS);
if (fft1024_2.available()) {
CalculateSpin(fft1024_2);
}

the fft1024_2.data() haven't the same samples as fft1024_1, and should be to long


Have some ideas ?
Using queue doesn't sound good for me !

thx
 
Last edited:
Status
Not open for further replies.
Back
Top