You are on page 1of 5

LAB NO:8

FREQUENCY RESPONSE OF DISCRETE TIME


SYSTEM
OBJECTIVES OF THE LAB:
 Frequency Response of Discrete Time System

Frequency Response of Discrete Time System:


The frequency response is an extremely insightful description for linear time invariant
(LTI) systems. The output of a LTI system at a given frequency is simply the product
of the input at that frequency and thefrequency response.

TASK NO:1
Plot the magnitude and phase of the frequency response of an FIR filter with
coefficients
bk = {1 ‐2 4 ‐2 1}. Determine the type of filter.

CODE:
a=1
b=[1 -2 4 -2 1]
w=-15:1/10000:15;
f=freqz(b,a,w)
subplot(2,1,1)
plot(w,abs(f),'linewidth',2.5)
title('Mag of Frequency Response of filter');
xlabel('omega');
ylabel('H(\omega)');
subplot(2,1,2);
plot(w, angle(f), 'LineWidth', 1.5);
title('Phase of Frequency Response of filter');
xlabel('omega');
ylabel('H(\omega)');
IN MATLAB:

GRAPH:
TASK NO:2
Plot the magnitude and phase of the frequency response of an FIR filter with
coefficients
bk = {1 2 1}. Determine the type of filter.

CODE:
b=[1 2 1];
a=1;
w=-25:1/100:25;
f=freqz(b, a, w);
subplot(2,1,1);
plot(w,abs(f),'LineWidth',2.5);
title('Mag of Frequency Response of filter');
xlabel('omega');
ylabel('H(\omega)');
subplot(2,1,2);
plot(w,angle(h),'LineWidth',2.5);
title('Phase of Frequency Response of filter');
xlabel('omega');
ylabel('H(\omega)');

IN MATLAB:
GRAPH:

TASK NO:3
Plot the magnitude and phase of the frequency response of the following discrete
time
system
Y[n] = 0.08x[n] + 0.34x[n-1] + 0.34x[n-2] + .34x[n-3] + 0.08x[n].
Determine the type of filter.

CODE:
b=[0.16 0.34 0.34 0.34];
a=1;
w=-4:1/100:6;
f=freqz(b, a, w);
subplot(2,1,1);
plot(w,abs(f),'LineWidth',2.5);
title('Mag of Frequency Response of filter');
xlabel('omega');
ylabel('H(\omega)');
subplot(2,1,2);
plot(w,angle(f),'LineWidth',2.5);
title('Phase of Frequency Response of filter');
xlabel('omega');
ylabel('H(\omega)');

IN MATLAB:

GRAPH:

You might also like