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
| clc,clear,close all;
fs=200e3;
dt=1/fs;
df=100;
t=0:dt:40e-3;
f=0:df:20e3;
%%%%%
figure;
subplot(211);
n= length(t);
y = randn(1,n);
plot(t*1000,y);
xlim([0 6]);
%spectre
Y=spectre(f,y,t);
subplot(212)
plot(f/1000,abs(Y));
%passe bas
%filtre passe pas
m=5; fc=2e3/(fs/2);
[b,a] = butter(m,fc/(fs/2));
p = filter(b,a,y);
figure;
subplot(211);
plot(t*1000,p);
xlim([0 6]);
%fonction de transfert
P=spectre(f,p,t);
subplot(212);
plot(f/1000,abs(Y),'linewidth',2);
title('fonction de transfert','fontsize',18);
%elimination de la cc %
a0=mean(y);
z=y-a0;
figure;
subplot(211);
plot(t*1000,z);
xlim([0 6])
%spectre
Z=spectre(f,z,t);
subplot(212);
plot(f/1000,abs(Y),'linewidth',2); |
Partager