Está en la página 1de 1

clc

% dominio del tiempo


t=[-pi:pi/100:pi];
% funcin
m=t.^2+t;
% funcin serie de Furier (4 armonicos)
F=(1/3)*(pi^2)+4*(-cos(t)+(cos(2*t)/4)-(cos(3*t)/9)+(cos(4*t)/16))+2*(sin(t)-(si
n(2*t)/2)+(sin(3*t)/3)-(sin(4*t)/4));
G=(1/3)*(pi^2)+4*(-cos(t)+(cos(2*t)/4)-(cos(3*t)/9)+(cos(4*t)/16)-(cos(5*t)/25)+
(cos(6*t)/36))+2*(sin(t)-(sin(2*t)/2)+(sin(3*t)/3)-(sin(4*t)/4)+(sin(5*t)/5)-(si
n(6*t)/6));
H=(1/3)*(pi^2)+4*(-cos(t)+(cos(2*t)/4)-(cos(3*t)/9)+(cos(4*t)/16)-(cos(5*t)/25)+
(cos(6*t)/36)-(cos(7*t)/49)+(cos(8*t)/64))+2*(sin(t)-(sin(2*t)/2)+(sin(3*t)/3)-(
sin(4*t)/4)+(sin(5*t)/5)-(sin(6*t)/6)+(sin(7*t)/7)-(sin(8*t)/8));
I=(1/3)*(pi^2)+4*(-cos(t)+(cos(2*t)/4)-(cos(3*t)/9)+(cos(4*t)/16)-(cos(5*t)/25)+
(cos(6*t)/36)-(cos(7*t)/49)+(cos(8*t)/64)-(cos(9*t)/81)+(cos(10*t)/100)-(cos(11*
t)/121)+(cos(12*t)/144))+2*(sin(t)-(sin(2*t)/2)+(sin(3*t)/3)-(sin(4*t)/4)+(sin(5
*t)/5)-(sin(6*t)/6)+(sin(7*t)/7)-(sin(8*t)/8)+(sin(9*t)/9)-(sin(10*t)/10)+(sin(1
1*t)/11)-(sin(12*t)/12));
% grfica de la funcin
figure(1);
clf;
plot(t,m,'r', ...
t,F,'g', ...
t,G,'b', ...
t,H,'c', ...
t,I,'Y');
% ajuste del rango de ejes
axis([-3.5 3.5 -2 15]);
% etiquetas
title('Grfica de las seales');
xlabel ('tiempo');
% leyenda
legend('m(t)','F(t)','G(t)','H(t)','I(t)');
% activacin de rejilla
grid on;

También podría gustarte