Thursday, July 3, 2008

A5 – Physical Measurements from Discrete Fourier Transforms

The activity for today is to create correct frequency scales for FFT patterns.

I. Generate a 1-D sinusoid of the form sin (2*pif t) specifying Δt, and N and the frequency f.
Using the commands:

T = 2 //total time the signal was sampled
N = 256 // total number of samples
dt = T/256 // sampling interval

t = [0:dt:(N-1)*dt];

f = 5

y = sin(2*%pi*f*t);//function

f1 = scf(1);
plot(t,y);

This will give the plot below
II. Get the Fourier transform and compute the frequency scale
Using the commands:

FY = fft(y); // fourier transform
F = 1/(2*dt); // maximum frequency

df = 2*F/256; // discrete frequency in the FT domain
f = [-(df*(N/2)):df:df*(N/2 -1)]; //frequency


plotting the frequency and the shifted fft

f2 = scf(2);
plot(f, fftshift(abs(FY)));

gives the image below:
frequency: -4.5, -5.5, 4.5, 5.5
Note: x axis - frequency and y axis - shifted fft


In an image:
The Discrete Fourier Transform is given by:
In 2-D
IN DFT, the number of frequencies correponds to the number of pixels in the domain image.

The Fourier Transform is used to help us find the geometric characteristics of an image.
To use it in an image, we will use a grayscale image. Find its histogram and PDF. And then we will use the 2-D DFT to find the Fourier image. We will mainly used sine or cosine functions. After using DFT, the image is now decomposed to its sinusoidal components. Then we can find the frequency which corresponds to the number of pixels.


Questions:
a) Light from a fluorescent lamp is known to flicker at 120Hz. What should be the threshold sampling interval for accurate FT analysis?
using the formula:
where
Fmax is the maximun frequency = 120 Hz
We are looking for deltaT which is the threshold sampling interval.
Calculating, the threshold sampling interval is

b) What is the effect of increasing the number of samples N in the FT?

--> increasing the number of samples,increases the peaks.

Using N= 1000, the plot of the FT and frequencies will look like the image below
frequency: - 4.5, -5.5, 4.5, 5.5

c) What is the effect of decreasing the sampling interval Δt in the FT?

--> we can decrease the sampling interval by either increasing the number of samples or decreasing the total time or both. We saw that when the total time is decreased, the frequencies increased. Decreasing the time interval, doesn't affect the peaks of the plot. When we increased the number of samples, we increased the peaks. When we increased the number of samples and decreased the total time, the frequency and peaks increases.

Using T =1
N = 500
frequency: -5,-6, 5, 6

d) What is the effect of fixing the total time interval T but increasing the
number of samples N?

--> when the total time interval is fixed but the number of samples is increased, the peaks are increased.

Acknowledgements:
http://homepages.inf.ed.ac.uk/rbf/HIPR2/fourier.htm

BETH
AIYIN
- for helping me.

Grade:
10/10. because I think I answered all the questions.

0 comments:

 
template by suckmylolly.com