Code mofulation d’amplitude

IV – Annexe
Le code du problème réalisé sous MATLAB
% Déclaration des variables
clear;
close all;
Fe=1000;
t=-2*pi:(1/Fe):2*pi;
% Fe = 1000 (pas)
f1=100;
% f1 >>fx1
f2=324;
% f2 >>fx2fx1=0.3;
fx2=0.2;
% Génération de signaux
hold off
x1=cos(2*pi*fx1*t);
x2=square(2*pi*fx2*t);
plot (t, x1, ‘r’);;
hold on
plot(t,x2, ‘g’);;
pause
hold off
% Modulation Amplitude
x1=x1+1;x2=x2+1;
% Rendre les signaux positifs
y1=x1.*cos(2*pi*f1*t);
y2=x2.*cos(2*pi*f2*t);
% On met la porteuse
plot(t,y1,’r’);;
hold on
plot(t,y2,’g’);;
pause
hold off
z= y1+y2;
plot (t, z,’w’);;pause
THAI Clémence
BOUR Etienne
% Transformée de Fourier
f=-(Fe/2):1:(Fe/2);
for k = 1:length(f)
Z(k)= sum(z.* exp(-2*j*pi*f(k)*t));
end
plot(f,abs(Z));
pause
% Passe bande
[B,A]=butter(8,[f1*2/Fe-0.02,f1*2/Fe+0.02]);
z1=filter(B,A,z);
z1=z1.*(z1>0);
% redressage
[B,A]= butter(8,[f2*2/Fe-0.02,f2*2/Fe+0.02]);
z2=filter(B,A,z);
z2=z2.*(z2>0);
% redressage
% Passe bas
[B,A]=butter(8,0.02);
zb1=filter(B,A,z1);
[B,A]= butter(8,0.02);
zb2=filter(B,A,z2);
% Transformée de Fourier des signaux filtrés
f=-(Fe/2):1:(Fe/2);
for k = 1:length(f)
Z1(k)= sum(z1.*exp(-2*j*pi*f(k)*t));
end
Hold off
plot(f,abs(Z1),’r’);;
% Pour vérifier si on a bien sélectionné la bande passante du signal 1
pause
hold on
THAI Clémence
BOUR Etienne
SY06 TP01
17
f=-(Fe/2):1:(Fe/2);for k = 1:length(f)
Z2(k)= sum(z2.* exp(-2*j*pi*f(k)*t));
end
plot(f,abs(Z2),’g’);;
% Pour vérifier si on a bien sélectionné la bande passante du signal 2
pause
hold off
plot(t,z1,’r’);;
hold onplot (t,z2,’g’);;
hold off
pause
% Transformée de Fourier des signaux filtrés en passe bas
f=-(Fe/2):1:(Fe/2);
for k = 1:length(f)
ZB1(k)= sum(zb1.* exp(-2*j*pi*f(k)*t));
end
Hold offplot(f,abs(ZB1),’r’);;
% Pour vérifier si on a bien sélectionné la bande passante du signal 1
pause
hold on
f=-(Fe/2):1:(Fe/2);
for k = 1:length(f)
ZB2(k)= sum(zb2.* exp(-2*j*pi*f(k)*t));
end…