Professional Documents
Culture Documents
DATED: 08-04-2023.
10
Lab # 05
Discrete Fourier Transform and its Properties
LAB TASKS:
TASK-1:
PSEUDO-CODE:
MATLAB CODE:
TASK-2:
DFT [ Nx (−n ) ]= X ( k )
10
PSEUDO-CODE:
LHS:
RHS:
MATLAB CODE:
x = [2 4 6];
N=length(x)
n = [0 1 3];
l = 3;
x1=circular(x,l);
LHS=fft(x1)
n1=linspace(-pi,pi,length(LHS))
subplot(2,1,1)
stem(n1,abs(LHS))
X=fft(x);
RHS=X.*exp(-1j*((2*pi)/N)*n*l);
n2=linspace(-pi,pi,length(LHS))
subplot(2,1,2)
stem(n2,abs(RHS))
10
TASK-3:
LHS:
RHS:
i. Take Fourier transform of signal ‘x’, then absolute of that Fourier transform all in a
single line.
ii. Limit the function using linespace command.
iii. Plot its discrete graph.
10
iv.
MATLAB CODE:
clc
close all
clear all
x=[1 2 3 4 5]
n=1:5
x1=fliplr(x)
m=-1.*x1 ;
LHS=abs(fft(m))
w1=linspace(-pi,pi,length(LHS))
subplot(2,1,1)
stem(w1,LHS)
RHS=abs(fft(x));
w2=linspace(-pi,pi,length(RHS))
subplot(2,1,2)
stem(w2,RHS)
TASK-4:
PSEUDO-CODE:
10
i. Design a function with single output and input name it circonv ( circular convolution).
ii. Input one signal and save it in ‘x’.
iii. Input other signal and save it in ‘h’.
iv. Give limit ‘N’.
v. Perform convolution using for loop.
MATLAB CODE:
TASK-5:
PSEUDO-CODE:
LHS:
10
iv. Take fourier transform of ‘c’ and take its absolute value.
v. Plot its discrete graph.
RHS:
MATLAB CODE:
clc
clear all
close all
x1=[1 2 3]
n1=-1:1
x2=[0 1 2]
n2=[0:2]
c=circonv(x1,x2,length(x1))
y=abs(fft(c))
w1=linspace(-pi,pi,length(y))
subplot(2,1,1)
stem(w1,y)
title('LHS') ;
a=abs(fft(x1))
b=abs(fft(x2))
r=a.*b;
w2=linspace(-pi,pi,length(r))
subplot(2,1,2)
stem(w2,r)
10
CONCLUSION/CRITICAL ANALYSIS:
In this lab I learned:
How to compute and plot Discrete Fourier Transform of a signal using MATLAB
command FFT.
In task 1 I did circular shift of a signal and plotted its graph.
In task 2 I verified the time shifting property on the LHS and RHS of the given function
using circular shift function designed in task 1.
In task 3 I verified duality property on LHS and RHS of the given function.
In task 4 I designed circular convolution function.
In task 5 I took two signals on LHS I convolved both signals and took their fourier
transform and on right RHS I took fourier of both signals separately and convolved them,
the plots were same, hence proving LHS=RHS.
10