Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tp-audio-ee-etudiant-a24perbe
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
UEEE
sar-signal-audio
gr-vhdl-a24perbe
tp-audio-ee-etudiant-a24perbe
Commits
fb1ff64c
Commit
fb1ff64c
authored
2 weeks ago
by
PERBEN Anatole
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
ffc17c20
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/wav/question_3_17.m
+54
-0
54 additions, 0 deletions
src/wav/question_3_17.m
with
54 additions
and
0 deletions
src/wav/question_3_17.m
0 → 100644
+
54
−
0
View file @
fb1ff64c
function
y
=
effet_delay_filtre
(
x
,
delay_time
,
g
,
K
,
Fe
)
% effet_delay_filtre - effet de delay avec filtre de moyenne glissante dans la boucle
%
% Entrées :
% x : signal d'entrée
% delay_time : durée du delay (en secondes)
% g : coefficient d'amortissement
% K : longueur de la moyenne glissante
% Fe : fréquence d'échantillonnage (en Hz)
%
% Sortie :
% y : signal de sortie après application du filtre
N
=
length
(
x
);
% Longueur du signal
tau
=
round
(
delay_time
*
Fe
);
% Retard en échantillons
y
=
zeros
(
size
(
x
));
% Initialisation du signal de sortie
for
k
=
1
:
N
% Indices pour le filtre glissant
sum_term
=
0
;
for
n
=
0
:
K
-
1
idx
=
k
-
tau
-
n
;
if
idx
>
0
sum_term
=
sum_term
+
y
(
idx
);
end
end
y
(
k
)
=
x
(
k
)
-
(
g
/
K
)
*
sum_term
;
end
end
% Charger le signal (par exemple un piano)
[
x
,
Fe
]
=
audioread
(
'single_tone_guitar_nylon_string_a3.wav'
);
% Remplace 'piano.wav' par le bon fichier si besoin
x
=
x
(:,
1
);
% Si le son est stéréo → mono
% Paramètres du delay
tau_sec
=
0.001
;
% Delay en secondes
g
=
0.9
;
% Coefficient d'amortissement
K
=
10
;
% Longueur de la moyenne glissante
% Application du filtre avec delay et moyenne glissante
y
=
effet_delay_filtre
(
x
,
tau_sec
,
g
,
K
,
Fe
);
% Écoute du résultat
soundsc
(
y
,
Fe
);
% Sauvegarde du fichier audio
audiowrite
(
'piano_delay_filtre.wav'
,
y
,
Fe
);
% Affichage temporel (optionnel)
t
=
(
0
:
length
(
y
)
-
1
)/
Fe
;
plot
(
t
,
y
);
xlabel
(
'Temps (s)'
);
ylabel
(
'Amplitude'
);
title
(
'Signal après effet delay avec filtre moyenne glissante'
);
grid
on
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment