Skip to content
Snippets Groups Projects
Commit 794607c0 authored by LERAYS Camille's avatar LERAYS Camille
Browse files

ouah

parent 5df6984b
Branches
No related tags found
No related merge requests found
No preview for this file type
[x, f] = audioread("C:\Users\camil\Documents\IMT_A\semestre_6\electrical engineering\tp-audio-ee-etudiant-c24leray\src\wav\single_tone_piano1.wav");; % Signal aléatoire
fs = f; % Fréquence d'échantillonnage (Hz)
tau = 0.1; % Retard de 100 ms
g = 0.9; % Coefficient d'amortissement
t = 0:1/fs:1; % 1 seconde de signal
function y = effet_delay(x, tau, g, fs)
% EFFET_DELAY Applique un filtre à retard avec amortissement
% Calcul du retard en nombre d'échantillons
D = round(tau * fs);
% Vecteurs des coefficients du filtre IIR
% H(z) = 1 / (1 + g * z^(-D))
b = 1; % Numérateur (feedforward)
a = [1, zeros(1, D-1), g]; % Dénérateur (feedback)
% Filtrage du signal
y = filter(b, a, x);
end
y = effet_delay(x, tau, g, fs);
% Affichage
plot(t, x); hold on;
plot(t, y);
legend('Signal original', 'Signal filtré');
xlabel('Temps (s)');
ylabel('Amplitude');
title('Effet de Delay avec amortissement');
\ No newline at end of file
fs = 44100; % Fréquence d'échantillonnage (Hz)
tau = 0.25*fs; % Retard de 100 ms
g = 0.9; % Coefficient d'amortissement
t = 0:1/fs:1; % 1 seconde de signal
[x, f] = audioread("C:\Users\camil\Documents\IMT_A\semestre_6\electrical engineering\tp-audio-ee-etudiant-c24leray\src\wav\single_tone_piano1.wav");; % Signal aléatoire
fs = f; % Fréquence d'échantillonnage (Hz)
tau = 0.25; % Retard (s)
g = 0.9; % Coefficient d'amortissement
t = (0:length(x)-1)/fs;
function y = effet_delay(x, tau, g, fs)
% EFFET_DELAY Applique un filtre à retard avec amortissement
......@@ -18,12 +19,15 @@ function y = effet_delay(x, tau, g, fs)
% Filtrage du signal
y = filter(b, a, x);
end
y = effet_delay(x, tau, g, fs);
disp(size(y))
disp(size(t))
% Affichage
plot(t, x); hold on;
figure;
plot(t, y);
legend('Signal original', 'Signal filtré');
xlabel('Temps (s)');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment