Está en la página 1de 4

Segundo taller de señales y sistemas

Integrantes de grupo:

Jhon Sebastián Vargas

Fabián Vidal

Graficas del segundo taller

1) Código en MatLab:
N=900; %Numero de armónicos
ao=15/4;
fT=ao;
t=-5:0.01:10;
for n=1:N
an=[-5/(n.*pi)].*[(-1)^((n-1)./2)];
bn=[(5/(n.*pi)).*[(-1).^(n./2)-2.*[(-1).^n]+1]];
f=[(an.*cos(n.*pi/2.*t))+(bn.*sin((n.*pi/2.*t)))];
fT=fT+f;
end
subplot(2,2,1);
plot(t,fT);
xlabel('time(s)')
ylabel('f')
title('Serie de fourier')
hold on

n=[1:8];
T=4;
Wl=(2*pi)/T;
W=(n.*Wl);

an=((-5./(n.*pi)).*((-1).^((n-1)./2)));
bn=((5./(n.*pi)).*((-1).^(n./2)-2.*((-1).^n)+1));
An=sqrt(an.^2+bn.^2);
On=-atan(bn./an);
subplot(2,2,3);
stem(ao);
hold on
title('Valor promedio');
xlabel('t')
ylabel('An')

subplot(2,2,4);
stem(W,On);
hold on
title('Espectro de fase');
xlabel('FrecuenciaW')
ylabel('On')

subplot(2,2,2);
stem(W,An);
hold on
title('Espectro De Magnitud');
xlabel('FrecuenciaW')
ylabel('An')

Gráfica:
2) Código en MatLab:
N=900; %Numero de armonicos
ao=1;
fT=ao;
t=-5:0.01:5;
for n=1:N
an=[((2.*n.*pi.*((-1)^((n-1)/2)))+(4.*(-1)^(n/2))-4)/(((n*pi)/2)^2)];
bn=0;
f=[(an.*cos(n.*pi/2.*t))];
fT=fT+f;
end
subplot(2,2,1);
plot(t,fT);
xlabel('time(s)')
ylabel('f')
title('Serie de fourier')
hold on

n=[1:8];
T=4;
Wl=(2*pi)/T;
W=(n.*Wl);

an=(((2.*n.*pi.*((-1).^((n-1)./2)))+(4.*(-1).^(n/2))-4)./(((n*pi)./2).^2));
bn=0;
An=sqrt(an.^2+bn.^2);
On=-atan(bn./an);
subplot(2,2,3);
stem(ao);
hold on
title('Valor promedio');
xlabel('t')
ylabel('An')

subplot(2,2,4);
stem(W,On);
hold on
title('Espectro de fase');
xlabel('FrecuenciaW')
ylabel('On')

subplot(2,2,2);
stem(W,An);
hold on
title('Espectro De Magnitud');
xlabel('FrecuenciaW')
ylabel('An')
http://cccasanare.co/wp-content/uploads/2017/02/Efectos-de-la-situaci%C3%B3n-petrolera-en-
Casanare-2015.pdfGráfica:

También podría gustarte