Beruflich Dokumente
Kultur Dokumente
Tunc Arlsan
You should know the theory of Fourier Transform (FT) by heart for better
understanding of the frequency domain and its relationships. However, it is also
useful to see the big picture to grasp the idea of sampling and FT relationship.
Thus, here is a practical approach to CTFT, DTFT and DFT.
CTFT
(1)
This signal is of infinite extent in time domain and the Fourier transform of it
will then have finite extent (in other words, this signal is band limited).
Obviously when we take the Fourier transform of this signal we will end up
with 2 peaks in the frequency domain; However, both the time domain x(t) and
90
0.6
80
0.4
70
0.2
60
Amplitude
Amplitude
1
0.8
0
-0.2
50
40
-0.4
30
-0.6
20
-0.8
10
-1
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
-80
Time (s)
-60
-40
-20
20
40
60
80
100
Frequency (Hz)
the CTFT of it X(f ) are continuous functions. Thus they can not be stored in
computers. We need to sample them.
DTFT
Since we have the time domain signal at our hand, we can start the sampling
process with it. We sample the time domain signal x(t) with a sampling period
Ts as follows;
x(nTs ) = cos(2f nTs ), n = 0, 1, 2, 3, ....
(2)
One can say that x(nTs ) is also a somewhat continuous signal (since it covers
n Z) however, it is not because n does not belong to the R. Now that
we have a sampled time domain signal, we can try to take the FT of it. We
use discrete time fourier transform (DTFT). DTFT is found by calculating the
following sum;
X
x(nTs )ejn ,
(3)
X() =
n=
90
0.6
80
0.4
70
0.2
60
Amplitude
Amplitude
1
0.8
0
-0.2
50
40
-0.4
30
-0.6
20
-0.8
10
-1
20
40
60
80
100
120
140
160
180
200
Sample Number
0.2
0.4
0.6
0.8
1.2
Normalized Frequency (
1.4
1.6
1.8
Here we sampled the time domain with Fs = 200 Hz, however, the frequency
domain is still continuous ( takes real values between [0 2]). This has several
implications. The most important one is that, when we sample a signal with a
sampling frequency Fs , we are unable to correctly capture the frequency characteristics of the signal that have frequency components more than F2s . This
is also called the Nyquist-Shannon sampling theorem. Aliasing occurs when a
signal is sub sampled. A real life example of this is in Figs. 3a and 3b. Another
important thing is that the DTFT is periodic with 2. Thus the Fig. 2b actually
goes to with its own duplications. This periodic behavior in the frequency
domain comes from the theory of DTFT and is not explained here.
DTF
Now that we sampled the time domain signal and we were able to take the FT
of it using DTFT, we are going to sample the spectrum of the signal using DFT.
DFT is calculated using the following equation;
X[k] =
N
1
X
x[n]ej2kn/N ,
(4)
n=0
where k = 0, 1, 2, ..., K 1 is the sampled frequency axis and x[n] = x[nTs ] with
total number of N samples. The following graphs are the DFT of the same
cosine signal with f = 20 Hz. As you can see from Fig. 4b, the spectrum is now
90
0.6
80
0.4
70
0.2
60
Amplitude
Amplitude
1
0.8
0
-0.2
50
40
-0.4
30
-0.6
20
-0.8
10
-1
0
20
40
60
80
100
120
140
160
180
200
Sample Number
20
40
60
80
100
120
140
160
180
200
Thus we can conclude the relationship between CTFT, DTFT and DFT as
follows;
CT F T (f1 ) = DT F T[0 2] (1 = 2
f1
f1
) = DF T (k1 = K ),
Fs
Fs
(5a)
f1
f1
) = DF T (k1 = K K ), (5b)
Fs
Fs
where f1 is one of the frequency components of the signal of concern, Fs is the
sampling frequency and is assumed to be Fs > 2Fmax and K is the size of the
DFT and is assumed to be K = N = Fs . With these equations, you can easily
calculate the positions of the frequency components of a signal in CTFT, DTFT
and DFT domains.
As an example, for signal in Eq. (1) with Fs = 200 and K = 200,
CT F T (f1 ) = DT F T[0 2] (1 = 2 2
4
4.1
(6a)
(6b)
Important Remarks
Frequency F as a Fractional Number
Lets consider the case where f = 20.3 Hz instead of 20 for Eq. (1) and try
to take its DFT with K = 200. As you can see we observe a DFT with some
80
70
Amplitude
60
50
40
30
20
10
0
20
40
60
80
100
120
140
160
180
200
4.2
90
90
80
80
70
70
60
60
Amplitude
Amplitude
What happens if we have a sampled signal with Fs = 200 Hz and 200 samples
of it but we take K = 400 as size of DFT in MATLAB? As you can see, there is
50
40
50
40
30
30
20
20
10
10
0
20
40
60
80
100
120
140
160
180
200
50
100
150
200
250
300
350
400
(a) DFT of the time domain signal with (b) DFT of the time domain signal with
K = 200.
K = 400.
a distortion at the output of the DFT with K = 400. This has to do with how
MATLAB implements the DFT. First of all, we already know that when we take
the FT of a discontinuous signal, we observe the so called Gibbs effect which
creates ripples at the spectrum. We have a cosine signal with total number of
samples 200, when MATLAB is ordered to take DFT of it with K = 400, it
simple adds 0s to the end of the signal with a total of K N of them. This
is effectively windowing the cosine signal with a rectangular window and it
creates a discontinuity. We also know that the FT of a rectangular window is a
sinc function which has rippes around the origin. Thus a distorted DFT shape
instead of two perfect impulses.
4.2.1
4.3
Conclusion
FT is a powerful tool to learn more about a signal and play with its properties.
But with power, comes great responsibility. When you are sampling a signal or
taking FT, be careful.