Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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')

Antworten (0)

Kategorien

Mehr zu Measurements and Spatial Audio finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by