1 / 6

Lab 9 Improved FIR filter

Lab 9 Improved FIR filter. Using SystemView. Improved FIR filter. Lab objective Use SystemView to simulate/analyze an improved window based filter. This is similar to the filter we analyzed in Lab 8, but is improved by using a Hamming window.

Télécharger la présentation

Lab 9 Improved FIR filter

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lab 9 Improved FIR filter Using SystemView

  2. Improved FIR filter Lab objective Use SystemView to simulate/analyze an improved window based filter. This is similar to the filter we analyzed in Lab 8, but is improved by using a Hamming window. I hope we’ll be able to do a realtime implementation of this filter using the Analog Devices EZ-Kits next week. If not, we’ll implement it using Matlab.

  3. Improved FIR filter First, we’ll use Matlab to generate a Hamming window, and apply it to the truncated and shifted impulse response we used in Lab 8. The formula for the Hamming window is given in Cartinhour, eq. 9-7. Use this formula, in Matlab, to generate a Hamming window with N = 29. Import the filter coefficients we used in lab 8, which are in the file coeffs.txt. Use the Matlab fopen, fscanf, and fclose functions.

  4. Improved FIR filter Save the coeffs.txt file in your Matlab “Work” directory, or in a directory in the search path if using Octave. Open it for reading: fid = fopen(‘coeffs.txt’, ‘r’); create a vector to hold the raw impulse response, then read in the coefficients using fscanf: hi = zeros(1, 29); hi = fscanf(fid, ‘%9f’); Close the file. fclose(fid);

  5. Improved FIR filter Transpose the vector you just read: hi = hi’; Plot the raw impulse response Plot the Hamming window you generated Now, multiply the Hamming window point-by-point with the raw impulse response. If your Hamming window vector is called w, h = w .* hi; Plot the result, note the differences. Now, write the windowed impulse response to a new file.

  6. Improved FIR filter Create a new file ‘hcoeffs.txt’, and open it for writing: fid = fopen(‘hcoeffs.txt’, ‘w’); fprintf(fid, ‘%9.6f\r\n’, h); fclose(fid); Turn in your Matlab code, and your hcoeffs.txt file Now, repeat Lab 8. Use your hcoeffs.txt file in place of the coeffs.txt file you used in Lab 8. Notice the IMPROVED results.

More Related