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
73fe99b7
You need to sign in or sign up before continuing.
Commit
73fe99b7
authored
2 weeks ago
by
PERBEN Anatole
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
6b5015ba
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_2_1.m
+50
-0
50 additions, 0 deletions
src/wav/question_2_1.m
with
50 additions
and
0 deletions
src/wav/question_2_1.m
0 → 100644
+
50
−
0
View file @
73fe99b7
% Paramètres
A
=
1
;
% Amplitude
T
=
1
;
% Période
N
=
1000
;
% Nombre d'échantillons
Fs
=
N
/
T
;
% Fréquence d'échantillonnage
t
=
linspace
(
0
,
T
,
N
);
% Temps sur une période
f
=
(
-
N
/
2
:
N
/
2
-
1
)
*
Fs
/
N
;
% Axe des fréquences
% ----- Signal carré centré -----
square_signal
=
A
*
square
(
2
*
pi
*
t
/
T
);
% par défaut, valeur entre -1 et 1
% ----- Signal dent de scie centré -----
sawtooth_signal
=
A
*
sawtooth
(
2
*
pi
*
t
/
T
);
% par défaut entre -1 et 1
% ----- FFT -----
fft_square
=
fftshift
(
fft
(
square_signal
));
fft_saw
=
fftshift
(
fft
(
sawtooth_signal
));
% Magnitude normalisée
fft_square_mag
=
abs
(
fft_square
)/
N
;
fft_saw_mag
=
abs
(
fft_saw
)/
N
;
% ----- Tracés -----
figure
;
subplot
(
2
,
2
,
1
);
plot
(
t
,
square_signal
);
title
(
'Signal carré (centré)'
);
xlabel
(
'Temps (s)'
);
ylabel
(
'Amplitude'
);
subplot
(
2
,
2
,
2
);
plot
(
f
,
fft_square_mag
);
xlim
([
-
50
50
]);
title
(
'Spectre du signal carré'
);
xlabel
(
'Fréquence (Hz)'
);
ylabel
(
'|X(f)|'
);
subplot
(
2
,
2
,
3
);
plot
(
t
,
sawtooth_signal
);
title
(
'Signal dent de scie (centré)'
);
xlabel
(
'Temps (s)'
);
ylabel
(
'Amplitude'
);
subplot
(
2
,
2
,
4
);
plot
(
f
,
fft_saw_mag
);
xlim
([
-
50
50
]);
title
(
'Spectre du signal dent de scie'
);
xlabel
(
'Fréquence (Hz)'
);
ylabel
(
'|X(f)|'
);
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