4.4 - DFT, DFS, DTFT [21:37]
-
0:01 - 0:05>> We now understand the Fourier transform of a finite length signal
-
0:05 - 0:08namely, the Discrete Fourier Transform.
-
0:08 - 0:09We are interested to see what happens
-
0:09 - 0:12if the length of the signal grows and grows to infinity.
-
0:12 - 0:14There are two ways to do this:
-
0:14 - 0:17either we take the DFT and we look at what happens
-
0:17 - 0:19as the length goes to infinity,
-
0:19 - 0:23or we take a finite length signal, we periodize it,
-
0:23 - 0:25and compute the discrete Fourier series,
-
0:25 - 0:27and then let the period go to infinity.
-
0:27 - 0:32In both cases, the limit will be the Discrete Time Fourier Transform,
-
0:32 - 0:36which is the natural Fourier transform for infinite-length sequences.
-
0:36 - 0:40This is a powerful, but more subtle object than the DFT,
-
0:40 - 0:45and we will need to understand it quite in detail and with some care.
-
0:45 - 0:52And equipped with a DTFT, we'll be able to think about sequences and their spectras.
-
0:52 - 0:59Module 4.4. Discrete Fourier Transform , Discrete Fourier Series and Discrete Time Fourier Transform.
-
1:01 - 1:07To move from the DFT, to the Discrete Fourier Series, into the Discrete Time Fourier Transform,
-
1:07 - 1:12we are going to start by revisiting the Karplus-Strong algorithm from module two,
-
1:12 - 1:19we're going to see that we can naturally extend the analysis of the DFT
-
1:19 - 1:23to a larger class of signals, and this will lead to the DTFT,
-
1:23 - 1:28and we're going to give an interpretation of this phenomenon.
-
1:28 - 1:33Remember the Karplus-Strong algorithm: you have an input x[n]
-
1:33 - 1:39and there is a feedback from the output with a delay factor z to the minus n,
-
1:39 - 1:43so that's a delay of M samples and multiplication by α,
-
1:43 - 1:46and this is added to the current input.
-
1:46 - 1:48So we have a recursive equation,
-
1:48 - 1:52given at the bottom that describes this Karplus-Strong algorithm.
-
1:52 - 1:57Let's take a signal that is nonzero on exactly one period.
-
1:57 - 2:03So it's nonzero, from 0 to M-1,
-
2:03 - 2:05and for now, we pick α is equal to 1.
-
2:05 - 2:11With this, the period will simply repeat, so the signal starts at 0
-
2:11 - 2:17and we get the first period, x over bar 0 to x over bar M-1,
-
2:17 - 2:24then this period is repeated a second time, a third time and so on, to infinity.
-
2:24 - 2:28As an example, take a 32-tap sawtooth wave.
-
2:28 - 2:35So the sawtooth, starts at -1 at 0, and goes up to +1 at 31.
-
2:35 - 2:45The Discrete Fourier Transform of a length-32 sawtooth wave form can be computed by hand,
-
2:45 - 2:47but we shall not do this here explicitly.
-
2:47 - 2:50There is one value, however, that we can recognize immediately,
-
2:51 - 2:53it's a value for k is equal to 0,
-
2:53 - 2:58because the sawtooth is asymmetric around the x-axis, this will be 0.
-
2:58 - 3:05The other values are computed numerically and are shown on this plot.
-
3:06 - 3:09What if we take the DFT of two periods?
-
3:09 - 3:12So we will repeat the sawtooth from 0 to 31
-
3:12 - 3:17and then from 32 to 63, we have two periods here,
-
3:17 - 3:20and we take a DFT now of size 64.
-
3:22 - 3:28The 64 point DFT looks similar to the 32 point DTF,
-
3:28 - 3:32except that all odd entries are actually exactly equal to 0.
-
3:32 - 3:35So we have same shape of DFT,
-
3:35 - 3:39however in between every nonzero value, there is a 0 value,
-
3:39 - 3:43so there must be something going on that we need to understand.
-
3:45 - 3:48Let's develop some intuition for the DFT of two periods.
-
3:48 - 3:51So when we take the DFT of two periods,
-
3:51 - 3:57we take inner products with the DFT basis vectors of lengths 64.
-
3:57 - 4:02What we will see, is that the even inner product will be different from 0
-
4:02 - 4:06and the odd inner product will be equal to 0.
-
4:06 - 4:11For k is equal to 0, we take the inner product between the first basis vector of the DFT
-
4:11 - 4:14and the sawtooth repeated twice.
-
4:14 - 4:20The first basis vector of the DFT is simply the constant equal to 1 from 0 to 63.
-
4:20 - 4:25And so, the inner product is twice the inner product on the intervals of length 32
-
4:25 - 4:27and this we know, is equal to 0.
-
4:27 - 4:30So, for k is equal to 0, the DFT, again, is equal to 0.
-
4:34 - 4:39For k is equal to 1, the situation is very different.
-
4:39 - 4:42The basis function has sines and cosine,
-
4:42 - 4:47which have an integral period, positive and negative, as the blue function indicates.
-
4:47 - 4:52And therefore, whatever happens on the first half from 0 to 31
-
4:52 - 4:55is canceled by what happens in the second half.
-
4:55 - 4:59So for k is equal to 1, the DFT coefficient is exactly equal to 0.
-
5:02 - 5:04For k is equal to 2,
-
5:04 - 5:09we see that the inner product on the first half of the interval, from 0 to 31,
-
5:09 - 5:14and the second half, 32 through 63, is exactly the same inner product.
-
5:14 - 5:19Therefore, it will be double the DFT of size 32.
-
5:19 - 5:21So it will be nonzero and twice as big
-
5:21 - 5:26as what we know already from the DFT of a sawtooth of length 32.
-
5:29 - 5:32For k=3, we are again in the case of cancellation,
-
5:32 - 5:37now, this is not so obvious as in the case of k=1.
-
5:37 - 5:38But if you watch carefully,
-
5:38 - 5:41you can see that the blue parts multiplied by the red signal
-
5:41 - 5:44have, in pairs, the cancellation property
-
5:44 - 5:49and therefore, the DFT for k=3 is again, going to be equal to 0.
-
5:51 - 5:53Let us now prove this property.
-
5:53 - 5:57So take the DFT, of L periods of the signal.
-
5:57 - 6:01Call this capital X sub L of k.
-
6:01 - 6:07This is a summation from 0 to LM-1, of the usual DFT formula here,
-
6:07 - 6:12and k also goes from 0 to LM-1.
-
6:12 - 6:15Now we split the sum into two parts,
-
6:15 - 6:22one from 0 to L-1 and another one from 0 to M-1.
-
6:22 - 6:25We do this by simply repeating the periods,
-
6:25 - 6:29so write this as y of n plus p times M,
-
6:29 - 6:33so these are the various, the L periods we have.
-
6:33 - 6:36We do the same in the exponent,
-
6:36 - 6:42then we notice that y[n+ pM] is of course, the same as y[n],
-
6:42 - 6:47because our signal y[n] is actually periodic, so we can simplify this.
-
6:47 - 6:50We split the exponents into the two parts,
-
6:50 - 6:55the parts that is dependent on n, the one that is dependent on p.
-
6:55 - 7:01This allows us to simplify the exponent of the second one to 2π over L
-
7:01 - 7:04by simplifying the M.
-
7:04 - 7:09Now we notice on the last line, that we can separate out the summation over p,
-
7:09 - 7:11that's what we put between parentheses,
-
7:11 - 7:17and the second part, which is now simply the DFT of one period,
-
7:17 - 7:22so it's the summation from 0 to M-1.
-
7:24 - 7:26Now comes the aha effect.
-
7:26 - 7:32The sum between parentheses we have seen before, it is a finite geometric series.
-
7:32 - 7:35So when k is a multiple of capital L,
-
7:35 - 7:39then it's a sum from 0 to L-1, of the constant 1,
-
7:39 - 7:43so it's equal to capital L, and otherwise it is exactly equal to 0.
-
7:43 - 7:49This comes, if you remember, from the orthogonality proof we did for the DFT basis.
-
7:50 - 7:55Therefore, we can write the DFT of XL of k:
-
7:55 - 8:02it's equal to L times the DFT of one period, and it's equal to 0 otherwise.
-
8:04 - 8:08With this, we are ready to talk about the Discrete Fourier Series.
-
8:08 - 8:14So the DFT of multiple periods is uniquely determined by the DTF of a single period,
-
8:14 - 8:16we have just proven this.
-
8:16 - 8:21And the DFT synthesis, if we let it run forever, will generate a periodic signal.
-
8:21 - 8:26So the Discrete Fourier Series is really very much like the DFT,
-
8:26 - 8:30except that we explicitly periodize both time and frequency.
-
8:30 - 8:36So we have a periodic time sequence and we have a periodic frequency sequence.
-
8:36 - 8:41And that's the natural definition of a Discrete Fourier Series.
-
8:41 - 8:44We will see that this is similar to the Continuous Time Fourier Series
-
8:44 - 8:50that you might have seen in a course on mathematical analysis, on harmonic analysis.
-
8:50 - 8:55This is a simple incarnation in the Discrete Time Domain of periodic signals
-
8:55 - 8:58and periodic frequency domains.
-
8:58 - 9:03The Discrete Fourier Series helps us in the case of shifts.
-
9:03 - 9:08And remember, when we have finite-length signal, it's unclear how we should define a shift,
-
9:08 - 9:14so we periodize the finite-length signals, that gives us x N periodic (?)
-
9:14 - 9:18and then the DFS is X periodic,
-
9:18 - 9:23and the Inverse Discrete Fourier Series of a shifted version,
-
9:23 - 9:29which corresponds to a phase factor here, is exactly a shift by M.
-
9:29 - 9:31Since it's an infinite periodic sequence,
-
9:31 - 9:37we can easily shift without having to worry about the borders of one period.
-
9:37 - 9:41This discussion of time shift is so important
-
9:41 - 9:44that we are going to go through it one more time in detail.
-
9:44 - 9:49So, assume you have an N-point finite-length signal x[n], with a DFT X[k],
-
9:49 - 9:57how shall we define the IDFT of e to the -j, 2π over n times Mk, of this DFT X[k]?
-
9:57 - 10:01Well, we can just calculate it, but what is the natural interpretation?
-
10:01 - 10:05Well the natural interpretation is to build x tilde of n,
-
10:05 - 10:08which is a periodized version of x[n], so you take x[n]
-
10:08 - 10:12and the index is taken (?) module, capital N.////
-
10:12 - 10:19Then, you calculate the DFT of X[k], which is equal to the DFT of x tilde.
-
10:19 - 10:26The inverse DFT of X[k], multiplied by the shift factor, is inverse DFS, of X tilde of k,
-
10:29 - 10:33which is, as we've just seen X tilde shifted by M,
-
10:33 - 10:37which therefore is x of n minus M module N.
-
10:37 - 10:43So all shifts of finite-length sequences can be seen as circular shifts,
-
10:43 - 10:45as we have discussed in module 2.1,
-
10:45 - 10:52but here they are implicit in the definition of the DFT and the inverse DFT.
-
10:52 - 10:57Now, this was not really Karplus-Strong as we had introduced it,
-
10:57 - 11:01because α was equal to 1, and we simply had a purely periodic signal.
-
11:01 - 11:06So in general, α is smaller than 1, and so the single y[n] has a first period,
-
11:06 - 11:11a second period that is weighted by α, a third one by α squared etcetera,
-
11:11 - 11:16so it will have a geometric decay, so it is truly an infinite signal,
-
11:16 - 11:18it's almost periodic, but not really.
-
11:18 - 11:25And the question is, what would be a good spectral representation for such a signal?
-
11:26 - 11:32What would be the natural definition of the DFT of a signal that gets longer and longer,
-
11:32 - 11:35and what really happens when N goes to infinity?
-
11:35 - 11:41Now the fundamental frequency in the DFT, is given by 2π/N
-
11:41 - 11:44and it's multiplied by k, which is the frequency index.
-
11:44 - 11:49So on the interval 0 to 2π, as N goes to infinity,
-
11:49 - 11:55we get closer and closer frequency values of 2π over capital N.
-
11:55 - 11:58In the limit, this will go towards a continuous frequency
-
11:58 - 12:05and so we could define, formally a sum of x[n] multiplied by e to the jωn,
-
12:07 - 12:10where ω is the limit of 2π over N,
-
12:10 - 12:17when N goes to infinity multiplied by the frequency index k.
-
12:17 - 12:22So this leads to a formal definition of what is called the Discrete Time Fourier Transform,
-
12:22 - 12:27which is a natural Fourier Transform for infinite-length sequences.
-
12:27 - 12:33So x[n] should belong to one of our Hilbert (?) spaces, so that's L2 of Z.
-
12:33 - 12:39And we can define the function of ω, given formally by F of ω is equal to
-
12:39 - 12:46the sum from minus infinity to plus infinity of x[n] times e to the -jωn.
-
12:46 - 12:49Now that's a forward transform, so the key question is,
-
12:49 - 12:55can we come back from that F(ω) and when it exists, and we are going to study it (?), when it doesn't,
-
12:55 - 12:59when we have to be careful, the formal inversion would be
-
12:59 - 13:06x[n] = 1 over 2π, the integral of 1 period of F(ω) times e jωn, dω
-
13:07 - 13:08and n is over all integers.
-
13:10 - 13:15Remember, F(ω) is going to be a 2π periodic function, why is that so?
-
13:15 - 13:18Because the exponent is e to the -jωn.
-
13:18 - 13:24If you add 2π to ω, nothing will change in the formal sum for F(ω).
-
13:24 - 13:26And that's why, in the inversion formula,
-
13:26 - 13:32we take the integral between -π and π.
-
13:32 - 13:36Because of the periodicity, we typically write, not F(ω),
-
13:36 - 13:41but the transform of x[n] as X of e to the jω.
-
13:41 - 13:47This is not necessary, but it's really to be always conscious that X is a capital X,
-
13:47 - 13:51a Discrete-Time Fourier Transform is indeed a 2π periodic function.
-
13:51 - 13:57By convention, x of e to the jω is mapped to the interval, -πi to π.
-
13:57 - 14:01Any other contiguous interval of length 2π would be fine as well,
-
14:01 - 14:04since it's a periodic function.
-
14:04 - 14:09Let us compute an example of a DTFT. The signal is shown here.
-
14:09 - 14:14It's a one-sided decaying geometric series, so the definition is
-
14:14 - 14:20α to the n with an α that is smaller than 1 in magnitude, times the step function un
-
14:20 - 14:21So it starts at 0=1, and then decays exponentially towards 0, at infinity.
-
14:26 - 14:32To compute the DTFT, we first write down the formal definition,
-
14:32 - 14:37so it's the infinite some of x[n]e to the -jωn.
-
14:37 - 14:43This sum is one-sided from 0 to infinity of α to the n, e to the -jωn.
-
14:43 - 14:48We gather the terms α e to the -jω. raised to the nth power.
-
14:48 - 14:51And now, we remember the magic formula,
-
14:51 - 14:55which is a one-sided infinite sum of the geometric series,
-
14:55 - 15:01it's 1 over 1 minus the term that is raised to the power,
-
15:01 - 15:04which here is, αe to the -jω.
-
15:04 - 15:06So we can see this is fairly easily to compute,
-
15:06 - 15:13because in this example we of course know all the details and how to figure them out.
-
15:13 - 15:16We can look at the square magnitude of this DTFT,
-
15:16 - 15:19so that's X of e to jω, magnitude squared.
-
15:19 - 15:26This is simply 1 over, and then we need to multiply the denominator by its complex conjugate,
-
15:26 - 15:33which ends up being 1 plus α squared minus 2α cosω.
-
15:33 - 15:35We would like now to plot this DTFT,
-
15:35 - 15:39so this is slightly different from what we have done for the DFT.
-
15:39 - 15:45We put the 0 frequency n in the middle and we plot from -πi to +π.
-
15:45 - 15:51The positive frequencies go from 0 to π, the negative ones from 0 to -π.
-
15:51 - 15:58Low frequencies are around the origin. High frequencies are towards π and -π.
-
16:00 - 16:04Let us now plot the DTFT we have just calculated.
-
16:04 - 16:09We see here the example for α is equal to 0.9,
-
16:09 - 16:10so it has a maximum at the origin
-
16:10 - 16:16and then decays rapidly towards π.
-
16:16 - 16:18Now remember that the DTFT is periodic,
-
16:18 - 16:23so here is the first period between -π and π.
-
16:23 - 16:30We add the second period, a third period, the fourth period,
-
16:33 - 16:40and we see now this periodic signal that will extend to infinity.
-
16:40 - 16:42Now we are ready to really compute
-
16:42 - 16:47the Discrete-Time Fourier Transform of a real Karplus-Strong signal.
-
16:47 - 16:52So let's take the sawtooth wave of length 32 that we have seen before,
-
16:52 - 16:58the equation is given here, and the graph is displayed at the bottom.
-
16:58 - 17:03So if we look at the symbol y[n], it is built up from u[n], the step function,
-
17:03 - 17:06so it's one-sided to the right,
-
17:06 - 17:11then we have a repetition of the sawtooth, that's x overbar,
-
17:11 - 17:13whereas the index is taken (?) module M.
-
17:13 - 17:18And finally, there is a decay by α to the power of the number of periods,
-
17:18 - 17:25this we can write as taking (?) n/M, and then taking the integer part.
-
17:25 - 17:32To compute the DTFT, we first write formally the expression of the DTFT,
-
17:32 - 17:35so the sum of yne to the -jωn.
-
17:35 - 17:40Then, we split the infinite sum into two sums.
-
17:40 - 17:44One which is over the period, that's going to be a one-sided infinite sum,
-
17:44 - 17:47p from zero to infinity,
-
17:47 - 17:52and a second sum, which is the sum over a period.
-
17:52 - 17:55Then we have α to the p, because that's the decay.
-
17:55 - 18:00Then we have x overbar multiplied by e to the -jω,
-
18:00 - 18:02where we simply have written now,
-
18:02 - 18:09the initial index decomposed into n+pM.
-
18:09 - 18:13The next step is to separate these two summations because they don't interact
-
18:13 - 18:19and we have the summation over p, which is the DTFT,
-
18:19 - 18:22essentially of the sequence α to the p
-
18:22 - 18:29and the DTFT of one period from 0 to capital N minus 1 of x overbar.
-
18:29 - 18:32And so the expression is going to have two components,
-
18:32 - 18:36one that we call A of e to the jωM, another one,
-
18:36 - 18:43which we call X overbar, which is a DTFT of one period.
-
18:44 - 18:50A to the e jω is easy, because that's a DTFT of the one-sided geometric series,
-
18:50 - 18:54we had calculated it just before we show here in the picture.
-
18:54 - 19:01This is taken to the nth power of e to the jω, so that rescales the frequency,
-
19:02 - 19:05so the periodicity is going to be changed by this rescaling factor.
-
19:05 - 19:12So we show here, first for M=1, then M=2, M=3,
-
19:13 - 19:16and for example, M=12.
-
19:16 - 19:21You can see now the repetition pattern is not a periodicity of 2π,
-
19:21 - 19:27but the periodicity of 2 π divided by 12.
-
19:27 - 19:33Now we need the DTFT of one period of the sawtooth, we can go through this exercise
-
19:33 - 19:35and indeed it is left as an exercise.
-
19:35 - 19:39You see here, the expression, it looks a little bit complicated,
-
19:39 - 19:43but it is simple algebraic manipulation that lead to it.
-
19:43 - 19:48So spectrum or the magnitude of the spectrum is shown at the bottom.
-
19:48 - 19:51It has a 0 at the origins, that, of course, we know,
-
19:51 - 19:58and then it has a very particular and decaying pattern with repetitions.
-
19:58 - 20:00Now we can write out the total spectrum,
-
20:00 - 20:05y of e to the jω is equal to the product A e to the jωM,
-
20:05 - 20:06that's very important.
-
20:06 - 20:13That changes the periodicity multiplied by the spectrum of x overbar,
-
20:13 - 20:19and so we recognize this product, it has the repetition pattern and it has the shaping.
-
20:19 - 20:26If we put the two together, we can see that the repetition pattern come from the periodicity,
-
20:26 - 20:33so in this case for example, M (?) is equal to 32 and the shape is actually the spectral shape
-
20:33 - 20:38and gives the timber of the signal.
-
20:38 - 20:42We can now conclude what we have seen in this sub-module.
-
20:42 - 20:46First, we considered a Fourier Transform for finite-length signals,
-
20:46 - 20:48the so-called Discrete Fourier Transform.
-
20:48 - 20:51We extended it to periodic sequences,
-
20:51 - 20:56to have the Discrete Fourier Series, very closely related to the DFT.
-
20:56 - 21:01And then we saw a Fourier Transform for infinite sequences,
-
21:01 - 21:03that we called a Discrete Time Fourier Transform
-
21:03 - 21:10and we introduced it as the extension or the limit of a Discrete Fourier Series
-
21:10 - 21:12when the period goes to infinity.
-
21:12 - 21:15At the very end, we took all this together
-
21:15 - 21:20and we derived a DTFT for a realistic and complicated signal,
-
21:20 - 21:24namely the Karplus-Strong, with a decay and an interesting spectrum.
-
21:24 - 21:26This was a non trivial exercise,
-
21:26 - 21:30but you could see by putting all the elements together that we have seen so far,
-
21:30 - 21:32we managed to actually understand its spectrum.
- Title:
- 4.4 - DFT, DFS, DTFT [21:37]
- Description:
-
See "Chapter 4 Fourier Analysis" in "Signal Processing for Communications" by Paolo Prandoni and Martin Vetterli, available from http://www.sp4comm.org/ , and the slides for the entire module 4 of the Digital Signal Processing Coursera course, in https://spark-public.s3.amazonaws.com/dsp/slides/module4-0.pdf .
And if you are registered for this Coursera course, see https://class.coursera.org/dsp-001/wiki/view?page=week3
- Video Language:
- English
Claude Almansi edited English subtitles for 4.4 - DFT, DFS, DTFT [21:37] | ||
Claude Almansi edited English subtitles for 4.4 - DFT, DFS, DTFT [21:37] | ||
Claude Almansi edited English subtitles for 4.4 - DFT, DFS, DTFT [21:37] | ||
Claude Almansi edited English subtitles for 4.4 - DFT, DFS, DTFT [21:37] | ||
Claude Almansi edited English subtitles for 4.4 - DFT, DFS, DTFT [21:37] | ||
Claude Almansi edited English subtitles for 4.4 - DFT, DFS, DTFT [21:37] | ||
Claude Almansi edited English subtitles for 4.4 - DFT, DFS, DTFT [21:37] | ||
Claude Almansi edited English subtitles for 4.4 - DFT, DFS, DTFT [21:37] |