1. Purpose The purpose of this lab is to investigate FIR filtering with windows and apply it to a couple of practical problems. 2. Background Read Unit #3.5 3. Assignment I. Matlab function to display magnitude on a dB scale. The first part of the assignment is to write a quick Matlab function to display the magnitude (only) of the Fourier transform of a given sequence on a dB scale. function ph = magdb(h) % MAGDB Display magnitude of Fourier transform of h[n] on a dB scale. % ph = magdb(h) You did something similar in Lab #4, but here you will use the fft. Specifically, you should recognize that fft(h, N) is equivalent to taking the DTFT of , sampled at N point. You obviously have to choose N to be larger than the length of . Something like 1024 points is a nice number. You’ll plot it on a dB scale, so you can clearly see the stopband ripples. Here’s what you would get if you plotted the magnitude of a 21-pt FIR lowpass filter designed using a rectangular window to truncate the impulse response of an ideal LPF with a cutoff frequency of . The Matlab command would be magdb(fir1(20, 0.5, rectwin(21)).
Note that I’ve also superimposed a grey line on the plot to indicate the frequency response of the ideal lowpass filter. Also, I used the LineWidth and Color options in the plot command to give me a thick, blue line. You will also want to add a way so you can change the color of your plot, so you can eventually display several plots on the same axis, each with a different color and linewidth. One way would be to add input arguments to the function, for example function magdb(h, color, linewidth). But that’s a pretty crummy idea. A better way would be to have the function return a handle to the plot, which you can then manipulate. Here’s the outline of the function: function ph = magdb(h) % MAGDB Display magnitude of Fourier transform of h[n] on a dB scale. % ph = magdb(h) … bunch of code here resulting in array H, which is the magnitude of Fourier transform of h[n]…
ScholarMatic | 24/7 Homework Help
ScholarMatic Will Help You Write Your Essays and Term Papers
Answered » You can buy a ready-made answer or pick a professional tutor to order an original one.
Writing Matlab Code For FIR Filters
Using Matlab, please create window FIR functions. Write a function to display the magnitude of the FFT on the dB scale, write FIR functions using rectangular window, hamming filter, and Kaiser filter. Plot these functions and write a highpass filter. Please see the assignment for a detailed description. Please provide full and documented Matlab code for the complete assignment. I will upload separately any notes and supplemental data necessary.
Document Preview:
HOME TO CERTIFIED WRITERS

Why Place An Order With Us?
- Certified Editors
- 24/7 Customer Support
- Profesional Research
- Easy to Use System Interface
- Student Friendly Pricing
Have a similar question?
ScholarMatic: Get Started
Assignment Writing Service
Feel safe and secure when placing an order on our portal!
Fruitful cooperation begins with solid guarantees, and we are professional enough to promise perfect results. Let’s get it started!




