Aim
To write and perform a MATLAB program to find the circular convolution of two sequences using Discrete Fourier Transform (DFT) and Inverse Discrete Fourier Transform (IDFT).
Problem Statement
Given two sequences:
x(n) = [1 2 3 4]
h(n) = [4 3 2 1]
Find the output of the system using circular convolution, assuming that x(n) is periodic.
Theory
Circular convolution is a special case of convolution in which the sequences are assumed to be periodic. It can be efficiently computed using the Discrete Fourier Transform (DFT) and the Inverse Discrete Fourier Transform (IDFT) as follows:
y(n) = IDFT(DFT(x(n)) * DFT(h(n)))
The steps to compute circular convolution using DFT & IDFT are:
- Compute the DFT of x(n) and h(n).
- Multiply the DFTs of x(n) and h(n) element-wise.
- Compute the IDFT of the product obtained in the previous step.
MATLAB Code
Expected Output
The MATLAB code generates five plots:
- First Sequence (x(n)): The original input sequence x(n) is displayed in the first plot.
- DFT of First Sequence: The second plot shows the magnitude of the DFT of x(n).
- Second Sequence (h(n)): The original input sequence h(n) is shown in the third plot.
- DFT of Second Sequence: The fourth plot shows the magnitude of the DFT of h(n).
- Circular Convolution Output: The fifth plot represents the result of the circular convolution of x(n) and h(n) using DFT & IDFT.
The plots validate the calculation of the circular convolution using the DFT and IDFT, and the effect of the periodicity assumption on the result.