Forum Discussion
Altera_Forum
Honored Contributor
14 years ago --- Quote Start --- But if i am right, i need to simulate this model using matlab to atleast figure out the basics of how moving average filter works. --- Quote End --- Simulation using MATLAB is a good approach. The slides have an example of a moving average filter, and an FIR filter. The main difference between a moving average filter and a FIR filter is (potentially) a scaling factor. For example, a 4-point moving average filter is simply the average of 4-samples y[m] = 1/4*sum_{n=0}{n=3} x[m-n] whereas a 4-coefficient FIR filter is y[m] = sum_{n=0}{n=3} h[n]x[m-n] If h[n] = 1/4, then the two are the same. However, there is really no need to have 1/4 for each coefficient, as they can all be 1, and the final sum can be right-shifted by 2-bits to perform the divide by 4. This essentially gets you back to the moving average equation. A moving average filter is a pretty simple filter. It might not be appropriate for your application, but it will help you understand filters, so go ahead and simulate it in both MATLAB and Modelsim. Cheers, Dave