You are on page 1of 6

FUNCION DE LA RECTA

%FUNDAMENTAL
clear all, clf, clc
t=0:1/100:1;
f0=1/2;
cnte=j/(2*pi);
c1=exp(j*2*pi*t);
c1c=exp(-j*2*pi*t);
c1s=cnte*(c1-c1c);
c1r=real(c1s);
c1t=f0+c1r;
subplot(4,3,1);
plot(t,c1t)
title('FUNDAMENTAL');
axis([0 1 -0.2 1])
grid
%ARMONICO 2:
c2=exp(j*2*pi*t*2);
c2c=exp(-j*2*pi*t*2);
c2s=cnte*(c2-c2c)/2;
c2r=real(c2s);
subplot(4,3,2)
plot(t,c2r)
title('2do ARMONICO')
axis([0 1 -0.2 1])
grid
%SUMATORIA 1:
c3=exp(j*2*pi*t*2);
c3c=exp(-j*2*pi*t*2);
c2s=cnte*(c2-c2c)/2;
c3r=real(c2s);
c3t=c1t+c2r;
subplot(4,3,3)
plot(t,c3t)
title('+2 ARMONICOS')
axis([0 1 -0.2 1])
grid
%ARMONICO 3:
c4=exp(j*2*pi*t*3);
c4c=exp(-j*2*pi*t*3);
c4s=cnte*(c4-c4c)/3;
c4r=real(c4s);
subplot(4,3,5)
plot(t,c4r)
title('3er ARMONICO')
axis([0 1 -0.2 1])
grid
%SUMATORIA 2:
c5=exp(j*2*pi*t*3);
c5c=exp(-j*2*pi*t*3);
c5s=cnte*(c5-c5c)/3;
c5r=real(c5s);

PRACTICA 4

Pgina 1

c5t=c3t+c4r;
subplot(4,3,6)
plot(t,c5t)
title('+3 ARMONICOS')
axis([0 1 -0.2 1])
grid
%ARMONICO 4:
c6=exp(j*2*pi*t*4);
c6c=exp(-j*2*pi*t*4);
c6s=cnte*(c6-c6c)/4;
c6r=real(c6s);
subplot(4,3,8)
plot(t,c6r)
title('4to ARMONICO')
axis([0 1 -0.2 1])
grid
%SUMATORIA 3:
c7=exp(j*2*pi*t*4);
c7c=exp(-j*2*pi*t*4);
c7s=cnte*(c7-c7c)/4;
c7r=real(c7s);
c7t=c5t+c6r;
subplot(4,3,9)
plot(t,c7t)
title('+4 ARMONICOS')
axis([0 1 -0.2 1])
grid
%ARMONICO 5:
c8=exp(j*2*pi*t*5);
c8c=exp(-j*2*pi*t*5);
c8s=cnte*(c8-c8c)/5;
c8r=real(c8s);
subplot(4,3,11)
plot(t,c8r)
title('5to ARMONICO')
axis([0 1 -0.2 1])
grid
%SUMATORIA 4:
c9=exp(j*2*pi*t*5);
c9c=exp(-j*2*pi*t*5);
c9s=cnte*(c9-c9c)/5;
c9r=real(c9s);
c9t=c7t+c8r;
subplot(4,3,12)
plot(t,c9t)
title('+5 ARMONICOS')
axis([0 1 -0.2 1])
grid
%RECTA
y=t;
subplot(4,3,10)

PRACTICA 4

Pgina 2

plot(t,y)
title('FUNCION ORIGINAL')
ylabel('f(t)')
axis([0 1 -0.2 1])
grid

PRACTICA 4

Pgina 3

