FREKUENSI SAMPLING




1. fk = 2*sin(2*50*f*k*T);
a.        Script Program
N=64;
T= 1/128;
f= 50;
k= 0:N-1
x= 2*sin(2*pi*f*k*T);
Xf=fft(x)
magXf=abs (Xf);
subplot (3,1,1); plot (x)
subplot (3,1,2)
stem (k(1:N/2), magXf(1:N/2));
xlabel ('k')

hertz=k*(1/(N*T));
subplot (3,1,3)
stem (hertz (1:N/2),magXf(1:N/2))
xlabel ('Hz')

b.      Figure

2.       gk=cos (pi*250*k*T)-sin (pi*200*k*T)
a.       Script Program
N= 64;
T= 1/400;
k= 0:N-1;
f1= 250;
f2= 200;
x1= cos(pi*f1*k*T);
x2= sin (pi*f2*k*T);
gk= x1-x2;
Xf=fft(gk);
magXf=abs (Xf);
subplot (3,1,1); plot (x)
subplot (3,1,2)
stem (k(1:N/2), magXf(1:N/2));
xlabel ('k')

hertz=k*(1/(N*T));
subplot (3,1,3)
stem (hertz (1:N/2),magXf(1:N/2));
xlabel ('Hz')

b.Figure
3.       hk= 5-sin (1000*k*T)
a.       Script Program
N= 32;
T= 1/2000;
f= 1000;
k= 0:N-1;
x= 5- sin (f*k*T);
Xf=fft(x);
magXf=abs (Xf);
subplot (3,1,1); plot (x)
subplot (3,1,2)
stem (k(1:N/2), magXf(1:N/2));
xlabel ('k')

hertz=k*(1/(N*T));
subplot (3,1,3)
stem (hertz (1:N/2),magXf(1:N/2));
xlabel ('Hz')

b.      Figure
4.       mk= 4 sin (f*pi*k*T-pi/4)
a.       Script Program
N= 64;
T= 1/500;
f= 250;
k= 0:N-1;
x= 4*sin((f*pi*k*T)- (pi/4));
Xf=fft(x);
magXf=abs (Xf);
subplot (3,1,1); plot (x)
subplot (3,1,2)
stem (k(1:N/2), magXf(1:N/2));
xlabel ('k')

hertz=k*(1/(N*T));
subplot (3,1,3)
stem (hertz (1:N/2),magXf(1:N/2));
xlabel ('Hz')



b.      Figure

Komentar