Question

7. Optimal Lowpass Filter. Use the MATLAB command h = firpm(28, [0 0.30 0.36 1], [1...

7. Optimal Lowpass Filter. Use the MATLAB command h = firpm(28, [0 0.30 0.36 1], [1 1 0 0]) to design an optimal lowpass filter with length 29, passband from 0 to wp = 0.30pi and a stopband from ws = 0.36pi to pi with a desired response of 1 in the passband and zero in the stopband. (Assume equal error weighting in both the passband and stopband for the optimal filter in all exercises except Exercise 11.) Plot the impulse response and the magnitude frequency response of the filter. By hand, circle the alternation points.

Homework Answers

Answer #1

MATLAB code for impulse response and magnitude response is shown below:

h = firpm(28, [0 0.30 0.36 1], [1 1 0 0]);
w = (-pi:pi/100:pi);
z = exp(-j*w);
for i = 1:length(h)
h1(i,1:length(z)) = z.^(i-1);
end
semilogx(w/pi,20*log10(abs(htf)))
plot(w/pi,20*log10(abs(htf)))
grid on
hold all
xlabel('\omega/\pi')

ylabel('magnitude(dB)')

figure

stem((0:1:length(h)-1),h);

Impulse response is shown below:

Magnitude response is shown below:

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
MATLAB FIR filter design. The audio file, covering the frequency range of roughly 0 to 3000...
MATLAB FIR filter design. The audio file, covering the frequency range of roughly 0 to 3000 Hz, is very badly corrupted with high?level noise. Your problem is to design a digital filter that will sufficiently attenuate the noise so that the audio speech is intelligible. (sorry but chegg doesn't allow me to attach the wav file) Here is the design template: clear, clc % clear all variables %% Read in the noisy audio signal from the file 'CapnJ.wav' using audioread...
Problem 1....... you can use Matlab The following Scilab code generates a 10-second “chirp” with discrete...
Problem 1....... you can use Matlab The following Scilab code generates a 10-second “chirp” with discrete frequencies ranging from 0 to 0.2 with a sampling frequency of 8 kHz. clear; Fs = 8000; Nbits = 16; tMax = 10; N = Fs*tMax+1; f = linspace(0.0,0.2,N); x = zeros(f); phi = 0; for n=0:N-1 x(n+1) = 0.8*sin(phi); phi = phi+2*%pi*f(n+1); end sound(x,Fs,Nbits); sleep(10000); //allows full sound to play Add code that calculates and plays y (n)=h(n)?x (n) where h(n) is the...
Problem 3 you can use Matlab and also i give u the Problem 1 code its...
Problem 3 you can use Matlab and also i give u the Problem 1 code its on Matlab Using the same initial code fragment as in Problem 1, add code that calculates and plays y (n)=h(n)?x (n) where h(n) is the impulse response of an IIR bandpass filter with band edge frequencies 750 Hz and 850 Hz and based on a 4th order Butterworth prototype. Name your program p3.sce this is the Problem 1 code and the solutin clear; clc;...
Problem 1 ...... you can use Matlan i got one so all what i need is...
Problem 1 ...... you can use Matlan i got one so all what i need is 2, 3 and 4 one of them or all of them .. thanks The following Scilab code generates a 10-second “chirp” with discrete frequencies ranging from 0 to 0.2 with a sampling frequency of 8 kHz. clear; Fs = 8000; Nbits = 16; tMax = 10; N = Fs*tMax+1; f = linspace(0.0,0.2,N); x = zeros(f); phi = 0; for n=0:N-1 x(n+1) = 0.8*sin(phi); phi...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT