0% found this document useful (0 votes)
14 views

Lab Title: Computation of DFT. Lab Objective

This lab document describes performing a Discrete Fourier Transform (DFT) and Inverse Discrete Fourier Transform (IDFT) using MATLAB. The objectives are to simulate DFT and IDFT, investigate spectra, and comment on results for different signal lengths. The document provides sample MATLAB code for DFT and IDFT and tasks students to analyze DFT magnitude peaks, corresponding frequencies, and effects of zero padding for different signal lengths.

Uploaded by

Hira Majid
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Lab Title: Computation of DFT. Lab Objective

This lab document describes performing a Discrete Fourier Transform (DFT) and Inverse Discrete Fourier Transform (IDFT) using MATLAB. The objectives are to simulate DFT and IDFT, investigate spectra, and comment on results for different signal lengths. The document provides sample MATLAB code for DFT and IDFT and tasks students to analyze DFT magnitude peaks, corresponding frequencies, and effects of zero padding for different signal lengths.

Uploaded by

Hira Majid
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 3

` Lab 02

Lab Title: Computation of DFT. Lab Objective: In this lab, you will learn Simulation of DFT and IDFT Investigate the spectra Tool used: MATLAB Lab Description: Given a sampled signal x(n), its Discrete Fourier Transform(DFT) is given by

The magnitude of the X(k) [i.e. the absolute value] against k is called the spectrum of x(n). The values of k is proportional to the frequency of the signal according to:

Where Fs is the sampling frequency Assuming x is the samples of the signal of length N, then a simple Matlab program to perform the above sum is shown below

Magnitude & Phase Spectrum

Use the above routine to determine and plot the DFT of the following signal:

Where f1=1000Hz and f2=400 Hz with Fs=8000 Hz, and N=128 Note: Plot the magnitude and phase of Xk as follows

Inverse Discrete Fourier Transform Inverse Discrete Fourier Transform (IDFT) is defined as

A simple Matlab routine to perform the inverse DFT may be written as follows

Tasks:
At what value of the index k does the magnitude of the DFT of x has major peaks. What is the corresponding frequency of the two peaks. Perform the above for N=32, 64 and 512. Comment on the results. . Set 128 and generate x(n) for n=0,1,2,.,N-1. Append a further 512 zeros to x(n) as shown below: [Note the number of samples , N=128+512=640]. Xe= [x.zeros (1,512)]; Perform the DFT of the new sequence and plot its magnitude and phase. Compare with the previous result. Explain the effect of zero padding a signal with zero before taking the discrete Fourier Transform Use x(n)={1, 1,1,1} and N=4. Determine the DFT. Record the Magnitude and phase of the DFT. Use the IDFT to transfer the DFT results (i.e Xk sequence) to its original sequence

You might also like