Documente Academic
Documente Profesional
Documente Cultură
FOURIER SERIES
By:
Andik Kurniawan S (02311740000061)
Lecturer :
Dr. Dhany Arifianto, ST., M.Eng
Percobaan 4.1
Prosedur :
1. Double-click Matlab/scilab
2. Buka text editor matlab (icon persegi putih, sisi kiri) atau menggunakan
sembarang text editor, seperti notepad, wordpad dll.
3. Ketik command line dibawah ini
%Fenomenon Gibb
t=linspace(-2,2,2000);
u=linspace(-2,2,2000);
sq=[zeros(1,500),2*ones(1,1000),zeros(1,500)];
k=2;
N=[1,3,7,19,49,70];
for n=1:6;
an=[];
for m=1:N(n)
an=[an,2*k*sin(m*pi/2)/(m*pi)];
end;
fN=k/2;
for m=1:N(n)
fN=fN+an(m)*cos(m*pi*t/2);
end;
nq=int2str(N(n));
subplot(3,2,n),plot(u,sq,'r','LineWidth',2);hold on;
plot(t,fN,'LineWidth',2); hold off; axis([-2 2 -0.5
2.5]);grid;
xlabel('Time'), ylabel('y_N(t)');title(['N= ',nq]);
end;
%Fenomenon Gibb
t=linspace(-2,2,2000);
u=linspace(-2,2,2000);
sq=[zeros(1,500),2*ones(1,1000),zeros(1,500)];
k=2;
N=[4,8,16,32,64,128];
for n=1:6;
an=[];
for m=1:N(n)
an=[an,2*k*sin(m*pi/2)/(m*pi)];
end;
fN=k/2;
for m=1:N(n)
fN=fN+an(m)*cos(m*pi*t/2);
end;
nq=int2str(N(n));
subplot(3,2,n),plot(u,sq,'r','LineWidth',2);hold on;
plot(t,fN,'LineWidth',2); hold off; axis([-2 2 -0.5
2.5]);grid;
xlabel('Time'), ylabel('y_N(t)');title(['N= ',nq]);
end;
At the value of n = 128 the value of the ripple effect
due to the phenomenon of gibb which occurs more
minimalist and almost perfectly forms a step signal with
amplitude 2. Which the results of this graph show that
the greater the value of N, iteration, the effects of the
gibb phenomenon, the wave effect more minimalist.
%Fenomenon Gibb
t=linspace(-2,2,2000);
u=linspace(-1,1,2000);
sq=[zeros(1,500),2*ones(1,1000),zeros(1,500)];
k=2;
N=[4,8,16,32,64,128];
for n=1:6;
an=[];
for m=1:N(n)
an=[an,2*k*sin(m*pi/2)/(m*pi)];
end;
fN=k/2;
for m=1:N(n)
fN=fN+an(m)*cos(m*pi*t/2);
end;
nq=int2str(N(n));
subplot(3,2,n),plot(u,sq,'r','LineWidth',2);hold on;
plot(t,fN,'LineWidth',2); hold off; axis([-2 2 -0.5
2.5]);grid;
xlabel('Time'), ylabel('y_N(t)');title(['N= ',nq]);
end;
%Fenomenon Gibb
t=linspace(-2,2,2000);
u=linspace(-5,5,2000);
sq=[zeros(1,500),2*ones(1,1000),zeros(1,500)];
k=2;
N=[4,8,16,32,64,128];
for n=1:6;
an=[];
for m=1:N(n)
an=[an,2*k*sin(m*pi/2)/(m*pi)];
end;
fN=k/2;
for m=1:N(n)
fN=fN+an(m)*cos(m*pi*t/2);
end;
nq=int2str(N(n));
subplot(3,2,n),plot(u,sq,'r','LineWidth',2);hold on;
plot(t,fN,'LineWidth',2); hold off; axis([-2 2 -0.5
2.5]);grid;
xlabel('Time'), ylabel('y_N(t)');title(['N= ',nq]);
end;
When the amplitude of the step signal does not change,
only the range of the step signal changes, so the
resulting sinusoidal signal also does not change, the
fourier series that occurs in the step signal with the
same amplitude, but different spans are the same. So,
With a greater N value, the gibb phenomenon that produces
wave is more minimalist.
Percobaan 4.2
Prosedur :
1. Double-click Matlab/scilab
2. Buka text editor matlab (icon persegi putih, sisi kiri) atau menggunakan
sembarang text editor, seperti notepad, wordpad dll.
3. Ketik command line dibawah ini
% *** Plot truncatated FS for various numbers of terms. ***
clear; % clear matlab's memory
figure(1); clf; % open and clear figure 1
To = 2; wo = 2*pi/To; % fundamental period and frequency
D0 = 0.5; % signal offset
t = -2:0.01:4; % time over which we'll plot signal
N = [1 5 10 50]; % +/- values at which we'll truncate FS
for i = 1:4, % compute truncated FS for above N values
f = D0*ones(size(t)); % start out with DC bias term
for n = -N(i):-1, % loop over negative n
Dn = (1 - exp(-j*n*pi))/(j*2*pi*n); % Fourier coefficient
f = f + real(Dn*exp(j*n*wo*t)); % add FS terms
end;
6. Ubah parameter n lebih besar dan lebih kecil. Apa yang anda peroleh ?
end;
end;
end;
end;
end;