Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tp-audio-ee-etudiant-c24leray
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-c24leray
tp-audio-ee-etudiant-c24leray
Commits
beebc534
Commit
beebc534
authored
1 month ago
by
LERAYS Camille
Browse files
Options
Downloads
Patches
Plain Diff
coucou
parent
69d39fbd
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
question_12.m
+1
-1
1 addition, 1 deletion
question_12.m
question_14.m
+3
-3
3 additions, 3 deletions
question_14.m
question_21.m
+26
-3
26 additions, 3 deletions
question_21.m
with
30 additions
and
7 deletions
question_12.m
+
1
−
1
View file @
beebc534
...
...
@@ -17,7 +17,7 @@ f2 = (-L2/2 : L2/2 - 1)*(fe2/L2);
figure
;
plot
(
f1
,
log
(
abs
(
X1
)),
'r'
);
hold
on
;
hold
on
plot
(
f2
,
log
(
abs
(
X2
)),
'b'
);
title
(
"spectre"
);
xlabel
(
"fréquence en Hz"
);
...
...
This diff is collapsed.
Click to expand it.
question_14.m
+
3
−
3
View file @
beebc534
...
...
@@ -12,7 +12,7 @@ fs = 44100; % Sampling frequency (Hz)
totalTime
=
A
+
D
+
R
;
% totalTime = totalTime * 6; % Extend the envelope for 6 seconds
t
=
linspace
(
0
,
totalTime
,
totalTime
*
fs
);
t
=
linspace
(
0
,
totalTime
,
totalTime
*
6
);
% Generate ADSR envelope
attack
=
linspace
(
0
,
1
,
A
*
fs
);
...
...
@@ -30,6 +30,6 @@ title('ADSR Envelope');
[
x
,
fe
]
=
audioread
(
"C:\Users\camil\Documents\IMT_A\semestre_6\electrical engineering\tp-audio-ee-etudiant-c24leray\src\wav\single_tone_piano2.wav"
);
% Apply the ADSR envelope to the audio signal
audiowrite
(
"C:\Users\camil\Documents\IMT_A\semestre_6\electrical engineering\tp-audio-ee-etudiant-c24leray\src\wav\single_tone_piano2.wav"
,
adsrSignal
,
fe
);
adsrSignal
=
x
(
1
:
length
(
adsrEnvelope
))
.*
adsrEnvelope
'
;
sound
(
adsrSignal
,
fe
);
audiowrite
(
"C:\Users\camil\Documents\IMT_A\semestre_6\electrical engineering\tp-audio-ee-etudiant-c24leray\src\wav\single_tone_piano2.wav"
,
adsrSignal
,
fe
);
\ No newline at end of file
soundsc
(
adsrSignal
,
fs
);
\ No newline at end of file
This diff is collapsed.
Click to expand it.
question_21.m
+
26
−
3
View file @
beebc534
...
...
@@ -19,8 +19,6 @@ title('spectre du signal carré');
x_2
=
sawtooth
(
2
*
pi
*
t
/
T
);
plot
(
t
,
x_2
)
title
(
'sawtooth'
)
%fft
X_2
=
10
*
log10
(
abs
(
fftshift
(
fft
(
x_2
))));
...
...
@@ -71,4 +69,29 @@ xlim([-5000 5000]);
%question 2.3
sound
(
y
,
fe
)
soundsc
(
x_1
,
fe
)
% Define ADSR parameters
A
=
0.1
;
% Attack time (seconds)
D
=
0.005
;
% Decay time (seconds)
S
=
0.8
;
% Sustain level (0 to 1)
R
=
0.75
;
% Release time (seconds)
% Total duration of the envelope
totalTime
=
A
+
D
+
R
;
% totalTime = totalTime * 6; % Extend the envelope for 6 seconds
t
=
linspace
(
0
,
totalTime
,
totalTime
*
6
);
% Generate ADSR envelope
attack
=
linspace
(
0
,
1
,
A
*
fe
);
decay
=
linspace
(
1
,
S
,
D
*
fe
);
release
=
linspace
(
S
,
0
,
R
*
fe
);
% Combine all segments
adsrEnvelope
=
[
attack
,
decay
,
release
];
adsrSignal
=
x_1
(
1
:
length
(
adsrEnvelope
))
.*
adsrEnvelope
'
;
soundsc
(
adsrSignal
,
fe
);
\ No newline at end of file
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