Sunteți pe pagina 1din 1

t=-1:.

01:1;
%(a) Graficar f(t)
ft=(2.*t+2).*((t>-1)&(t<=0))+(-2.*t+2).*((t>0)&(t<1));
plot(t,ft,'LineWidth',2) ,axis([-1 1 0 2.2])
xlabel('t'),ylabel('f(t)'), title('Mensaje f(t)')

%(b)Gráfica de la portadora xc(t)


figure(2)
xc=cos(20*pi.*t); plot(t,xc,'r','LineWidth',2)
axis([-1 1 -1.3 1.3])
xlabel('t') ,ylabel('xc(t)'), title('Portadora xc(t)')

%(c)Gráfica de portadora modulada f(t)xc(t)


figure(3)
Hcm=ft.*xc; plot(t,Hcm,'LineWidth',2), axis([-1 1 -2.3 2.3])
,xlabel('t'), ylabel('f(t)xc(t)')
title('Modulación de la portadora f(t)xc(t)')

%(d)Gráfica del espectro del mensaje


figure(4)
Fw=abs(fft(ft))/50; plot(t,Fw,'LineWidth',2) ,axis([-1.05 1.05 -.2 4.3])
,xlabel('w'), ylabel('F(w)')
title('Espectro del mensaje')

%(e)Gráfica del espectro de la portadora modulada


figure(5)
Hw=abs(fft(Hcm))/50; plot(t,Hw,'LineWidth',2), axis([-1.05 1.05 -0.2 2.2])
,xlabel('w') ,ylabel('F(w)Xc(w)')
title('Espectro de Portadora Modulada')

%Usando ammod
Y=ammod(ft,10,100);
figure(6)
plot(t,Y,'LineWidth',2)
axis([-1 1 -2.2 2.2]),
xlabel('t'),ylabel('f(t)xc(t)') ,title('Modulación de Portadora')

%Usando amdemod
figure(7)
y=amdemod(Y,10,100);
plot(t,y,'LineWidth',2)
axis([-1 1 0 2.2])
xlabel('t') ,ylabel('f(t)xc(t)')
title('Demodulación de la Portadora Modulada')

S-ar putea să vă placă și