<< Chapter < Page Chapter >> Page >
ω = 2 π k / N

for k = 0 , 1 , ... ( N - 1 ) in [link] , we find that

X tr ( e j ω ) ω = 2 π k N = n = 0 N - 1 x ( n ) e - j ω n ω = 2 π k N = n = 0 N - 1 x ( n ) e - j 2 π k n / N = X N ( k ) .

In short, the DFT values result from sampling the DTFT of the truncated signal.

X N ( k ) = X tr ( e j 2 π k / N )

Windowing effects

Download DTFT.m for the following section.

We will next investigate the effect of windowing when computing the DFT of the signal x ( n ) = cos π 4 n truncated with a window of size N = 20 .

  1. In the same figure, plot the phase and magnitude of W ( e j ω ) , using equations [link] and [link] .
  2. Determine an expression for X ( e j ω ) (the DTFT of the non-truncated signal).
  3. Truncate the signal x ( n ) using a window of size N = 20 and then use DTFT.m to compute X tr ( e j ω ) . Make sure that the plot contains a least 512 points.
    Use the command [X,w] = DTFT(x,512) .
  4. Plot the magnitude of X tr ( e j ω ) .
The plot of a Hamming window (left) and its DTFT (right).

Inlab report

  1. Submit the plot of the phase and magnitude of W ( e j ω ) .
  2. Submit the analytical expression for X ( e j ω ) .
  3. Submit the magnitude plot of X tr ( e j ω ) .
  4. Describe the difference between | X tr ( e j ω ) | and | X ( e j ω ) | . What is the reason for this difference?
  5. Comment on the effects of using a different window for w ( n ) . For example, what would you expect your plots to look like if youhad used a Hamming window in place of the truncation (rectangular) window?(See [link] for a plot of a Hamming window of length 20 and its DTFT.)

The discrete fourier transform

Computing the dft

We will now develop our own DFT functions to help our understanding of how the DFT comes from the DTFT.Write your own Matlab function to implement the DFT of equation [link] . Use the syntax

X = DFTsum(x)

where x isan N point vector containing the values x ( 0 ) , , x ( N - 1 ) and X is the corresponding DFT.Your routine should implement the DFT exactly as specified by [link] using for-loops for n and k , and compute the exponentials as they appear.Note: In Matlab, "j" may be computed with the command j=sqrt(-1) . If you use j = - 1 , remember not to use j as an index in your for-loop .

Test your routine DFTsum by computing X N ( k ) for each of the following cases:

  1. x ( n ) = δ ( n ) for N = 10 .
  2. x ( n ) = 1 for N = 10 .
  3. x ( n ) = e j 2 π n / 10 for N = 10 .
  4. x ( n ) = cos ( 2 π n / 10 ) for N = 10 .

Plot the magnitude of each of the DFT's. In addition, derive simple closed-form analytical expressions for theDFT (not the DTFT!) of each signal.

Inlab report

  1. Submit a listing of your code for DFTsum .
  2. Submit the magnitude plots.
  3. Submit the corresponding analytical expressions.

Write a second Matlab function for computing the inverse DFT of [link] . Use the syntax

x = IDFTsum(X)

where X is the N point vector containing the DFT and x is the corresponding time-domain signal. Use IDFTsum to invert each of the DFT's computed in the previous problem. Plot the magnitudes of the inverted DFT's,and verify that those time-domain signals match the original ones. Use abs(x) to eliminate any imaginary parts which roundoff error may produce.

Inlab report

  1. Submit the listing of your code for IDFTsum .
  2. Submit the four time-domain IDFT plots.

Matrix representation of the dft

The DFT of [link] can be implemented as a matrix-vector product. To see this, consider the equation

X = A x

where A is an N × N matrix, and both X and x are N × 1 column vectors. This matrix product is equivalent to the summation

X k = n = 1 N A k n x n .

where A k n is the matrix element in the k t h row and n t h column of A .By comparing [link] and [link] we see that for the DFT,

A k n = e - j 2 π ( k - 1 ) ( n - 1 ) / N

The - 1 's are in the exponent because Matlab indices start at 1, not 0. For this section, we need to:

  • Write a Matlab function A = DFTmatrix(N) that returns the NxN DFT matrix A.
    Remember that the symbol * is used for matrix multiplication in Matlab, and that . ' performs a simple transpose on a vector or matrix. An apostrophe without the period is a conjugate transpose.
  • Use the matrix A to compute the DFT of the followingsignals. Confirm that the results are the same as in the previous section.
    1. x ( n ) = δ ( n ) for N = 10
    2. x ( n ) = 1 for N = 10
    3. x ( n ) = e j 2 π n / N for N = 10

Inlab report

  1. Print out the matrix A for N = 5 .
  2. Hand in the three magnitude plots of the DFT's.
  3. How many multiplies are required to compute an N point DFT using the matrix method?(Consider a multiply as the multiplication of either complex or real numbers.)

As with the DFT, the inverse DFT may also be represented as a matrix-vector product.

x = B X

For this section,

  1. Write an analytical expression for the elements of the inverse DFT matrix B , using the form of [link] .
  2. Write a Matlab function B = IDFTmatrix(N) that returns the NxN inverse DFT matrix B.
  3. Compute the matrices A and B for N = 5 . Then compute the matrix product C = B A .

