Download UFRN - Natal
Transcript
MatLab - Allan de Medeiros [Eng. Elétrica]
62
end
end
w=0;
s=0;
count=0;
for t=t1:dt:t2
count=count+1;
ft=a0;
for n=1:1:termos
w=n.*2.*pi./periodo;
a=an(n);
b=bn(n);
f(count)=ft+a.*cos(w.*t)+b.*sin(w.*t);
ft=f(count);
end
end
t=t1:dt:t2;
plot(t,f);
grid on;
title('Série de Forier da entrada');
Listagem do arquivo TFOURIER.M
count=0;
for t=t1:dt:t2
count=count+1;
s=0;
ft=a0*eval(H);
for n=1:1:termos
w=n.*2.*pi./periodo;
s=sqrt(-1).*w;
Hr=real(eval(H));
Hi=imag(eval(H));
a=an(n).*Hr+bn(n).*Hi;
b=-an(n).*Hi+bn(n).*Hr;
f(count)=ft+a.*cos(w.*t)+b.*sin(w.*t);
ft=f(count);
end
end
t=t1:dt:t2;
plot(t,f);
grid on;
title(['Saída com a função de tranferência ' H]);
UFRN - Natal