I am working with complex samples, I have a main signal at 630KHz, my Fs is 1.26MHz and BW is 12.6KHz.
If I plot a frequency-magntitude spectrum it looks like this:
As you can see along with my main signal at 630KHz, there is data I want to filter out so I'm using BPF and I saw the DSP IIR Realtime C++ filter library which provides a great implementation of this.
I have 2 problem, my first one being the sampling frequency, because I have complex samples and filtering works with linear samples I think I don't need them to divide my sampling frequency by half according to the Nyquist law. I had a thought to solve it by multiplying my Fs by 2 making it 2.52MHz? is that true?
Second problem is more of implementation problem, but when I implied the filter I didn't expect this:
I really have no idea what did it do, but it filtered the main signal I wanted to keep.
This is how I initialized it:
int Fs = 1260000;
int fcenter = 630000;
int BW = 12600;
vector<complex<double>> data;
Iir::Butterworth::BandPass<3> f_real;
Iir::Butterworth::BandPass<3> f_imag;
f_real.setup(Fs*2, fcenter, bw);
f_imag.setup(Fs*2, fcenter, BW);
for(int j = 0; j < 100; j++)
{
float real_val = f_real.filter(temp_value.real());
float imag_val = f_imag.filter(temp_value.imag());
data.push_back({real_val,imag_val});
}
fft(data)