Verifying a FIR Filter

I am interested in verifying a FIR filter. I have implemented an moving average FIR filter and have written couple of stimulus to verify.

The first stimulus is a sine wave that I expect filter to pass as it is. The filer does. The second stimulus, I pass just an impulse and expect the co-efficient to appear at the output. This is what I actually see.

However, there are two issues I feel need to be taken care of. Firstly, I cannot depend on waveform shape and conclude if filter is working. I have to have quantifiable values and use that as a basis for concluding if filter is working. Eg SNR ...

Secondly, I know, these two checks alone are not sufficient for verification. I even have some ideas about additional stimulus but I don't know what to expect for those stimulus.

For example,

1) I feel, I have to measure the power of the output or power of frequency response. But I don't know how to go about it 2) Similarly, I might have to measure SNR based on sine inputs but don't know what is the acceptable values 2) I also tried adding two sine waves, one with high frequency and one with low frequency and passing it through the filter. I see that output is a low frequency sine wave but it is sort of distorted. I am not sure, if values from high frequencies are getting added, resulting in this distortion

I would like to get inputs on these please ...

Here are the co-efficients of the filer: 0.2 0.2 0.2 0.2 0.2


  • To find the frequency response of your filter you take the inverse FFT of its impulse response. In the case of an FIR these are just the filter coefficients.

  • It's not clear what you are trying to quantify by measuring SNR. The filter itself cannot contribute noise to the system. It can raise or lower the noise floor but this is entirely a function of the filter response. If you want an additional methods to conclude the filter is working then you can step through a series of sine waves of frequencies from low to high, passing the signal through the filter and then measuring the level of the output signal. If you plot each step as a point X=frequency, Y=outputLevel/inputLevel that would be a gain plot and it should match the frequency response.

  • An FIR filter is completely linear. This means that it can only change the amplitude and phase of frequency components already found in the input signal. It cannot introduce new frequencies. The only way you might introduce distortion is if there is you are clipping the signal or if the filter implementation is wrong. You mentioned that your filter is a moving average filter which suggest a low pass. That means lower frequencies will pass through while higher frequencies will be attenuated. How much they are attenuated depends on the coefficients. You are likely seeing the low frequency with an attenuated high frequency riding on top of it. Share your filter coefficients and I can give you more detail.

  • 链接地址: http://www.djcxy.com/p/62152.html

    上一篇: 理解gitk指南?

    下一篇: 验证FIR滤波器