0% found this document useful (0 votes)
134 views

Experiment No: 2: Date

This document describes an experiment to calculate the discrete Fourier transform (DFT) and inverse discrete Fourier transform (IDFT) of a sequence using MATLAB. It provides the theory of DFT and IDFT, the MATLAB program used, and concludes that the program successfully implemented DFT and IDFT to obtain the appropriate outputs.

Uploaded by

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

Experiment No: 2: Date

This document describes an experiment to calculate the discrete Fourier transform (DFT) and inverse discrete Fourier transform (IDFT) of a sequence using MATLAB. It provides the theory of DFT and IDFT, the MATLAB program used, and concludes that the program successfully implemented DFT and IDFT to obtain the appropriate outputs.

Uploaded by

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

EXPERIMENT NO: 2 DATE:

DISCRETE FOURIER TRANSFORM & INVERSE DISCRETE FOURIER


TRANSFORM

AIM OF THE EXPERIMENT: To find DFT and IDFT of a given sequence


using MATLAB.

EQUIPMENT REQUIRED: PC installed with MATLAB Software.

THEORY:

DISCRETE FOURIER TRANSFORM (DFT):The Discrete Fourier


Transform (DFT) computes the values of z-transform for evenly spaced points
around the unit circle for a given sequence.

If the sequence to be represented is of finite duration, i.e. has only a finite number
of non zero values, the transform used is Discrete Fourier Transform
(DFT).DFT finds its applications in digital signal processing including linear
filtering, correlation analysis and spectrum analysis.

Definition:
Let x[n] be a finite duration sequence. The N-DFT of the sequence is expressed by


[] = []/
=
for k=0,1,2,3......N-1.

And the corresponding IDFT is


[] =


[] /
=
for n=0,1,2,3......N-1.
PROGRAM:

clc;
clear all;
close all;
% DFT
x = input('(dft) enter the sequence : ');
N = length(x);
axis = 0 : N - 1;
d = zeros(1, N);
for k = 0 : N - 1
for n = 0 : N - 1
d(k+1) = d(k+1) + x(n+1)*exp((-1*sqrt(-1)*2*pi*k*n)/N) ;
end
end
mag = abs(d);
theta = angle(d);
subplot(2,2,1);
stem(axis, x);
xlabel('n-->');
ylabel('x(n)');
title('Input');
grid on;
subplot(2,2,2);
stem(axis, mag);
xlabel('k-->');
ylabel('|X(k)|')
title('Magnitude');
grid on;
subplot(2,2,3);
stem(axis, theta);
xlabel('k-->');
ylabel('Radians');
title('Phase');
grid on;
% IDFT
d1 = d;
x1 = zeros(1, N);
for n = 0 : N - 1
for k = 0 : N - 1
x1(n+1) = x1(n+1) + (1/N) * (d1(k+1)*exp((1*sqrt(-1)*2*pi*k*n)/N)) ;
end
end
subplot(2,2,4);
stem(axis, x1);
xlabel('n-->');
ylabel('x(n)');
title('Inverse');
grid on;
CONCLUSION: The program for DFT & IDFT was implemented using matlab
and appropriate o/p was obtained.

QUESTIONAIRE:

1) Differentiate between DTFT and DFT. Why it is advantageous to use DFT in computers
rather than DTFT??
Ans:

2) Is DFT efficient for long sequences?Justify.


Ans:

3) State some applications of DFT.


Ans: DFT finds its applications in digital signal processing including linear filtering, correlation
analysis and spectrum analysis.

You might also like