Académique Documents
Professionnel Documents
Culture Documents
n=0
x(n)e[
n=0 N 1
j2kn ] N
x(n) =
k=0
Ck e[
j2kn ] N
x(n) is the sampled signal. N is the total number of acquired data points. n is the time index. k is the frequency index. Ck is the transform (amplitude of the kth frequency). Note that the time signal time-period is T = N t which is the period which repeats. The acquired signal consists of n=0,1,2,3. n=4 is the same as n=0. c 2002 Academic Press
FFT
T is time period of the sampled signal. T = N t. f is the frequency resolution. f = 1/T = 1/(N t) Fs is the sampling frequency. F s = N f = 1/(t) Guideline to choose parameters: Choose an appropriate Fs which is 2.5-4 times the highest frequency of interest. Then choose N to suit the f , the frequency resolution you want. Then automatically all other parameters are decided. 2. EXAMPLE 1 Suppose we have a sine wave of 100 hz frequency, x(t) = sin(2100t) and we choose a sampling frequency of 800 Hz. and choose N=16 because i want a f = 50Hz. F = 100hz, F s = 800Hz, N = 16, x(nt) = sin(2100nt) or 100 n) or x(n) = sin(2 800 2 x(n) = sin(2 n) or 16 Since N=16 points it can be already seen that the k=2 and k=14 (counting from k=0) will be nonzero. In Matlab we write the following lines: N=16;Fs=800; nn=(0:N-1); x=sin(2*pi*2*nn/N); fx=t(x)/N; plot(nn,abs(fx),ko-,MarkerSize,6,LineWidth,2) 3. EXAMPLE 2 Suppose we have a sine wave fo 125 hz frequency, x(t) = sin(2125t) and we choose a sampling frequency of 800 Hz. and choose N=16 because i want a f = 50Hz. F = 125hz, F s = 800Hz, N = 16, x(nt) = sin(2125nt) or 125 n) or x(n) = sin(2 800 2.5 x(n) = sin(2 n) or 16 Since N=16 points it can be already seen that the there is no k=2.5. So the 125 Hz is between 2,3 and 13,14. f = 800/16 = 50Hz. f = 800/16 = 50Hz.
FFT
0.7
0.6
k=2
0.5
k=14
fft amplitude
0.4
0.3
0.2
0.1
10
15
Discrete frequency
Figure 2. DFT of the signal in example 1. Since amplitude of signal is 1 it is shared as 0.5 by 2 bins left and right of the Nyquist frequency.
0.7
0.6
0.5
fft amplitude
0.4
0.3
0.2
0.1
10
15
Discrete frequency
Figure 3. DFT of the signal in example 2. Since there is no bin for k=2.5 the energy gets shared across all the points. And the values at k=2 and k=14 are less than 0.5.
In Matlab we write the following lines: N=16;Fs=800;nn=(0:N-1); x=sin(2*pi*2.5*nn/N); fx=t(x)/N; plot(nn,abs(fx),ko-,MarkerSize,6,LineWidth,2) The DFT looks complicated. The energy is now shared across all the points.