You are on page 1of 5

DSP-LAB-4-Task

SUBMITTED BY: SHAZIR ALI KHAN


REG NO # SP18-BTN-004
SUBMITTED TO: Maam Zenab Fazal
DATE: 28 August, 2020
LAB TASK:
Program P1 can be used to evaluate and plot the DTFT of any equation.
% Evaluation of the DTFT
clf;
% Compute the frequency samples of the DTFT
w = -4*pi:8*pi/511:4*pi;
num = [2 1];den = [1 -0.6];
h = freqz(num, den, w);
% Plot the DTFT
subplot(2,1,1)
plot(w/pi,real(h));grid
title('Real part of H(e^{j\omega})')
xlabel('\omega /\pi');
ylabel('Amplitude');
subplot(2,1,2)
plot(w/pi,imag(h));grid
title('Imaginary part of H(e^{j\omega})')
xlabel('\omega /\pi');
ylabel('Amplitude');
pause

FIGURE:
subplot(2,1,1)
plot(w/pi,abs(h));grid
title('Magnitude Spectrum |H(e^{j\omega})|')
xlabel('\omega /\pi');
ylabel('Amplitude');
subplot(2,1,2)
plot(w/pi,angle(h));grid
title('Phase Spectrum arg[H(e^{j\omega})]')
xlabel('\omega /\pi');
ylabel('Phase, radians');

FIGURE:

Question 2: For the given

(𝑧) = 1− 2 /3 𝑧 −1/ (1+ 3/ 7 𝑧−1)(5− 1/ 8 𝑧−1)

Determine the following. a) Pole zero plot using zplane command. b)


Find poles and zeros using both roots and tf2zp commands
% X(z)=1-2/3z^-1/(1+3/7z^-1)(5-1/8z^-1);
num=[1,-2/3,0];
den=[5,113/56,3/56];
zplane(num,den)
num_r= roots(num)
den_r= roots(den)
[z,p,k]=tf2zp(num,den)

FIGURE:

Question 3: For the given

(𝑧) = 1+3𝑧 −1−8𝑧 −2/ (1− 13/ 9 𝑧−1+4𝑧−2)

determine the following. a) Find Pole zero plot using zplane command.
b) Find poles and zeros using both roots and tf2zp commands.
% X(z)=1+3z^-1-8z-2/(1-13/9z^-1+4z-2);
num=[1,3,-8];
den=[1,13/9,4];
zplane(num,den)
numr= roots(num);
denr= roots(den);
[z,p,k]=tf2zp(num,den)

FIGURE:

You might also like