Академический Документы
Профессиональный Документы
Культура Документы
close all;
Yfft = fft(y,n);
P2 = abs(Yfft/L);
P1 = P2(1:n/2+1);
P1(1:end-1) = 2*P1(1:end-1);
figure;
subplot(2,2,1); plot(t,x);
title ('Sinyal Sebelum LowPass Orde8 FC500');
subplot(2,2,2); plot(0:(Fsampling/n):(Fsampling/2-Fsampling/n),P1_x(1:n/2));
title ('FFT Sebelum LowPass Orde8 FC500');
subplot(2,2,3); plot(t,y);
title ('Sinyal Sesudah LowPass Orde8 FC500');
subplot(2,2,4); plot(0:(Fsampling/n):(Fsampling/2-Fsampling/n),P1(1:n/2));
title ('FFT Sesudah LowPass Orde8 FC500');
Grafik LowPass Orde 8 dengan FC 500
BandPass Orde 8 dengan FC 50 dan 200
close all;
x7=0;x6=0;x5=0;x4=0;x3=0;x2=0;x1=0;x0=0;
for i=1:L
x8=x7;
x7=x6;
x6=x5;
x5=x4;
x4=x3;
x3=x2;
x2=x1;
x1=x0;
x0=x(i);
y=b0*x0 + b1*x1 + b2*x2 + b3*x3 + b4*x4 + b5*x5 + b6*x6...
+ b7*x7 + b8*x8;
yfilter(i)=y;
end
y = yfilter';
%-----------------Fast Fourier Transform (FFT) ----------------------
n = 2^nextpow2(L);
Yfft_x = fft(x,n);
P2_x = abs(Yfft_x/L);
P1_x = P2_x(1:n/2+1);
P1_x(1:end-1) = 2*P1_x(1:end-1);
Yfft = fft(y,n);
P2 = abs(Yfft/L);
P1 = P2(1:n/2+1);
P1(1:end-1) = 2*P1(1:end-1);
figure;
subplot(2,2,1); plot(t,x);
title ('Sinyal Sebelum BandPass Orde8 FC50&200');
subplot(2,2,2); plot(0:(Fsampling/n):(Fsampling/2-Fsampling/n),P1_x(1:n/2));
title ('FFT Sebelum BandPass Orde8 FC50&200');
subplot(2,2,3); plot(t,y);
title ('Sinyal Sesudah BandPass Orde8 FC50&200');
subplot(2,2,4); plot(0:(Fsampling/n):(Fsampling/2-Fsampling/n),P1(1:n/2));
title ('FFT Sesudah BandPass Orde8 FC50&200');
Grafik BandPass Orde 8 dengan FC 50 dan 200
4.2
Yfft = fft(y,n);
P2 = abs(Yfft/L);
P1 = P2(1:n/2+1);
P1(1:end-1) = 2*P1(1:end-1);
figure;
subplot(2,2,1); plot(t,x);
title ('Sinyal Sebelum HIGHPass Orde 20 FC500');
subplot(2,2,2); plot(0:(Fsampling/n):(Fsampling/2-Fsampling/n),P1_x(1:n/2));
title ('FFT Sebelum HIGHPass Orde 20 FC500');
subplot(2,2,3); plot(t,y);
title ('Sinyal Sesudah HIGHPass Orde 20 FC500');
subplot(2,2,4); plot(0:(Fsampling/n):(Fsampling/2-Fsampling/n),P1(1:n/2));
title ('FFT Sesudah HIGHPass Orde 20 FC500');
Grafik LowPass Orde 20 dengan FC 500
Yfft = fft(y,n);
P2 = abs(Yfft/L);
P1 = P2(1:n/2+1);
P1(1:end-1) = 2*P1(1:end-1);
figure;
subplot(2,2,1); plot(t,x);
title ('Sinyal Sebelum BandPass Orde20 FC50&200');
subplot(2,2,2); plot(0:(Fsampling/n):(Fsampling/2-Fsampling/n),P1_x(1:n/2));
title ('FFT Sebelum BandPass Orde20 FC50&200');
subplot(2,2,3); plot(t,y);
title ('Sinyal Sesudah BandPass Orde20 FC50&200');
subplot(2,2,4); plot(0:(Fsampling/n):(Fsampling/2-Fsampling/n),P1(1:n/2));
title ('FFT Sesudah BnadPass Orde20 FC50&200');
Grafik BandPass Orde 20 dengan FC 50 dan 200