# Bandpass Filter Implementation in C

I've been googling for a while and came across the audio cookbook and Bjorn's blog explaining it further Link Here.

Background info: I've modified the rtl-sdr open source code to tune to a VOR station (transmits heading, typically used for aircraft). I tune to 113.1 MHz which is the the frequency the nearby VOR station transmist data. Inside that 113.1 MHz frequency, there are 3 signals;

1. Morse Code at 1020Hz
2. Reference Signal (9960Hz +- 480Hz) (FM this signal, inside this there is another 30Hz signal)
3. Variable Signal (30Hz)

I'm trying to isolate these signals. Now when I tune to the station (113.1MHz) and perform amplitude modulation, I can hear the Morse code signal from the speaker with lots of noise in the background. I followed the audio cookbook guide along with Bjorn's implementation to write a BPF function (pasted below) to isolate the Morse code signal (1020Hz) to hear only the morse code with very little to no noise in the background. However, I just about hear nothing, it's like someone just really lowered the volume almost to mute. I'm starting with this because if I can actually hear the morse code signal, then that proves that the BPF works and now I can use that function to isolate the other two signals.

The values I used to compute a0 to b2: I also did normalize the a0 to b2 values.

1. Sample Rate: 24KHz
2. Center Freq: 1020Hz
3. BW (in octaves): 1 (don't really understand this)
4. gain: 1 (assuming 1 should be ok but again not really sure)

BPF Function in C Language:

int band_pass_fir(struct morse *_m, int16_t *_signal, int _len)
{
// _m->signal (int16 array) is my desired output
// _signal (int16 array) contains the actual amplitude modulated data received from the signal
// _len is the length of _signal

int i = 2;

const float b0 = 0.1205498139,
b1 = 0,
b2 = -0.1205498139,
a1 = -1.7626236142,
a2 = 0.8273910712;

while (i < _len)
{
_m->signal[i] = (int16_t)(b0 * _signal[i]) +
(int16_t)(b1 * _signal[i-1]) +
(int16_t)(b2 * _signal[i-2]) -
(int16_t)(a1 * _m->signal[i-1]) -
(int16_t)(a2 * _m->signal[i-2]);

_m->signal[i-2] = _m->signal[i-1];
_m->signal[i-1] = _m->signal[i];

i++;
}
}


Questions:

1. To isolate this 1020Hz signal, is it safe to assume I need a BPF? or do I need some other type of filter?
2. Assuming whatever type of filter I need to isolate the 1020Hz would be the same type of filter I would need to isolate the 30Hz signal (variable signal) ? Is that correct?
3. Do you see if I'm doing anything wrong with my above method?