<< Chapter < Page Chapter >> Page >

Questions or comments concerning this laboratory should be directedto Prof. Charles A. Bouman, School of Electrical and Computer Engineering, Purdue University, West Lafayette IN 47907;(765) 494-0340; bouman@ecn.purdue.edu

Introduction

This is the second week of a two week laboratory that covers the Discrete Fourier Transform (DFT) and Fast Fourier Transform (FFT).The first week introduced the DFT and associated samplingand windowing effects. This laboratory will continue the discussion of the DFTand will introduce the FFT.

Continuation of dft analysis

This section continues the analysis of the DFT started in the previous week's laboratory.

(DFT) X N ( k ) = n = 0 N - 1 x ( n ) e - j 2 π k n / N (inverse DFT) x ( n ) = 1 N k = 0 N - 1 X N ( k ) e j 2 π k n / N

Shifting the frequency range

In this section, we will illustrate a representation for the DFT of [link] that is a bit more intuitive. First create a Hamming window x of length N = 20 , using the Matlab command x = hamming(20) . Then use your Matlab function DFTsum to compute the 20 point DFT of x . Plot the magnitude of the DFT, | X 20 ( k ) | , versus the index k . Remember that the DFT index k starts at 0 not 1!

Hand in the plot of the | X 20 ( k ) | . Circle the regions of the plot corresponding to low frequency components.

Our plot of the DFT has two disadvantages. First, the DFT values are plotted against k rather then the frequency ω . Second, the arrangement of frequency samples in the DFTgoes from 0 to 2 π rather than from - π to π , as is conventional with the DTFT.In order to plot the DFT values similar to a conventional DTFT plot, we must compute the vector of frequencies in radians per sample,and then “rotate” the plot to produce the more familiar range, - π to π .

Let's first consider the vector w of frequencies in radians per sample.Each element of w should be the frequency of thecorresponding DFT sample X ( k ) , which can be computed by

ω = 2 π k / N k [ 0 , , N - 1 ] .

However, the frequencies should also lie in the range from - π to π . Therefore, if ω π , then it should be set to ω - 2 π . An easy way of making this change in Matlab 5.1 is w(w>=pi) = w(w>=pi)-2*pi .

The resulting vectors X and ware correct, but out of order. To reorder them,we must swap the first and second halves of the vectors. Fortunately, Matlab provides a function specifically forthis purpose, called fftshift .

Write a Matlab function to compute samples of the DTFT and their corresponding frequencies in the range - π to π . Use the syntax

[X,w] = DTFTsamples(x)

where x is an N point vector, X is the length N vector of DTFT samples, and w is the length N vector of corresponding radial frequencies.Your function DTFTsamples should call your function DFTsum and use the Matlab function fftshift .

Use your function DTFTsamples to compute DTFT samples of the Hamming window of length N = 20 . Plot the magnitude of these DTFT samples versus frequencyin rad/sample.

Hand in the code for your function DTFTsamples . Also hand in the plot of the magnitude of the DTFT samples.

Zero padding

The spacing between samples of the DTFT is determined by the number of points in the DFT.This can lead to surprising results when the number of samples is too small.In order to illustrate this effect, consider the finite-duration signal

Questions & Answers

how to create a software using Android phone
Wiseman Reply
how
basra
what is the difference between C and C++.
Yan Reply
what is software
Sami Reply
software is a instructions like programs
Shambhu
what is the difference between C and C++.
Yan
yes, how?
Hayder
what is software engineering
Ahmad
software engineering is a the branch of computer science deals with the design,development, testing and maintenance of software applications.
Hayder
who is best bw software engineering and cyber security
Ahmad
Both software engineering and cybersecurity offer exciting career prospects, but your choice ultimately depends on your interests and skills. If you enjoy problem-solving, programming, and designing software syste
Hayder
what's software processes
Ntege Reply
I haven't started reading yet. by device (hardware) or for improving design Lol? Here. Requirement, Design, Implementation, Verification, Maintenance.
Vernon
I can give you a more valid answer by 5:00 By the way gm.
Vernon
it is all about designing,developing, testing, implementing and maintaining of software systems.
Ehenew
hello assalamualaikum
Sami
My name M Sami I m 2nd year student
Sami
what is the specific IDE for flutter programs?
Mwami Reply
jegudgdtgd my Name my Name is M and I have been talking about iey my papa john's university of washington post I tagged I will be in
Mwaqas Reply
yes
usman
how disign photo
atul Reply
hlo
Navya
hi
Michael
yes
Subhan
Show the necessary steps with description in resource monitoring process (CPU,memory,disk and network)
samuel Reply
What is software engineering
Tafadzwa Reply
Software engineering is a branch of computer science directed to writing programs to develop Softwares that can drive or enable the functionality of some hardwares like phone , automobile and others
kelvin
if any requirement engineer is gathering requirements from client and after getting he/she Analyze them this process is called
Alqa Reply
The following text is encoded in base 64. Ik5ldmVyIHRydXN0IGEgY29tcHV0ZXIgeW91IGNhbid0IHRocm93IG91dCBhIHdpbmRvdyIgLSBTdGV2ZSBXb3puaWFr Decode it, and paste the decoded text here
Julian Reply
what to do you mean
Vincent
hello
ALI
how are you ?
ALI
What is the command to list the contents of a directory in Unix and Unix-like operating systems
George Reply
how can i make my own software free of cost
Faizan Reply
like how
usman
hi
Hayder
The name of the author of our software engineering book is Ian Sommerville.
Doha Reply
what is software
Sampson Reply
the set of intruction given to the computer to perform a task
Noor
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Purdue digital signal processing labs (ece 438). OpenStax CNX. Sep 14, 2009 Download for free at http://cnx.org/content/col10593/1.4
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Purdue digital signal processing labs (ece 438)' conversation and receive update notifications?

Ask