fft of the signal

This commit is contained in:
Gabri6 2023-04-20 11:00:57 +02:00
parent 35cdac9c0a
commit 45a36e3e6b
1 changed files with 19 additions and 0 deletions

19
main.m
View File

@ -7,6 +7,7 @@
%Last Modified: 20/04/23 10:08
%
%%%%%%%%%%%%%%%%
pkg load signal;
samplingFreq = 300; %Hz
@ -23,6 +24,7 @@ figure;
plot(t,signal)
xlabel('Time (s)');
ylabel('Sound (dB)');
title('unknown Signal');
blackmanWin = zeros(1, length(t));
for l_sample=1:windowDuration*samplingFreq
@ -45,3 +47,20 @@ end
% plot the frequency spectrum of this windowed signal
power_blackman = frequencySpectrum(signal_blackman, samplingFreq);
fft_signal = fft(signal);
size(fft_signal)
figure;
plot(t, fft_signal);
xlabel('Time (s)');
ylabel('Sound (dB)');
title('FFT of signal');
%b = fir1(600, [1/fMax, 1/fMin], 'bandpass');
%filtered_signal = filter(b, signal);
%figure;
%plot(t,filtered_signal)
%xlabel('Time (s)');
%ylabel('Sound (dB)');