Effacer les filtres
Effacer les filtres

how to get max frequency and how to get frequency response for 0.5 seconds wav file by using following code?

1 vue (au cours des 30 derniers jours)
this is the code in which I need frequency response for 0.5 seconds and how to set xlim and max frequency ?
[y,fs]=audioread('filename.wav);
Nsamps = length(y);
t = (1/fs)*(1:Nsamps)
% do fourier transformer
y_fft= abs(fft(y));
y_fft= y_fft(1:Nsamps/2);
f=fs*(0:Nsamps/2-1)/Nsamps;
%plot sound file in Time domain
figure
plot (t, y)
xlabel('Time (S)')
ylabel ('amplitude')
title('file name in Time Domain')
%plot sound file in frequency domain
plot(f, y_fft)
xlim([0 1000])
xlabel('frequency(HZ)')
ylabel('amplitude')
title('frequency response of song')

Réponses (0)

Catégories

En savoir plus sur Measurements and Spatial Audio dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by