The following are my notes on discrete-time Fourier series (DTFS), as well as the discrete-time Fourier transform (DTFT). These topics serve as an important theoretical underpinning to the digital processing of signals by computers using the DFT (which will be covered in a future post).
For discrete-time signals, we use the square bracket notation to denote samples: is the n-th sample of signal .
We’ll say that a discrete-time (just discrete from this point on, for brevity) signal is periodic with period if:
When talking about continuous-time Fourier series, we started with real trigonometric functions and later moved to complex exponentials. Here, we’ll just go ahead and start directly with (discrete) complex exponentials - converting between the two representations isn’t difficult and can be done as needed (Appendix C in this post demonstrates it).
We’ll be dealing with the following family of signals [1]:
These are discrete complex exponentials that are periodic with period N. is the angular frequency. As discussed in Appendix A, there are only N such distinct signals, since:
Coefficients of discrete-time Fourier series
We’ll want to consider the representation of an arbitrary N-periodic by a linear combination of :
The notation means runs over any sequence of consecutive integers. Since there are only distinct signals , the order of summation doesn’t matter - as long as all of them are used. So it could go from 0 to , or from 1 to , or from 2 to , and so on. All of these orders will enumerate all distinct .
Going back to our linear combination:
This is the discrete-time Fourier series (DTFS) representation of and the coefficients are the Fourier series coefficients. Note that there are no convergence issues as in the continuous case, because we’re dealing with a finite sum.
To find the coefficients , we’ll proceed in a way that’s somewhat similar to the continuous case. Multiply both sides of the equation above by and sum over terms:
Interchanging the order of summation on the right-hand side:
By Appendix B, the inner sum on the right-hand side is equal to when and to 0 otherwise. Without loss of generality - since we iterate over consecutive values - let’s just assume this happens in our sum when (and therefore , which is an integer multiple of ).
So our equation becomes:
Or:
To conclude, the Fourier decomposition of a periodic discrete signal into periodic complex exponentials is:
Example: revisiting the triangular function
Let’s revisit the triangular function from the post on Fourier series. Here, we’ll be using the following sampled version:
The sampling is done with 12 samples per period of 4. The spacing between two samples is . Another way to express it:
Substituting this into the definition of , we get:
We then do an odd extension [2] to the range , and repeat it with period .
Using considerations similar to the continuous time case, because our function is odd we just need a sine series here:
The five terms correspond to the five pairs of nonzero-frequency indices; see Appendix C.
And the coefficients are:
We can run this sum over half the period, because the terms at
and are equal (both and the sine change
signs). Also, the terms at and vanish because
:
Looking at the values of :
We can similarly calculate all until :
The resulting Fourier series is therefore:
You can use the following interactive plot to explore this approximation to the discrete triangle function :
The dropdown box selects how many of the terms in the series shown above to plot. The orange crosses show where the series’ values at the integer indices are, and the orange line is interpolated to better visualize the sine waves being added. Note that when all the coefficients are used, the DTFS exactly reconstructs the input signal.
Discrete-time Fourier Transform (DTFT)
In the post on the Fourier Transform we’ve seen how non-periodic signals can be represented in the frequency domain by taking the Fourier series and calculating them at the limit . Here, we’ll do something similar for discrete signals.
Suppose we have a non-periodic discrete signal of finite duration (it’s zero outside a finite range of indices). Here’s a sample plot:
The bottom half is - a periodic signal, one period () of which is equal to . We choose large enough that outside and set .
Since is periodic, we can represent it with DTFS [3]:
We’ll use the notation of angular frequency:
Then:
Now the critical part; since is zero outside , extending the summation to all integers does not change its value:
We’ll define the following continuous function with variable
:
Then at points :
The function is the discrete-time Fourier transform (DTFT) of . The inverse DTFT process reconstructs from , by substituting back into the DTFS:
By our definition of , we have:
Therefore:
Just like in the continuous case, we recognize the sum as a Riemann sum. Let . The spacing tends to zero, and we can rewrite the sum as an integral:
To conclude, the DTFT and inverse DTFT pair are:
is a continuous, periodic function with period , because:
Therefore, it’s enough to run the integral on any interval of length .
The DTFS and DTFT are closely related. Starting with a finite-duration signal , we form a periodic signal by repeating a block of samples containing it. Its DTFS coefficients are equally spaced, scaled samples of the DTFT:
The relation is similar to the one between Fourier series and the Fourier transform in the continuous case.
The DTFT also has useful properties similar to the continuous Fourier transform: linearity, time shifting, the convolution theorem etc, but we won’t spend time on them here.
Appendix A: Discrete-time complex exponentials
Discrete-time complex exponentials have the form where is the angular frequency. The discrete nature of these functions leads to some interesting outcomes; for example, consider the exponential with angular frequency :
Therefore, the exponential at is exactly the same as the exponential at . In considering discrete complex exponentials, we need only choose from a range of length .
Another interesting aspect of these functions concerns their periodicity. In order for to be periodic with some positive integer period , the following must hold:
In other words:
So itself must be an integral multiple of . For some integer :
For a fixed positive integer , let’s consider all complex exponentials for which is a period:
But earlier we’ve said that all complex exponentials with angular frequencies apart are identical. This means that the set above consists of only distinct exponentials. We can choose any starting and get distinct signals with , , and so on until . After that, they begin repeating: and so on.
All of this is very different from the continuous case, where
is a real number. The signals and
agree only at integer values of , so
they are distinct functions of . Consequently, for
a fixed positive period
, the continuous-time exponentials
are distinct for every integer , giving
infinitely many distinct signals.
Appendix B: Sum of consecutive complex exponentials
Let’s consider the following discrete function, defined by a sum:
We’ll want to consider two cases:
(1) When is an integer multiple of : for some integer (for example , , etc.)
In this case, the sum becomes:
Since both and
are integers, the exponent is an
integer multiple of , so:
(2) When is not an integer multiple of , let’s do a variable change :
We can now use the finite sum formula for a geometric progression with the common ratio ; the sum is:
Note that because is not an integer multiple of . However:
Therefore:
While these calculations demonstrate the sums from to
, they work exactly the same for any consecutive
indices, because the summand is periodic in
with period
. Therefore:
Appendix C: Sine series decomposition of
Using the formula for DTFS developed earlier in the post:
Recall that is odd over the full range . Specifically, since the cosine is an even function, we have for any :
Therefore the cosine terms cancel out throughout the period; term 1 is the same as negative term 11, etc.
We’re left with the sines:
All coefficients are purely imaginary. For convenience, let’s write:
Let’s turn back to the Fourier reconstruction formula:
And pair up exponentials at with ones at :
Also, since are real, the conjugate of is:
So adding the paired exponentials with their coefficients and using Euler’s formula:
Therefore:
We don’t include the terms at and , because (sine of an integral multiple of ).
| [1] | There are a lot of symbols used in this equation. is the
"time" index of the signal - its domain;
enumerates the k-th function from a family of
functions - each is a function of ;
is the period; is the imaginary unit. |
| [2] | The odd extension may be slightly confusing because we don’t use negative indices. But indices are arbitrary! In our case, within a single period index is equivalent to ; if we consider one period around the halfway point of , it’s easy to see that the function is indeed odd. |
| [3] | Note that we use , not in the summation for . This is because within the chosen range they are equal. |
is the imaginary unit.