0% found this document useful (0 votes)
76 views5 pages

Submitted To: Course Title: Digital Signal Processing Course Code: ICE322 Topic: Lab Report #04 Section: 01

The document describes a lab report submitted for a Digital Signal Processing course, which includes MATLAB code to compute the N-point DFT of a sequence, plot the magnitude and phase spectrum, and perform linear convolution of sequences using the DFT. The objectives are to learn about the DFT, calculating the N-point DFT, plotting convolution using the DFT, and using linear convolution in the DFT. Sample MATLAB code is provided to demonstrate computing the DFT, plotting the spectrum, and performing linear convolution using the DFT.

Uploaded by

Masuma Zannat
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)
76 views5 pages

Submitted To: Course Title: Digital Signal Processing Course Code: ICE322 Topic: Lab Report #04 Section: 01

The document describes a lab report submitted for a Digital Signal Processing course, which includes MATLAB code to compute the N-point DFT of a sequence, plot the magnitude and phase spectrum, and perform linear convolution of sequences using the DFT. The objectives are to learn about the DFT, calculating the N-point DFT, plotting convolution using the DFT, and using linear convolution in the DFT. Sample MATLAB code is provided to demonstrate computing the DFT, plotting the spectrum, and performing linear convolution using the DFT.

Uploaded by

Masuma Zannat
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/ 5

Course Title: Digital Signal Processing

Course Code: ICE322

Topic: Lab Report #04

Section: 01

Submitted To
Dr. Mohammed Moseeur Rahman (DMMUR)

Chairperson, Assistant Professor

Department of Electronic & Communication Engineering

Submitted By
Name: Joy Chandra Gope

ID: 2017-3-50-004

Name: Tanjim Tabassum

ID: 2017-3-50-002

Name: Aonkon Sharma

ID: 2015-1-50-016

Department of ECE
Semester: Summer-2020

Date of Submission: 14-8-20


Experiment Name: Computation of N-point DFT of a given sequence and plot magnitude and
phase spectrum and perform linear convolution of sequences using DFT in MATLAB

Objective:

1. To learn about DFT.


2. To learn to calculate N-point DFT of a given sequence how it works.
3. To learn how to plot the convolution of sequence using DFT.
4. To learn about linear convolution and how to use linear convolution in DFT.

Sample MATLAB code:

Task 1: Computation of N point DFT of a given sequence and plot magnitude and phase
spectrum:

% clc

% close all

% clear all
%N = input('Enter the value of N in N-Point DFT');
x = [0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 0 1 2 3 4 3 2 1 0]; %input('Enter the
sequence');
N = length (x);
n=[0:1:N-1];
k=[0:1:N-1];
WN=exp(-1j*2*pi/N);
nk=n'*k;
WN_nk=WN.^nk;
Xk=x*WN_nk;
Mag_X=abs(Xk) % Magnitude of the calculated DFT
Phase_X=angle(Xk)*180/pi % Phase
disp('DFT coefficients are')
disp(Xk)
figure(1);
subplot(2,1,1);
stem(k,Mag_X);
subplot(2,1,2);
plot(k,Phase_X);

Figure:
Task 2: Perform linear convolution of two sequences using DFT:
clc;
clear all;
x1= [1 1 1 1 1 1 1 1 1 1]; %input('Enter the first sequence');
x2= [0 1 2 3 4 0 1 2 3 4]; %input('Enter the second sequence');
%n=input('Enter the number of points of the DFT');
subplot(3,1,1);
stem(x1,'filled');
title('Plot of first sequence');
subplot(3,1,2);
stem(x2,'filled');
title('Plot of second sequnce');
n1 = length(x1);
n2 = length(x2);
m = n1+n2-1; % Length of linear convolution
x = [x1 zeros(1,n2-1)]; % Padding of zeros to make it of
% length m
y = [x2 zeros(1,n1-1)];
x_fft = fft(x,m);
y_fft = fft(y,m);
dft_xy = x_fft.*y_fft;
y=ifft(dft_xy,m);
disp('The linear convolution result is ');
disp(y);
subplot(3,1,3);
stem(y,'filled');
title('Plot of convoluted sequences');
Figure:

Task 3: Importance of N:code

x_n=[1 2 3 4 5]; %length L=5


y_n=[3 2 1 0 0]; %length M=3
% N=L+M-1=7
X_k=fft(x_n,7);
Y_k=fft(y_n,7);
Z_k=X_k.*Y_k;
z_n=ifft(Z_k,7)
n1=length(z_n);
m1=0:(n1-1);
X_k1=fft(x_n,10);
Y_k1=fft(y_n,10);
Z_k1=X_k1.*Y_k1;
z_n1=ifft(Z_k1,10);
n11=length(z_n1);
m2=0:(n11-1);
figure(1)
subplot(2,1,1)
stem(m1,z_n)
subplot(2,1,2)
stem(m2,z_n1)
Figure:

You might also like