Lab 10-Descrete Fourier Transform and Circular Convolution
Lab 10-Descrete Fourier Transform and Circular Convolution
Convolution
1 Objectives:
.
This Lab is about desecrate Fourier transform and circular convolution.
Pre Lab
CIRCULAR CONVOLUTION
Remembering that convolution in the TD is multiplication in the FD (and vice-versa) for both
continuous and discrete infinite length sequences, we would like to see what happens for periodic,
finite duration sequences.
In circular or periodic convolution, we can look at the N point sequences as being distributed on a
circle due to the periodicity. Now we do the same thing (line up, multiply and add, then shift), but
with concentric circles. Let ‘s convolves x1(n)= (1,2,3) and x2(n)= (4,5,6). One sequence is
distributed clockwise and the other counterclockwise and the shift of the inner circle is clockwise.
So y(n) is obtained in a manner reminiscent of convolution with the modifications that x1(m) and
x2(m-n) are periodic in m with period N (this makes the ―circular‖ part) and consequently so is
their ―product‖ (periodic in m with period N and circular). Also remember that the summation is
carried out over only ONE period.
The Discrete Fourier transform computes the values of the Z-transform for evenly spaced
points around the circle for a given sequence.
If the sequence to be represented is of finite duration i.e. it has only a finite number of non-
zero values, the transform used is Discrete Fourier transform.
It finds its application in Digital Signal processing including Linear filtering, Correlation
analysis and Spectrum analysis.
x is a complex number Further, assume that the series outside the range 0,
N-1 is extended N-periodic, that is, xk = xk+N for all k. The FT of this series is denoted as X (k)
and has N samples. The forward transform is defined as
1 N −1 − j2 n k N
X(k) =
N n =0
x ( n) e , for k = 0...N − 1
Although the functions here are described as complex series, setting the imaginary part to
0 can represent real valued series. In general, the transform into the frequency domain will be a
complex valued function, that is, with magnitude and phase.
Excercise1: What is the difference in CTFT, DTFT, DFT and FFT. For what purpose FFT is
used. How Z transform is related to DFT.
IN LAB
ALGORITHM/PROCEDURE:
Discrete Fourier Transform
1. Click on the MATLAB icon on the desktop (or go to Start - All Programs and click on
MATLAB) to get into the Command Window
2. Type ‘edit’ in the MATLAB prompt ‘>>’ that appears in the Command window.
3. Write the program in the ‘Edit’ window and save it as ‘m-file’
4. Run the program
5. Enter the input in the command window
6. The result is displayed in the Command window and the graphical output is displayed in
the Figure Window
Library Functions:
• exp: Exponential Function.
exp (X) is the exponential of the elements of X, e to the power X. For complex Z=X+i*Y, exp
(Z) = exp(X)*(COS(Y) +i*SIN(Y)).
Two important concepts used in the application of the DFT are the circular-shift of a sequence and
the circular convolution of two sequences of the same length
Exercise 4: Write a Function for circular shifting a sequence in time domain, x[n-nd]. Take the
signal x and nd as input from user.
Exercise 5: Write function cshift which can circularly flip and then shift the input sequence as
above.
Source Code(DFT):
clc;
clear all;
close all;
%Get the sequence from user
disp('The sequence from the user:');
xn=input('Enter the input sequence x(n):');
%code block to plot the FFT of input sequence using inbuilt function
Code the formula yourself for the sequence
Command Window :
OUTPUT:
POST LAB
Exercise 6: Write a generic program for Circular convolution using discrete convolution. Do not
use any built in Convolution functions.