# Difference between discrete time fourier transform and discrete fourier transform

I have read many articles about DTFT and DFT but am not able to discern the difference between the two except for a few visible things like DTFT goes till infinity while DFT is only till N-1. Can anyone please explain the difference and when to use what? Wiki says

The DFT differs from the discrete-time Fourier transform (DTFT) in that its input and output sequences are both finite; it is therefore said to be the Fourier analysis of finite-domain (or periodic) discrete-time functions.

Is it the only difference?

• The DTFT is a continuous function of frequency, but the DFT is a discrete function of frequency. – John May 29 '14 at 11:09
• The key point is , DFT is sampled version of DFT and the rate is the length of DFT – nmxprime Nov 2 '14 at 3:17
• @nmxprime You mean DFT is sampled version of DTFT? – endolith Aug 28 '16 at 16:51
• @endolith Yes.it is – nmxprime Sep 3 '16 at 7:37
• The article you linked (page 2) says that "CTFT gave us a discrete frequency spectrum". Isn't that wrong? I thought frequency was continuous in that case of continuous time aperiodic signal undergoing the Fourier Transform. – Aditya Nov 20 '18 at 15:53

The discrete-time Fourier transform (DTFT) is the (conventional) Fourier transform of a discrete-time signal. Its output is continous in frequency and periodic. Example: to find the spectrum of the sampled version $x(kT)$ of a continous-time signal $x(t)$ the DTFT can be used.

The discrete Fourier transform (DFT) can be seen as the sampled version (in frequency-domain) of the DTFT output. It's used to calculate the frequency spectrum of a discrete-time signal with a computer, because computers can only handle a finite number of values. I would argue against the DFT output being finite. It is periodic as well and can therefore be continued infinitely.

To sum it up:

                DTFT                | DFT
input    discrete, infinite  | discrete, finite *)
output   contin., periodic   | discrete, finite *)


*) A mathematical property of the DFT is that both its input and output are periodic with the DFT length $N$. That is, although the input vector to the DFT is finite in practice, it's only correct to say that the DFT is the sampled spectrum if the DFT input is thought to be periodic.

• did you not mean that the DTFT input is infinite? – LutzL May 29 '14 at 11:15
• @LutzL It can be infinite in general, yes. I'll change that. What about the DFT output: would you rather call it finite or periodic? – Deve May 29 '14 at 11:22
• i think output of DFT is N-periodic, finite sequence – BaluRaman May 29 '14 at 11:27
• In the DFT, much depends on interpretation. From the technical point of view, it transforms finite to finite. From the point of view that it computes the coefficients of a trigonometric polynomial, one might say that it transforms infinite discrete periodic to finite. But one can shift the window of frequencies used to represent the input, and the amplitudes over all possible frequencies form again a periodic sequence. – LutzL May 29 '14 at 11:38
• To be more consistent I would put "periodic" instead of "finite" for the input of the DFT. This is a direct consequence of the DFT (output) being discrete. – Matt L. May 29 '14 at 14:10

alright, i'm gonna answer this with an argument that "opponents" to my rigid nazi-like position regarding the DFT have.

first of all, my rigid, nazi-like position: the DFT and Discrete Fourier Series is one-and-the-same. the DFT maps one infinite and periodic sequence, $$x[n]$$ with period $$N$$ in the "time" domain to another infinite and periodic sequence, $$X[k]$$, again with period $$N$$, in the "frequency" domain. and the iDFT maps it back. and they're "injective" or "invertible" or "one-to-one".

DFT: $$X[k] = \sum\limits_{n=0}^{N-1} x[n] e^{-j 2 \pi nk/N}$$

iDFT: $$x[n] = \frac{1}{N} \sum\limits_{k=0}^{N-1} X[k] e^{j 2 \pi nk/N}$$

that is most fundamentally what the DFT is. it is inherently a periodic or circular thing.

but the periodicity deniers like to say this about the DFT. it is true, it just doesn't change any of the above.

so, suppose you had a finite-length sequence $$x[n]$$ of length $$N$$ and, instead of periodically extending it (which is what the DFT inherently does), you append this finite-length sequence with zeros infinitely on both left and right. so

$$\hat{x}[n] \triangleq \begin{cases} x[n] \qquad & \text{for } 0 \le n \le N-1 \\ \\ 0 & \text{otherwise} \end{cases}$$

now, this non-repeating infinite sequence does have a DTFT:

DTFT: $$\hat{X}\left(e^{j\omega}\right) = \sum\limits_{n=-\infty}^{+\infty} \hat{x}[n] e^{-j \omega n}$$

$$\hat{X}\left(e^{j\omega}\right)$$ is the Z-transform of $$x[n]$$ evaluated on the unit circle $$e^{j\omega}$$ for infinitely many values of $$\omega$$. now, if you were to sample that DTFT $$\hat{X}\left(e^{j\omega}\right)$$ at $$N$$ equally spaced points on the unit circle, with one point at $$z=1$$, you would get