Inlab report

  1. Hand in your analytical expression for the elements of B .
  2. Print out the matrix B for N = 5 .
  3. Print out the elements of C = B A . What form does C have? Why does it have this form?

Computation time comparison

Click here for help on the cputime function.

Although the operations performed by DFTsum are mathematically identical to a matrix product, the computation times for these two DFT's in Matlab are quite different.(This is despite the fact that the computational complexity of two procedures is of the same order!)This exercise will underscore why you should try to avoid using for loops in Matlab, and wherever possible, try to formulate your computations using matrix/vector products.

To see this, do the following:

  1. Compute the signal x ( n ) = cos ( 2 π n / 10 ) for N = 512 .
  2. Compute the matrix A for N = 512 .
  3. Compare the computation time of X = DFTsum(x) with a matrix implementation X = A*x by using the cputime function before and after the program execution. Do not include the computation of A in your timing calculations.
Report the cputime required for each of the two implementations. Which method is faster? Which method requires less storage?

Questions & Answers

Three charges q_{1}=+3\mu C, q_{2}=+6\mu C and q_{3}=+8\mu C are located at (2,0)m (0,0)m and (0,3) coordinates respectively. Find the magnitude and direction acted upon q_{2} by the two other charges.Draw the correct graphical illustration of the problem above showing the direction of all forces.
Kate Reply
To solve this problem, we need to first find the net force acting on charge q_{2}. The magnitude of the force exerted by q_{1} on q_{2} is given by F=\frac{kq_{1}q_{2}}{r^{2}} where k is the Coulomb constant, q_{1} and q_{2} are the charges of the particles, and r is the distance between them.
Muhammed
What is the direction and net electric force on q_{1}= 5µC located at (0,4)r due to charges q_{2}=7mu located at (0,0)m and q_{3}=3\mu C located at (4,0)m?
Kate Reply
what is the change in momentum of a body?
Eunice Reply
what is a capacitor?
Raymond Reply
Capacitor is a separation of opposite charges using an insulator of very small dimension between them. Capacitor is used for allowing an AC (alternating current) to pass while a DC (direct current) is blocked.
Gautam
A motor travelling at 72km/m on sighting a stop sign applying the breaks such that under constant deaccelerate in the meters of 50 metres what is the magnitude of the accelerate
Maria Reply
please solve
Sharon
8m/s²
Aishat
What is Thermodynamics
Muordit
velocity can be 72 km/h in question. 72 km/h=20 m/s, v^2=2.a.x , 20^2=2.a.50, a=4 m/s^2.
Mehmet
A boat travels due east at a speed of 40meter per seconds across a river flowing due south at 30meter per seconds. what is the resultant speed of the boat
Saheed Reply
50 m/s due south east
Someone
which has a higher temperature, 1cup of boiling water or 1teapot of boiling water which can transfer more heat 1cup of boiling water or 1 teapot of boiling water explain your . answer
Ramon Reply
I believe temperature being an intensive property does not change for any amount of boiling water whereas heat being an extensive property changes with amount/size of the system.
Someone
Scratch that
Someone
temperature for any amount of water to boil at ntp is 100⁰C (it is a state function and and intensive property) and it depends both will give same amount of heat because the surface available for heat transfer is greater in case of the kettle as well as the heat stored in it but if you talk.....
Someone
about the amount of heat stored in the system then in that case since the mass of water in the kettle is greater so more energy is required to raise the temperature b/c more molecules of water are present in the kettle
Someone
definitely of physics
Haryormhidey Reply
how many start and codon
Esrael Reply
what is field
Felix Reply
physics, biology and chemistry this is my Field
ALIYU
field is a region of space under the influence of some physical properties
Collete
what is ogarnic chemistry
WISDOM Reply
determine the slope giving that 3y+ 2x-14=0
WISDOM
Another formula for Acceleration
Belty Reply
a=v/t. a=f/m a
IHUMA
innocent
Adah
pratica A on solution of hydro chloric acid,B is a solution containing 0.5000 mole ofsodium chlorid per dm³,put A in the burret and titrate 20.00 or 25.00cm³ portion of B using melting orange as the indicator. record the deside of your burret tabulate the burret reading and calculate the average volume of acid used?
Nassze Reply
how do lnternal energy measures
Esrael
Two bodies attract each other electrically. Do they both have to be charged? Answer the same question if the bodies repel one another.
JALLAH Reply
No. According to Isac Newtons law. this two bodies maybe you and the wall beside you. Attracting depends on the mass och each body and distance between them.
Dlovan
Are you really asking if two bodies have to be charged to be influenced by Coulombs Law?
Robert
like charges repel while unlike charges atttact
Raymond
What is specific heat capacity
Destiny Reply
Specific heat capacity is a measure of the amount of energy required to raise the temperature of a substance by one degree Celsius (or Kelvin). It is measured in Joules per kilogram per degree Celsius (J/kg°C).
AI-Robot
specific heat capacity is the amount of energy needed to raise the temperature of a substance by one degree Celsius or kelvin
ROKEEB
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