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
| clear
fe=200;
t=(1:fe)/fe;
%Signaux source bruités
x1 = sin(2*pi*t*60)+0.5*randn(size(t));
x2 = sin(2*pi*t*25)+0.5*randn(size(t));
x3 = sin(2*pi*t*10)+0.5*randn(size(t));
% signal somme
stot = x1+x2+x3;
Nx = length(stot);
subplot(3,1,1)
plot(stot);
title('somme de 3 sinusoïdes (10, 25 et 60 Hz)');
xlabel('Temps')
grid
% fft du signal somme
subplot(3,1,2)
tf=fft(stot,Nx);
w=(0:Nx-1)/Nx*fe;
plot(w(1:Nx/2),abs(tf(1:Nx/2)));
grid
xlabel('fréquences en Hz')
title('module de la fft de la somme x1+x2+x3')
% ifft du signal somme
subplot(3,1,3)
tf=ifft(tf,Nx);
plot(real(tf));
grid
xlabel('Temps')
title('signal origine par transformée inverse') |
Partager