Skip to content
Snippets Groups Projects
Commit 401aa06f authored by SLAOUI Idriss's avatar SLAOUI Idriss
Browse files

Question_bonus

parent e63883b4
No related branches found
No related tags found
No related merge requests found
No preview for this file type
function y = karplus_mod(x, N, g, alpha)
% Filtrage récursif avec retard et pondération
b = zeros(1, N + 1);
b(N + 1) = 1;
a = zeros(1, N + 2);
a(1) = 1;
a(N + 1) = -g * alpha;
a(N + 2) = -g * (1 - alpha);
y = filter(b, a, x);
end
% Paramètres de base
Fe = 44100;
f = 440;
N = round(Fe / f);
g = 0.99;
alpha = 0.5;
duree = 2;
L = Fe * duree;
% Signal aléatoire court
x = 2 * rand(1, L) - 1;
% Application du traitement
y = karplus_mod(x, N, g, alpha);
% Lecture et tracé
sound(y, Fe);
plot(y);
title('Réponse d’un système récursif');
xlabel('Échantillons');
ylabel('Amplitude');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment