Wednesday, July 2, 2008

Activity5 – Physical Measurements from Discrete Fourier Transforms

a) f=120 Hz signal and FT:
N=256
dt=2/256














b) N=512
dt=2/256
(dt fixed, N increased, T increased)














c) N=256
dt=1/256
(dt decreaased, N fixed, T decreased)















d) N=512
dt=T/256
(dt decreased, N increased, T fixed)














codes:
a)
T = 2;
N = 256;
dt = 2/256;
t = [0:dt:(N-1)*dt];
f = 120;
y = sin(2*%pi*f*t);
f1 = scf(1); plot(t,y);
FY = fft(y);
F = 1/(2*dt);
df = 2*F/256;
f = [-(df*(N/2)):df:df*(N/2 -1)];
f2 = scf(2); plot(f, fftshift(abs(FY)));

b)T = 2;
N = 512;
dt = 2/256;
t = [0:dt:(N-1)*dt];
f = 120;
y = sin(2*%pi*f*t);
f1 = scf(1); plot(t,y);
FY = fft(y);
F = 1/(2*dt);
df = 2*F/512;
f = [-(df*(N/2)):df:df*(N/2 -1)];
f2 = scf(2); plot(f, fftshift(abs(FY)));

c)T = 2;
N = 256;
dt = 1/256;
t = [0:dt:(N-1)*dt];
f = 120;
y = sin(2*%pi*f*t);
f1 = scf(1); plot(t,y);
FY = fft(y);
F = 1/(2*dt);
df = 2*F/256;
f = [-(df*(N/2)):df:df*(N/2 -1)];
f2 = scf(2); plot(f, fftshift(abs(FY)));

d)T = 2;
N = 512;
dt = T/512;
t = [0:dt:(N-1)*dt];
f = 120;
y = sin(2*%pi*f*t);
f1 = scf(1); plot(t,y);
FY = fft(y);
F = 1/(2*dt);
df = 2*F/512;
f = [-(df*(N/2)):df:df*(N/2 -1)];
f2 = scf(2); plot(f, fftshift(abs(FY)));

grade:10/10

No comments: