Aim
To write and perform a MATLAB program to find the linear 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) = [1 1 1 1]
Find the output of the system using linear convolution, assuming that x(n) is aperiodic.
Theory
Linear convolution is the process of computing the output of a system with an input sequence and an impulse response (system response). For two sequences x(n) and h(n), the linear convolution can be calculated using the following steps:
y(n) = IDFT(DFT(x(n)) * DFT(h(n)))
The steps involved in calculating linear convolution using DFT and 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).
- Linear Convolution Output: The fifth plot represents the result of the linear convolution of x(n) and h(n) using DFT & IDFT.
The plots validate the calculation of the linear convolution using the DFT and IDFT, showcasing the frequency-domain approach to convolution and its time-domain result.