DSP Practical - Experiment 3

To write and perform MATLAB program to find the linear convolution using DFT & IDFT

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:

  1. Compute the DFT of x(n) and h(n).
  2. Multiply the DFTs of x(n) and h(n) element-wise.
  3. Compute the IDFT of the product obtained in the previous step.

MATLAB Code

Expected Output

The MATLAB code generates five plots:

  1. First Sequence (x(n)): The original input sequence x(n) is displayed in the first plot.
  2. DFT of First Sequence: The second plot shows the magnitude of the DFT of x(n).
  3. Second Sequence (h(n)): The original input sequence h(n) is shown in the third plot.
  4. DFT of Second Sequence: The fourth plot shows the magnitude of the DFT of h(n).
  5. 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.