# Discrete-time Fourier transform (DTFT) 10

Posted by **Steve Eddins**,

In the last two posts in my Fourier transform series I discussed the continuous-time Fourier transform. Today I want to start getting "discrete" by introducing the discrete-time Fourier transform (DTFT).

The DTFT is defined by this pair of transform equations:

Here *x[n]* is a discrete sequence defined for all *n*:

I am following the notational convention (see Oppenheim and Schafer, *Discrete-Time Signal Processing*) of using brackets to distinguish between a discrete sequence and a continuous-time function. *n* is unitless. The frequency-domain variable, , is continuous with units of radians.

Note that is periodic with period .

Here are a few common transform pairs:

**Unit Impulse**

**DTFT of Unit Impulse**

**Rectangular Pulse**

**DTFT of Rectangular Pulse**

Note that the DTFT of a rectangular pulse is similar to but not exactly a sinc function. It resembles the sinc function between and , but recall that is periodic, unlike the sinc function.

**Cosine**

**DTFT of Cosine**

The DTFT of a discrete cosine function is a periodic train of impulses:

*I updated the above plot on 6-Jan-2010 to show the location of the impulses. -SE*

Because of the periodicity of it is very common when plotting the DTFT to plot it over the range of just one period: . For example, the DTFT of the rectangular pulse will most often be shown like this:

Next time I'll discuss the relationship between the continuous-time and the discrete-time Fourier transforms. Until then, Happy New Year everyone!

Get
the MATLAB code

Published with MATLAB® 7.9

**Category:**- Fourier transforms

## 10 CommentsOldest to Newest

**1**of 10

Steve, the back track link in the first sentence is broken…other than that thanks for keeping the series going in the new year!

**2**of 10

Thanks, John, I fixed the link.

**3**of 10

Steve,

I just started reading through your collection of posts on Fourier transforms, thank you for posting these.

Perhaps you will get to this in future posts, but my question for you is the following:

When working with signal processing in MATLAB (a digital environment where all signals are in some way discretized and finite), what is the difference between x(t) = cos(t) and x[n] = cos(w0*n)? In other words, the continuous function x(t) can’t really exist in MATLAB, and neither can the continuous transform X(w). Doesn’t this mean that you are always dealing (in some way) with the DFT when working in MATLAB?

– Ben

**4**of 10

Ben—Yes, I’m heading in that direction. I’ll be discussing the relationships between the continuous-time Fourier transform, discrete-time Fourier transform, and discrete Fourier transform.

**5**of 10

Hi Steve,

my math is rusty: I am looking at the plot of DTFT of Cosine and understand the 2Pi peridiocity, but I fail to visualize why I train of 2 pulses around each 2Pi period. Can you elaborate on that a bit more for us snails? Thank you. Matteo

**6**of 10

Matteo—Thanks for reading and for taking the time to comment with your question. I’m relying on feedback from readers to help me adjust both the pacing and the choice of topics in this series.

The pair of impulses near the origin (w=0) correspond to the cosine frequency, +/- w0. (To make these plots I used a frequency of pi/10.) All the other impulses are just from the 2*pi periodicity. Normally a DTFT is plotted showing only one period (-pi to pi), or sometimes a half-period (0 to pi), so you would only see the impulses near the origin.

Your question made me realize I should have included more labels on that particular plot, so I updated the plot to show w0, -w0, and w0+2pi.

**7**of 10

Matteo—Perhaps you were asking why there is a pair of impulses at +/- w0 and not just one at w0? Roughly speaking, the Fourier transform of a signal is an expansion in terms of complex exponential sinusoids, exp(j w n), and cos(w0 n) = (1/2) (exp(j w0 n) + exp(-j w0 n)). That’s why cos(w0 n) shows up as a pair of impulses at +/- w0 in the frequency domain.

**8**of 10

Thanks for both clarifications Steve, my question was about the latter point, but both help. Cheers!

**9**of 10

What matlab code computed these DTFTs? Does matlab has functions to compute DTFT?

**10**of 10

Ahsan—Are you talking about the formulas? I looked those up in a book. You can also find them in Wikipedia.

## Recent Comments