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

Find The DFT-transform of The Following Signals X (N) (1,2,3,2)

The document describes an experiment with the following goals: 1. Write a MATLAB function to compute the discrete Fourier transform (DFT) and inverse discrete Fourier transform (IDFT) for spectral analysis of signals. 2. Use the function to find the DFT and IDFT of 4 different signals: {1,2,3,2}, {4,2,0,4}, {1,1,0,0,0,0,0,0}, and {1,0,1,0}. 3. The results of each transformation are displayed to check the function works properly.

Uploaded by

rahulsingh2928
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)
46 views

Find The DFT-transform of The Following Signals X (N) (1,2,3,2)

The document describes an experiment with the following goals: 1. Write a MATLAB function to compute the discrete Fourier transform (DFT) and inverse discrete Fourier transform (IDFT) for spectral analysis of signals. 2. Use the function to find the DFT and IDFT of 4 different signals: {1,2,3,2}, {4,2,0,4}, {1,1,0,0,0,0,0,0}, and {1,0,1,0}. 3. The results of each transformation are displayed to check the function works properly.

Uploaded by

rahulsingh2928
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/ 3

EXPERIMENT – 4

AIM: Write your own MATLAB function to compute DFT (Discrete Fourier Transform) and IDFT
(Inverse Discrete Fourier Transform) for the spectral analysis of signals.

1. Find the DFT-transform of the following signals x(n)={1,2,3,2}

SCRIPT
x = [1 2 3 2];
N = length(x);
w = exp(-(1i)*2*pi/N);
W = w*ones(N);
temp = [0:N-1];
powmat = temp'*temp;
W = W.^powmat;

X = W*x';
clc;
disp(‘x(n)’); disp(x)
disp(‘X(k)’); disp(X’);
COMMAND WINDOW
>> x(n)
>> 1.00 2.00 3.00 2.00
>> X(k)
>> 8.0000 + 0.0000i -2.0000 + 0.0000i 0.0000 + 0.0000i -2.0000 + 0.0000i

2. Find the IDFT of X(K)={4,2,0,4}

SCRIPT
X = [4 2 0 4];
N = length(X);
w = exp(-(1i)*2*pi/N);
W = w*ones(N);
temp = [0:N-1];
powmat = temp'*temp;
W = W.^powmat;

x = (1/N)*(conj(W)*X');
clc;
disp(‘x(n)’); disp(x)
disp(‘X(k)’); disp(X’);
COMMAND WINDOW

>> x(n)
>> 2.5000 + 0.0000i 1.0000 - 0.5000i -0.5000 + 0.0000i 1.0000 + 0.5000i
>> X(k)
>> 4 2 0 4
3. Find the DFT-transform of the following signals x(n)={1,1,0,0,0,0,0,0}

SCRIPT
x = [1 1 0 0 0 0 0 0];
N = length(x);
w = exp(-(1i)*2*pi/N);
W = w*ones(N);
temp = [0:N-1];
powmat = temp'*temp;
W = W.^powmat;

X = W*x';
clc;
disp(‘x(n)’); disp(x)
disp(‘X(k)’); disp(X’);
COMMAND WINDOW

>> x(n)
>> 1 1 0 0 0 0 0 0
>> X(k)
>> Columns 1 through 5
2.0000 + 0.0000i 1.7071 + 0.7071i 1.0000 + 1.0000i 0.2929 + 0.7071i
0.0000 + 0.0000i

Columns 6 through 8
0.2929 - 0.7071i 1.0000 - 1.0000i 1.7071 - 0.7071i

4. Find the IDFT of X(K)={1,0,1,0}

SCRIPT
X = [1 0 1 0];
N = length(X);
w = exp(-(1i)*2*pi/N);
W = w*ones(N);
temp = [0:N-1];
powmat = temp'*temp;
W = W.^powmat;

x = (1/N)*(conj(W)*X');
clc;
disp(‘x(n)’); disp(x)
disp(‘X(k)’); disp(X’);

COMMAND WINDOW
>> x(n)
>> 0.5000 + 0.0000i
0.0000 + 0.0000i
0.5000 - 0.0000i
0.0000 + 0.0000i
>> X(k)
>> 4 2 0 4

2 | EXPERIMENT 4
3 | EXPERIMENT 4

You might also like