32 lines
583 B
Matlab
32 lines
583 B
Matlab
#################
|
|
#Created By: Gabriel LUCAS
|
|
#Created :24/03/2023 08:27:54
|
|
#
|
|
#Last modified: 02/03/2023 08:28:32
|
|
#
|
|
#
|
|
#
|
|
#
|
|
#################
|
|
|
|
pkg load signal;
|
|
|
|
[y fs] = audioread("modulator22.wav");
|
|
|
|
t=[1:1:size(y,1)];
|
|
|
|
figure;
|
|
subplot(1,1,1);
|
|
plot(t,y)
|
|
%xlabel('Time (s)');
|
|
%ylabel('Sound (dB)');
|
|
|
|
%Frequency spectrum using DFT
|
|
[powerDFT durationDFT] = frequencySpectrum(y, fs, false);
|
|
|
|
%Frequency spectrum using FFT
|
|
[powerFFT durationFFT] = frequencySpectrum(y, fs, true);
|
|
|
|
sprintf(["time used for DFT: " num2str(durationDFT)])
|
|
sprintf(["time used for FFT: " num2str(durationFFT)])
|