SENO RECTIFICADO
%FUNDAMENTAL
clear all, clf, clc
t=0:1/100:2;
f0=2/pi; %2A/pi A=1
cnte=2/pi;
c1=exp(j*2*pi*t);
c1c=exp(-j*2*pi*t);
c1s=cnte*(c1+c1c)/-3;
c1r=real(c1s);
c1t=f0+c1r;
subplot(4,3,1);
plot(t,c1t)
title('FUNDAMENTAL');
axis([0 2 0 1.2])
grid
%ARMONICO 2:
c2=exp(j*2*pi*t*2);
c2c=exp(-j*2*pi*t*2);
c2s=cnte*(c2+c2c)/-15;
c2r=real(c2s);
subplot(4,3,2)
plot(t,c2r)
title('2do ARMONICO')
axis([0 2 -0.2 1])
grid
%SUMATORIA 1:
c3=exp(j*2*pi*t*2);
c3c=exp(-j*2*pi*t*2);
c2s=cnte*(c2+c2c)/-15;
c3r=real(c2s);
c3t=c1t+c2r;
subplot(4,3,3)
plot(t,c3t)
title('+2 ARMONICOS')
axis([0 2 0 1.2])
grid
%ARMONICO 3:
c4=exp(j*2*pi*t*3);
c4c=exp(-j*2*pi*t*3);
c4s=cnte*(c4+c4c)/-35;
c4r=real(c4s);
subplot(4,3,5)
plot(t,c4r)
title('3er ARMONICO')
axis([0 2 -0.2 1])
grid
%SUMATORIA 2:
c5=exp(j*2*pi*t*3);
c5c=exp(-j*2*pi*t*3);
c5s=cnte*(c5+c5c)/-35;

PRACTICA 4

Pgina 4

c5r=real(c5s);
c5t=c3t+c4r;
subplot(4,3,6)
plot(t,c5t)
title('+3 ARMONICOS')
axis([0 2 0 1.2])
grid
%ARMONICO 4:
c6=exp(j*2*pi*t*4);
c6c=exp(-j*2*pi*t*4);
c6s=cnte*(c6+c6c)/-63;
c6r=real(c6s);
subplot(4,3,8)
plot(t,c6r)
title('4to ARMONICO')
axis([0 2 -0.2 1])
grid
%SUMATORIA 3:
c7=exp(j*2*pi*t*4);
c7c=exp(-j*2*pi*t*4);
c7s=cnte*(c7+c7c)/-63;
c7r=real(c7s);
c7t=c5t+c6r;
subplot(4,3,9)
plot(t,c7t)
title('+4 ARMONICOS')
axis([0 2 0 1.2])
grid
%ARMONICO 5:
c8=exp(j*2*pi*t*5);
c8c=exp(-j*2*pi*t*5);
c8s=cnte*(c8+c8c)/-99;
c8r=real(c8s);
subplot(4,3,11)
plot(t,c8r)
title('5to ARMONICO')
axis([0 2 -0.2 1])
grid
%SUMATORIA 4:
c9=exp(j*2*pi*t*5);
c9c=exp(-j*2*pi*t*5);
c9s=cnte*(c9+c9c)/-99;
c9r=real(c9s);
c9t=c7t+c8r;
subplot(4,3,12)
plot(t,c9t)
title('+5 ARMONICOS')
axis([0 2 0 1.2])
grid

PRACTICA 4

Pgina 5

%SENO RECTIFICADO
y=abs(sin(pi*t));
subplot(4,3,10)
plot(t,y)
title('FUNCION ORIGINAL')
ylabel('f(t)')
axis([0 2 0 1.2])
grid

FUNDAMENTAL
1

+2 ARMONICOS
1

0.5

0.5
0

2do ARMONICO

0.5

0
0

0.5

1.5

0.5

1.5

0.5

1.5

f(t)

PRACTICA 4

0.5

1.5

0.5

5to ARMONICO

1.5

1.5

1.5

+5 ARMONICOS
1

0.5

0.5

0
2

0.5

0.5
0

1.5

+4 ARMONICOS

0.5

0.5

4to ARMONICO

1.5

0.5
0

0.5

0.5

+3 ARMONICOS

0.5

3er ARMONICO

FUNCION ORIGINAL

0.5

Pgina 6

1.5

0.5

You might also like