The discrete fourier transform (DFT) is given by:
DFT could be used on getting the fourier transform (FT) of measured signal, numerically validating an analytic computation, and obtaining numerical results for signals whose FT have difficult or no analytic form.
To illustrate how DFT works, we first generate a sinusoidal signal (sin2pi()ft). Below is the plot of the generated signal with f=5 (frequency), T=2 (total signal time), N=256 (number of samples), and the sampling interval (dt) is given by dt=T/N.
We get the fourier transform of the signal. To get the frequency scale, we note that by Nyquist Theorem, the maximum frequency detectable is given by Fmax=1/(2dt). Since half of the output of the FT is just the mirror image of the other half, we just simply shift the half axis, and df=2Fmax/N. The resulting plot is:
The plot peaks at f=5/-5. This is consistent since the frequency of the generated signal is 5. The DFT could also be applied for images. Instead of a temporal signal (temporal domain), we have a spatial signal (spatial domain). The number of frequencies resulting from DFT represents the number of pixels on the original image. The method utilizes the 2 dimensional DFT given by:
The value of each point of X is obtained by multiplying the spatial image with the corresponding base function and summing the result. The base functions are sine and cosine with increasing frequencies. The resulting fourier transform is a complex valued number real and imaginary which represent the magnitude and the phase.
(source: http://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm)
For a fluorescent lamp that flickers around 120Hz, the threshold sampling rate is given by dt=1/(2F). This is around 0.004167 sec. Below is the resulting DFT generated with f=120. In order to have a dt that is below the sampling threshold, N is set to 500 with T=2. We see that peak occurred at around 120. For comparison, we set N=400 with T=2 and we could observe that DFT failed to detect it correctly (peak at 80).
F=120
N=500
T=2
Detected F=120
F=120
N=400
T=2
Detected F=80
Increasing the number of samples (N) increases the frequency range detectable. If the original N results to a sampling interval greater than the threshold indicated by the Nyquist Theorem, increasing N would increase the accuracy of the detected frequency. Below are the plots with increasing N (15,100,256). We see that the results are consistent with the analysis.
F=5
N=15
Detected F=2.3
Max F=4
F=5
N=100
Detected F=5
Max F=25
F=5
N=256
Detected F=5
Max F=80
As indicated by the Nyquist Theorem, decreasing the sampling interval (dt) increases the maximum frequency that could be detected by the FT. This widens the frequency range that could be detected which is appropriate for signals that contain higher frequencies. Below are plots of decreasing dt. We decreased dt by increasing N (since dt=T/N).
dt=.02
Max F=25
dt=.005
Max F=100
Since dt x N=T, increasing N with T fixed decreases dt. This results to a smaller sampling interval and thus, increasing its detection range to higher frequencies without aliasing. Below are plots of increasing N. We could see that the maximum F increases.
N=256
Max F=80
N=400
Max F=80
The analysis above are consistent with the results of the simulations. I want to give myself a 10.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment