Question

EE 448 Homework #6 1. Determine the impulse response, h(n), and plot the magnitude frequency response of each of the followin

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Below is matlab Code

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

close all,
clear all,
clc,

Wn = pi/5;
M=25;

ProjectPath = pwd;
FilePath = strcat(ProjectPath,'\Tables.txt');
fpt = fopen(FilePath,'wt');


figure,
win1 = rectwin(M+1)';
b = fir1(M,Wn,'low',win1,'noscale');
subplot(2,1,1); freqz(b,1,512); title('Low Pass FIR Filter - Mag. Response using Rectangular Window, Fc1 = pi/5');
subplot(2,1,2); impz(b); title('Impulse Response using Rectangular Window, Fc1 = pi/5');

fprintf(fpt,'Low Pass FIR Filter - Mag. Response using Rectangular Window, Fc1 = pi/5\n');
fprintf(fpt,' n b(n) w(n)\n');
for r=1:length(win1)
fprintf(fpt,'%5d%10.4f%10.4f\n',(r-1),win1(r),b(r));
end

figure,
win1 = bartlett(M+1)';
b = fir1(M,Wn,'low',win1,'noscale');
subplot(2,1,1); freqz(b,1,512); title('Low Pass FIR Filter - Mag. Response using bartlett Window, Fc1 = pi/5');
subplot(2,1,2); impz(b); title('Impulse Response using bartlett Window, Fc1 = pi/5');
fprintf(fpt,'\n\n\nLow Pass FIR Filter - Mag. Response using bartlett Window, Fc1 = pi/5\n');
fprintf(fpt,' n b(n) w(n)\n');
for r=1:length(win1)
fprintf(fpt,'%5d%10.4f%10.4f\n',(r-1),win1(r),b(r));
end


figure,
win1 = hamming(M+1)';
b = fir1(M,Wn,'low',win1,'noscale');
subplot(2,1,1); freqz(b,1,512); title('Low Pass FIR Filter - Mag. Response using Hamming Window, Fc1 = pi/5');
subplot(2,1,2); impz(b); title('Impulse Response using Hamming Window, Fc1 = pi/5');
fprintf(fpt,'\n\n\nLow Pass FIR Filter - Mag. Response using Hamming Window, Fc1 = pi/5\n');
fprintf(fpt,' n b(n) w(n)\n');
for r=1:length(win1)
fprintf(fpt,'%5d%10.4f%10.4f\n',(r-1),win1(r),b(r));
end


figure,
win1 = hamming(M+1)';
b = fir1(M,[pi/10 pi/5],'bandpass',win1,'noscale');
subplot(2,1,1); freqz(b,1,512); title('Band Pass FIR Filter - Mag. Response using bartlett Window, Fc1 = [pi/5 3.pi/5]');
subplot(2,1,2); impz(b); title('Impulse Response using bartlett Window, Fc1 = pi/5');
fprintf(fpt,'\n\n\nBand Pass FIR Filter - Mag. Response using bartlett Window, Fc1 = [pi/5 3.pi/5\n');
fprintf(fpt,' n b(n) w(n)\n');
for r=1:length(win1)
fprintf(fpt,'%5d%10.4f%10.4f\n',(r-1),win1(r),b(r));
end
fclose(fpt);

