I have used MathDotNet library and implemented digital filtration on the input signal. I am getting 40 samples from my ADC and I am filtering each data sample as I get them. I have used FIR online filter and 2 median filter. In the image there is a red line which is the raw signal and a blue line which is filtered signal. As seen there is a phase shift in my filtered signal. I want to remove it. Any ideas how to do it?
If you want to see my code in vb.net for some idea, then I can post it too.
If you are using a linear phase FIR filter with
N
coefficients operating on a signal sampled at a sampling frequencyfs
, the filter will introduce a delay of0.5*(N-1)*fs
(see for example dspGuru.com). This is perfectly normal.To ease the comparison with the unfiltered signal, you may consider either: