Azzera filtri
Azzera filtri

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

1 visualizzazione (ultimi 30 giorni)
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')

Risposte (0)

Categorie

Scopri di più su Measurements and Spatial Audio in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by