I am working on ECG signal capturing using ADS1292R connected with Arduino uno,
Luckily i found an FIR filter library for arduino, i included that in my code, but i dont know which type of filter is it.
So i used the filter coefficients to plot the phase response in matlab. but i am not really good with signal processing,
Can any one help me understand this phase response?
What type of filter is it?
sampling frequency is 125Hz
I assume the constant slope is caused by a constant delay. Typical for a digital filter.
The jump is in the magnitude of 1 x PI = 180°. therefore I assume it is caused by a (filter) resonance at this frequency.
(At first i thought it is the jump at 360° but then it should be 2 x PI)
I assume a band stop at 50Hz. Just to suppress mains frequency.
Is this reasonable?
It´s really hard to say just with a phase plot. Don´t you have a gain or amplitude plot?
There are free tools in the internet, where you can give your FIR parameters and it prints the plots.
My imagination of a "simple" low pass filter is a RC low pass filter. (Others may see this differentely)
This filter IS a low pass filter, but it behaves somehow differentely to an RC LPF.
You can see the huge attenuation at about 0.84.
What does 0.84 here mean?
Sampling frequency is 125Hz. So nyquist frequency is 62.5Hz. This 62.5Hz ar normalized to be "1".
Now 0.84 x 62.5Hz = 52.5Hz. (point of most attenuation)
--> The attenuation at 50Hz is about 40dB (referenced to the attenaution at 0Hz).
(To improve attenuation at 50Hz you could adjust sample frequency to 120Hz instead 125Hz)
My imagination of a "simple" low pass filter is a RC low pass filter. (Others may see this differentely)
This filter IS a low pass filter, but it behaves somehow differentely to an RC LPF.
Isn't hanning 1-cos(x)? Or something like that?
In my eyes a window function is not compareable with a FIR filter.
The FIR filter has a fixed input stream an output stream..no dedicated count of samples.
A window function like hanning often is used before a FFT for a fixed array of samples. Usually 2^n samples.
*******
So if center frequency is 1Hz, 1Hz, 124Hz, 125Hz, 249Hz, 251Hz, ..... are pass frequencies.
One can explain this with nyquist..or undersampling...where analog frequencies that are larger than half of the sample frequency are mirrored to so called "alias frequencies".
Not exactely the same, but similar.
If there are alias frequencies (because of an inappropriate anti aliasing filter) then it is impossible to differentiate between true frequencies and alias frequencies.
There's a direct relation between window function and FIR impulse response if you look at the FIR direct synthesis method. In brief, you get the FIR coefficient sequence by calculating the fourier transform of the intended filter frequency characteristic and apply a window function.
In any case, you shouldn't expect sophisticated filter properties from a FIR filter with just 5 taps.