winopen(FilePath);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Mag Response using Rectangular Window, Fc1 pi5 20 20 40 -60 100 09 08 0.7 05 0.4 120 0.3 0.2 0.1 Normalized Frequency (xn radpi/5 Mag. Response using bartlett Window, Fc1 10 20 30 40 50 09 08 07 05 70 0.4 0.3 0.2 0.1 Normalized Frequency (xn rad/sampMag Response using Hamming Window, Fc1 pi/5 20 0 20 40 60 80 09 08 n 7 05 -100 0.4 0.3 0.2 0.1 Normalized Frequency (xn rad/sBand Pass FIR Filter Mag. Response using bartlett Window, Fc1 Ipi/5 3.pi/5] 50 100 0.9 08 0.7 0.5 150 04 03 0.2 0.1 Normalize

Below is Text File

Low Pass FIR Filter - Mag. Response using Rectangular Window, Fc1 = pi/5
n b(n) w(n)
0 1.0000 -0.0113
1 1.0000 -0.0180
2 1.0000 0.0289
3 1.0000 -0.0033
4 1.0000 -0.0329
5 1.0000 0.0333
6 1.0000 0.0128
7 1.0000 -0.0573
8 1.0000 0.0365
9 1.0000 0.0533
10 1.0000 -0.1242
11 1.0000 0.0381
12 1.0000 0.5312
13 1.0000 0.5312
14 1.0000 0.0381
15 1.0000 -0.1242
16 1.0000 0.0533
17 1.0000 0.0365
18 1.0000 -0.0573
19 1.0000 0.0128
20 1.0000 0.0333
21 1.0000 -0.0329
22 1.0000 -0.0033
23 1.0000 0.0289
24 1.0000 -0.0180
25 1.0000 -0.0113

Low Pass FIR Filter - Mag. Response using bartlett Window, Fc1 = pi/5
n b(n) w(n)
0 0.0000 -0.0000
1 0.0800 -0.0014
2 0.1600 0.0046
3 0.2400 -0.0008
4 0.3200 -0.0105
5 0.4000 0.0133
6 0.4800 0.0061
7 0.5600 -0.0321
8 0.6400 0.0234
9 0.7200 0.0383
10 0.8000 -0.0994
11 0.8800 0.0336
12 0.9600 0.5099
13 0.9600 0.5099
14 0.8800 0.0336
15 0.8000 -0.0994
16 0.7200 0.0383
17 0.6400 0.0234
18 0.5600 -0.0321
19 0.4800 0.0061
20 0.4000 0.0133
21 0.3200 -0.0105
22 0.2400 -0.0008
23 0.1600 0.0046
24 0.0800 -0.0014
25 0.0000 -0.0000

Low Pass FIR Filter - Mag. Response using Hamming Window, Fc1 = pi/5
n b(n) w(n)
0 0.0800 -0.0009
1 0.0945 -0.0017
2 0.1369 0.0040
3 0.2047 -0.0007
4 0.2935 -0.0096
5 0.3979 0.0133
6 0.5111 0.0065
7 0.6262 -0.0359
8 0.7359 0.0269
9 0.8332 0.0444
10 0.9121 -0.1133
11 0.9677 0.0369
12 0.9964 0.5292
13 0.9964 0.5292
14 0.9677 0.0369
15 0.9121 -0.1133
16 0.8332 0.0444
17 0.7359 0.0269
18 0.6262 -0.0359
19 0.5111 0.0065
20 0.3979 0.0133
21 0.2935 -0.0096
22 0.2047 -0.0007
23 0.1369 0.0040
24 0.0945 -0.0017
25 0.0800 -0.0009

Band Pass FIR Filter - Mag. Response using bartlett Window, Fc1 = [pi/5 3.pi/5
n b(n) w(n)
0 0.0800 -0.0004
1 0.0945 0.0007
2 0.1369 0.0073
3 0.2047 -0.0010
4 0.2935 -0.0191
5 0.3979 -0.0019
6 0.5111 0.0032
7 0.6262 -0.0085
8 0.7359 0.0770
9 0.8332 0.0677
10 0.9121 -0.1858
11 0.9677 -0.1676
12 0.9964 0.2288
13 0.9964 0.2288
14 0.9677 -0.1676
15 0.9121 -0.1858
16 0.8332 0.0677
17 0.7359 0.0770
18 0.6262 -0.0085
19 0.5111 0.0032
20 0.3979 -0.0019
21 0.2935 -0.0191
22 0.2047 -0.0010
23 0.1369 0.0073
24 0.0945 0.0007
25 0.0800 -0.0004

Add a comment
Know the answer?
Add Answer to:
EE 448 Homework #6 1. Determine the impulse response, h(n), and plot the magnitude frequency response...
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. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • b) When designing a FIR filters, the impulse response of the ideal low-pass filter is usually modified by multiplying i...

    b) When designing a FIR filters, the impulse response of the ideal low-pass filter is usually modified by multiplying it by a windowing function such as the Hamming window which is defined, for an odd number N of samples, by: (2n)-(N-I)-ns(N-1) N-12 wlnl 0.54 + 0.46 cos i What are the advantages of windowing with this function compared 2 with a standard rectangular window? ii) Design a 10th Order Hamming windowed FIR low-pass filter with cut- off frequency at 1000...

  • Styles Paragraph 6. Given the difference equation y(n)-x(n-1)-0.75y(n-1)-0.125(n-2) a. Use MATLAB function filterl) and filticl) to...

    Styles Paragraph 6. Given the difference equation y(n)-x(n-1)-0.75y(n-1)-0.125(n-2) a. Use MATLAB function filterl) and filticl) to calculate the system response y(n)for n 0, 1, 2, 3, 4 with the input of x(n (0.5) u(n)and initial conditions x(-1)--1, y(-2) -2, and y(-1)-1 b. Use MATLAB function filter!) to calculate the system response y(n) for n-0, 1, 2, 3,4 with the input of x(n) (0.5)"u(n)and zero initial conditions x(-1)-0, (-2)-0, and y(-1)-0 Design a 5-tap FIR low pass filter with a cutoff...

  • In this problem, you are asked to design a length-16 FIR low-pass filter with cutoff frequency...

    In this problem, you are asked to design a length-16 FIR low-pass filter with cutoff frequency ωc = π 2 radians, using the window design method. 2. [FIR Filter Design) In this problem, you are asked to design a length-16 FIR low-pass filter with cutoff frequency We = radians, using the window design method. (a) Find an expression for the coefficients {hn}n using a truncation (rectangular) window. (b) Find an expression for the coefficients {n}=l using a Hamming window. (c)...

  • 1. The impulse response of an ideal band pass filter is given by the equation: n=0 h(n)w2 sin(n w...

    Do it using Matlab. 1. The impulse response of an ideal band pass filter is given by the equation: n=0 h(n)w2 sin(n w2) w1 sin (n w1) T nwW2 Using the above equation, write a Matlab program that implements an approximation for the band pass filter with cut-off frequencies (1-0.2π rad/sample and ω2-0.3π rad/sample. Set the order of the filter to 100 or 101. Use a Bartlett window here. Plot the frequency and phase responses of this digital filter. Hint...

  • a) The transfer function of an ideal low-pass filter is and its impulse response is where...

    a) The transfer function of an ideal low-pass filter is and its impulse response is where oc is the cut-off frequency i) Is hLP[n] a finite impulse response (FIR) filter or an infinite impulse response filter (IIR)? Explain your answer ii Is hLP[n] a causal or a non-causal filter? Explain your answer iii) If ae-0. IT, plot the magnitude responses for the following impulse responses b) i) Let the five impulse response samples of a causal FIR filter be given...

  • The impulse response of an ideal band pass filter is given by the equation: n 0 h(n)=-sin(nw.) wl...

    The impulse response of an ideal band pass filter is given by the equation: n 0 h(n)=-sin(nw.) wl sin(nw!) nヂ0 Using the above equation, write a Matlab program that implements an approximation for the band pass filter with cut-off frequencies ω1-0.2π rad/sample and c02-0.3t rad/sample. Set the order of the filter to 100 or 101. Use a Bartlett window here. Plot the frequency and phase responses of this digital filter. The impulse response of an ideal band pass filter is...

  • DSP Lab Exercise 9 Given below are the Impulse Response h(n), of the four main types of FIR Digit...

    DSP Lab Exercise 9 Given below are the Impulse Response h(n), of the four main types of FIR Digital filters. Use appropriate MATLAB expressions to find: a) System Response (H(z) b) Pole-zero diagram c) Amplitude Response d) Phase Response 1. FIR Low-Pass Digital Filter ,n= 0.1 |[d(n) + δ(n-I))-1 h(n) 0, otherwise 2. FIR High-Pass Digital Filter 0, otherwise 3. FIR Band-Pass Digital Filter 0, otherwise 4. FIR Band-Stop Digital Filter , n = 0,2 0, otherwise Note: Your final...

  • Implementing a 3-Band Equaliser

    Design and implement a 3-band equaliser using a DSP board or MPLab/CSS. The  MATLAB Filter Designer could be used for filter design and graphing subject to  the design requirements given below. This is an individual CW 2. Equaliser Primer An n-band equaliser is a device used to correct the frequency response  characteristic of a signal processing system. Equalisers can be implemented using  digital or analogue filters. The whole bandwidth of the equaliser is divided into n  frequency bands, which can...

  • please answer all the question and print matlab code You need to design bandpass filter with lower cutoff freq. of 1000Hz and upper cutoff freq. of 3000Hz. Sampling freq. 10000Hz. Plot the freq. respo...

    please answer all the question and print matlab code You need to design bandpass filter with lower cutoff freq. of 1000Hz and upper cutoff freq. of 3000Hz. Sampling freq. 10000Hz. Plot the freq. response in DB .Use MATLAB as needed a) FIR with Hamming window at least 7 taps b) IIR using Bilinear Transformation method not more than 2end order. c) Compare the frequency response “freqz” plots and which method you recommend and why? 2 graphs on this part. d)...

  • (a) The impulse response hfn of an FIR filter satisfies the following property: h[n]- otherwise where...

    (a) The impulse response hfn of an FIR filter satisfies the following property: h[n]- otherwise where M is an even integer. Derive the filter's frequency response and show that it has a linear phase. Why is linear phase a desired property ? (b) You are asked to design a linear-phase FIR filter. The required pass-band is from 1,000 Hz to 3,000 Hz. The input signal's sampling frequency is 16, 000Hz e the pass-band in the w domain 1. GlV n...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT