Professional Documents
Culture Documents
Mod=Sig.*Por;
figure(2);
subplot(2,2,1)
plot(t1,Mod);
axis([0.02,0.05,-35,35])
xlabel('Tiempo (s)');
ylabel('Amplitud de la Señal')
title('Señal Modulada');
grid on;
esp3=fft(Mod);
subplot(2,2,2)
plot(abs(esp3))
ylabel('Amplitud de la Señal')
title('Espectro de la Señal Modulada');
xlabel('Frecuencia [Hz]');
axis([750,1250,0,10000]);
grid on;
A1 = 1;
fs=200;
w = 2*pi*fs;
%t2 = 0:1/63535:(0.25-1/65535);
t2=t1;
sq = A1*square(w*t1);
subplot(2,2,3);
plot(t2,sq);
xlabel('Tiempo (s)');
ylabel('Amplitud de la Señal Muestreadora')
title('Señal Muestreadora');
axis([0,0.05,-2,2]);
grid on;
esp4=fft(sq);
subplot(2,2,4);
plot(abs(esp4));
ylabel('Amplitud del Espectro')
title('Espectro de la Señal Muestreadora');
xlabel('Frecuencia [Hz]');
axis([0,2500,0,10000]);
grid on;
x=-20:0.1:20;
y1=sinc(x);
y2=(sin(pi.*x))./(pi.*x);
subplot(2,1,1);
plot(x,y1);
subplot(2,1,2);
plot(x,y2);
Recuperación de la señal analógica previamente muestreada
% demointerpol
clear all
close all
f1=15;
f2=25;
f3=45;
fs=1.4*2*f3;
Ts=1/fs;
t=0:Ts:20*Ts;
ts=0.1*Ts;
t1=0:ts:20*Ts;
xs=0.35*cos(2*pi*f1*t)+0.2*sin(2*pi*f2*t)-0.4*cos(2*pi*f3*t);
x=0.35*cos(2*pi*f1*t1)+0.2*sin(2*pi*f2*t1)-0.4*cos(2*pi*f3*t1);
for m=1:2
figure(1)
subplot(2,1,1)
plot(t1,x,'k',t,xs,'db')
axis([0 20*Ts -1 1])
xlabel('$t$', 'Interpreter','Latex');
legend({'$x(t)$','$\sum_n x[nT_S]\delta(t-
nT_S)$'},'Interpreter','Latex');
grid on
for i=0:20
sf(i+1,:)=sinc(fs*(t1-i*Ts));
subplot(2,1,2)
plot(t1,sf(1:i+1,:));
title({'$\{ \mathrm{sinc}\left[f_s(t-nT_S)\right]
\}$'},'Interpreter','Latex');
xlabel('$t$', 'Interpreter','Latex');
text(0.1,1,['n=' num2str(i)]);
axis([0 20*Ts -1 1.2])
pause(0.1)
end
for i=0:20
sf(i+1,:)=xs(i+1)*sinc(fs*(t1-i*Ts));
subplot(2,1,2)
plot(t1,sf(1:i+1,:),t(1:i+1),xs(1:i+1),'db');
title({'$\{ x[n]\mathrm{sinc}\left[f_s(t-nT_S)\right]
\}$'},'Interpreter','Latex');
xlabel('$t$', 'Interpreter','Latex');
text(0.1,1,['n=' num2str(i)]);
axis([0 20*Ts -1 1.2])
pause(0.5)
end
for i=0:20
sf(i+1,:)=xs(i+1)*sinc(fs*(t1-i*Ts));
subplot(2,1,2)
plot(t1,sf(1:i+1,:),t1,sum(sf(1:i+1,:),1),'k');
title({'$x(t)=\sum_n x[n]\mathrm{sinc}\left[f_s(t-
nT_S)\right]$'},'Interpreter','Latex');
xlabel('$t$', 'Interpreter','Latex');
text(0.1,1,['n=' num2str(i)]);
axis([0 20*Ts -1 1.2])
pause(0.25)
end
plot(t1,sum(sf,1),'k');
axis([0 20*Ts -1 1.2])
title({'$\sum_n x[n]\mathrm{sinc}\left[f_s(t-
nT_S)\right]=x(t)$'},'Interpreter','Latex');
xlabel('$t$', 'Interpreter','Latex');
grid on
pause(1)
end
% xi=sum(sf,1);
% plot(t1,sf)
% hold on
% plot(t1,xi,'k','LineWidth',1)
% axis([0 20*Ts -1 1])
% xlabel('$t$', 'Interpreter','Latex');
% title('$\sum_n x[n]\mathrm{sinc}[f_S(t-nT_S)]$', 'Interpreter',
'Latex')
% grid on