1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
| clear all;
close all;
clc;
...
%---------------Paramètres--------------
fs=200e3; %Fréquence d'echantillonage en KHz
dt=1/fs; %Pas d'echantillonage
t=0:dt:40e-3; %Temps d'observation
df=100; %Pas fréquentiel
f=0:df:20e3;
%---------------Modulateur--------------
fp=10e3;
f1=500;
kf=5e3;
%------------Signal au point A----------
m=sin(2*pi*f1*t);
figure;
subplot(211);
plot(t*1000,m)
xlim([0 6])
grid on
title('Signal informatif')
xlabel('Temps en ms')
%------------Spectre du signal au point A------
sp_m=TFSC(f,m,t);
subplot(212);
plot(f/1000,abs(sp_m))
grid on
title('Son spectre')
xlabel('Fréquence en KHz')
%------------Signal modulé FM----------
FM=sin(2*pi*fp*t+kf*2*pi*cumsum(m)*dt);%/f1*cos(2*pi*f1*t)
figure;
subplot(211);
plot(t*1000,FM)
xlim([0 6])
grid on
title('Signal modulé FM')
xlabel('Temps en ms')
%------------Spectre du signal modulé------
sp_FM=TFSC(f,FM,t);
subplot(212);
plot(f/1000,abs(sp_FM))
grid on
title('Son spectre')
xlabel('Fréquence en KHz')
%------------Filtrage---------------
fc=11e3;
N=4;
[B A]=BUTTER(N,fc/fs*2);
mf=filtfilt(B,A,FM);
figure;
subplot(211);
plot(t*1000,mf)
xlim([0 6])
grid on
title('Signal filtré')
xlabel('Temps en ms')
%------------Spectre du signal filtré------
sp_mf=TFSC(f,mf,t);
subplot(212);
plot(f/1000,abs(sp_mf))
grid on
title('Son spectre')
xlabel('Fréquence en KHz') |
Partager