\begin{align} \hat{X}\left(e^{j\omega}\right)\Bigg|_{\omega = 2 \pi\frac{k}{N}} & = \sum\limits_{n=-\infty}^{+\infty} \hat{x}[n] e^{-j \omega n} \Bigg|_{\omega = 2 \pi\frac{k}{N}} \\ & = \sum\limits_{n=-\infty}^{+\infty} \hat{x}[n] e^{-j 2 \pi k n/N} \\ & = \sum\limits_{n=0}^{N-1} \hat{x}[n] e^{-j 2 \pi k n/N} \\ & = \sum\limits_{n=0}^{N-1} x[n] e^{-j 2 \pi k n/N} \\ & = X[k] \\ \end{align}

that is precisely how the DFT and DTFT are related. sampling the DTFT at uniform intervals in the "frequency" domain causes, in the "time" domain, the original sequence $$\hat{x}[n]$$ to be repeated and shifted by all multiples of $$N$$ and overlap-added. that's what uniform sampling in one domain causes in the other domain. but, since $$\hat{x}[n]$$ is hypothesized to be $$0$$ outside of the interval $$0 \le n < N$$, that overlap-adding does nothing. it just periodically extends the non-zero part of $$\hat{x}[n]$$, our original finite-length sequence.

• The accepted answer was good, but I found your answer to be more insightful. Thank you for providing the actual mathematical connection between the DTFT and DFT... especially the sampling of the spectra causing periodicity in the time-domain. That is a point I always forget. – rayryeng Feb 5 '15 at 16:40
• Your second paragraph seems to imply that DFTs accept input sequences that are infinite in length. Has anyone ever performed an infinite-length DFT? – Richard Lyons May 22 '15 at 11:28
• hey Rick, it's good to see you here from comp.dsp. i remember being greeted by @PeterK when i first sorta migrated over (but i will never leave comp.dsp). anyway, to the same degree that the DFS accepts an input sequence of infinite length is the degree that the DFT accepts an input that is of infinite length. all's i'm saying is that the DFT and the DFS are one-and-the-same. – robert bristow-johnson May 22 '15 at 14:46
• @robert bristow-johnson. this was a beautiful explanation. my question may be bad but, by discrete fourier series, you are referring to the case where the input is a continuous periodic function that goes on infinitely in both directions, correct ? From what I remember say, from reading george silov's dover book, if you make the number of fourier coefficients large enough by using a fine enough grid of frequencies, then the fourier series can reproduce a period continuous function arbitrarily closely. this is the fs you're referring to, when you say they it is the same as DFT, correct ? thx. – mark leeds Oct 26 '17 at 6:52
• by Discrete Fourier Series, i mean the same thing as the DFT and iDFT definitions shown in the answer: $$X[k] = \sum\limits_{n=0}^{N-1} x[n] e^{-j 2 \pi nk/N}$$ $$x[n] = \frac{1}{N} \sum\limits_{k=0}^{N-1} X[k] e^{j 2 \pi nk/N}$$ and, for both $x[n]$ and $X[k]$, they are periodic with a period $N$: $$x[n+N] = x[n] \qquad \forall n \in \mathbb{Z}$$ $$X[k+N] = X[k] \qquad \forall k \in \mathbb{Z}$$ and $N$ is a positive integer. that's all i mean by the DFS. – robert bristow-johnson Oct 26 '17 at 8:22

Since DTFT output is continuous, it can not be processed with computers. So we have to convert this continuous signal into discrete form. It is nothing but DFT as a further advancement on FFT to reduce calculations.

If I am correct, even if DFT input is periodic, although the number of samples is finite, the mathematics behind it treats it as an infinite sequence which periodically commences the N samples after its termination. Please correct me if I am wrong.

• some at comp.dsp that i've had arguments with might "correct" you, but they're wrong. there is no difference between the DFT and the Discrete Fourier Series. none whatsoever. – robert bristow-johnson Nov 1 '14 at 15:36
• To help me understand what's being said here, I have a question regarding the output of the operation you call a "Discrete Fourier series". Is that output a sequence of numbers or a continuous function (an equation)? – Richard Lyons May 22 '15 at 12:04

DFT: $$X[k]=\sum_{n=0}^{N−1} x[n] e^{−j2\pi nk/N}$$ ITS INVERSE WILL BE : $$x[n]=\frac{1}{N} \sum_{k=0}^{N−1} X[k] e^{j2\pi nk/N}$$

• Please use Latex markup so that your math is readable, and explain a bit more of the process you followed, so that your answer can actually help the OP. – MBaz Jan 5 '17 at 15:00