Wednesday, July 2, 2008

A5 - Physical Measurements for Discrete Fourier Transforms

Discrete Fourier Transform (DFT) is one of the specific forms of Fourier analysis. It transforms a time-domain function into its frequency domain representation.


*AP186 Lecture Notes, Maricor Soriano, 2008

We used the following code by Dr. Soriano in getting the FFT of a temporal signal. Fast Fourier Transform (FFT) is a DFT algorithm.
---

T = 2;
N = 256;
dt = T/N;
t = [0:dt:(N-1)*dt];
f = 5;
y = sin(2*%pi*f*t);
f1 = scf(1); subplot(2,1,1); plot(t,y); xtitle('sin 10*pi*t');

FY = fft(y);
F = 1/(2*dt);
df = 2*F/256;
f = [-(df*(N/2)):df:df*(N/2 -1)];

subplot(2,1,2); plot(f, fftshift(abs(FY))); xtitle('FFT');
---

The following plots show the FFT of a 1-D sinusoid. Observe that peaks on the FFT corresponds to the frequency of the sinusoidal function.







For images, which are two dimensional in nature, we use pixels as our discrete time. Therefore, FT of images is much like doing FT for temporal signals, only that now, we perform spatial FT rather than temporal FT. In SciLab and Matlab, a built-in function called fft2 is used for performing 2-D DFT.

In Mathworks the fft2 algorithm is defined as follows:

fft2(X) can be simply computed as

 fft(fft(X).').'
This computes the one-dimensional DFT of each column X, then of each row of the result.


From the DFT equation above, one could infer that increasing the number of samples N in the signal would result in widening the domain of the FT.

This is supported by the FT analyses of a sinusoidal function with dominant frequency equal to 5. I increased the number of samples from N=128, 256,512 and 1024.



Next, decreasing the sampling interval Δt would increase the Δf in the FT. This suggests that in doing so, you actually decrease the resolution of your frequency analysis.





No comments: