Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
137 views9 pages

Relationship Between DFT and DTFT Using MATLAB

This document compares the discrete Fourier transform (DFT) and discrete-time Fourier transform (DTFT) by generating pulse signals, taking the DFT and DTFT, and plotting the magnitude and phase. It shows that the DFT of a pulse signal is comparable to the DTFT. It also demonstrates taking the DFT for different signal lengths.

Uploaded by

John Tyson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
137 views9 pages

Relationship Between DFT and DTFT Using MATLAB

This document compares the discrete Fourier transform (DFT) and discrete-time Fourier transform (DTFT) by generating pulse signals, taking the DFT and DTFT, and plotting the magnitude and phase. It shows that the DFT of a pulse signal is comparable to the DTFT. It also demonstrates taking the DFT for different signal lengths.

Uploaded by

John Tyson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Experiment No.

2
Relationship between DFT and DTFT
Expression for Pulse Generation and DFT
L=5;
N = 5; x =[1 1 1 1 1];
n =[0 1 2 3 4]; x = [x
zeros(1,N-L)];
stem(n,x) title('Pulse
Signal') xlabel ('Time
Sampling') grid on

DFT

k= 0:1:N-1; y = fft(x);
stem(k,abs(y))
title('Magnitude plot')
ylabel('amplitude')
xlabel ('Time Sampling')
grid on

1
fq =2*pi *(0):2*pi:2*pi *(4);
stem(fq,abs(y))
title('Magnitude plot')
ylabel('amplitude') xlabel
('Frequency(rad/sec)') grid
on

2
stem(k,angle(y))
title('Phase plot')
ylabel('anlgle') xlabel
('Time Sampling') grid
on

3
stem(fq,angle(y))
title('Phase plot')
ylabel('anlgle') xlabel
('Frequency(rad/sec)') grid
on

4
Expression and Plot of DTFT

w = 0:0.01:4*pi;
X = 1+exp(-j*w)+exp(-j*w*2)+exp(-j*w*3)+exp(-j*w*4);
magX = abs(X); angX = angle(X); plot(w/pi,magX)
title('Magnitude plot') ylabel('amplitude') xlabel
('w/pi') grid on

5
plot(w/pi,angX)
title('Phase plot')
ylabel('angle')
xlabel ('w/pi')
grid on

6
Expression of DFT with Roll number
L=5;
N = 183; x =[1 1 1 1 1];
n =[0 1 2 3 4]; x = [x
zeros(1,N-L)]; k= 0:1:N-
1; y = fft(x);
stem(k,abs(y))
title('Magnitude plot')
ylabel('amplitude')
xlabel ('Time Sampling')
grid on

7
stem(k,angle(y)) title('Phase plot') ylabel('anlgle') xlabel ('Time
Sampling') grid on %As you can see the signal is
comparable with DTFT

8
9

You might also like