Skip to content
Snippets Groups Projects
Commit e0198c81 authored by YE Victor's avatar YE Victor
Browse files

Upload New File

parent 9090991a
No related branches found
No related tags found
No related merge requests found
function filtre_moyenneur_spectre()
% Paramètres
Fe = 1000;
Te = 1/Fe;
T = 1;
t = 0:Te:5*T-Te;
N = length(t);
% Signal d'entrée : signal dent de scie
x = sawtooth(2*pi*t/T);
% Filtrage : y(k) = 0.5 * (x(k) + x(k-1))
y = filter([0.5 0.5], 1, x);
% Spectres
X = fftshift(fft(x));
Y = fftshift(fft(y));
f = (-N/2:N/2-1)*(Fe/N);
% Amplitude en dB
X_dB = 20*log10(abs(X)/N + eps);
Y_dB = 20*log10(abs(Y)/N + eps);
% Affichage
figure;
plot(f, Y_dB);
legend('Sortie y(k)');
title('Spectre après filtrage');
xlabel('Fréquence (Hz)');
ylabel('Amplitude (dB)');
grid on;
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment