# How to see freq response of a wave file

58 views (last 30 days)
moonman on 1 Nov 2011
Commented: 종민 손 on 29 Jul 2020
Hi i am having a wave file
I want to see its frequency response.
How can i see that

Wayne King on 1 Nov 2011
Again, if it's a signal and not a system, we don't say frequency response, but you can just use fft(). That gives you the DFT of the signal, so it is complex-valued. You can visualize the magnitude and phase responses separately. If your signal is real-valued, then the DFT is conjugate symmetric so you only have to keep the "positive" frequencies.
ydft = fft(y);
% I'll assume y has even length
ydft = ydft(1:length(y)/2+1);
% create a frequency vector
freq = 0:fs/length(y):fs/2;
% plot magnitude
subplot(211);
plot(freq,abs(ydft));
% plot phase
subplot(212);
plot(freq,unwrap(angle(ydft)));
xlabel('Hz');
##### 2 CommentsShow 1 older commentHide 1 older comment
종민 손 on 29 Jul 2020
thanks!

Dr. Seis on 1 Nov 2011
None of the above works? Try:
wave_file = 'name.wav';
N_temp = length(wave_data);
N = 2^nextpow2(N_temp);
buff = floor((N-N_temp)/2)+1;
Nyq = sample_rate/2;
df = sample_rate/N;
f = -Nyq:df:Nyq-df;
figure;
plot(f,real(wave_data_freq),'b-',f,imag(wave_data_freq),'r-');
##### 2 CommentsShow 1 older commentHide 1 older comment
Yasir Ali on 12 Mar 2019
I also need frequency respinse for it while fs =44100 and y=220500 ×2

Honglei Chen on 1 Nov 2011
Let's say you have a wav file called foo.wav, you can use spectrum object to see its spectrum
psd(spectrum.periodogram,y,'Fs',fs);
HTH
##### 2 CommentsShow 1 older commentHide 1 older comment
moonman on 1 Nov 2011
ok got it
but it is power spectral density
i need freq response

Naz on 1 Nov 2011
f='name.wav';
Ts=1/sr;
N=2^15;
x=x(1:N)';
time=Ts*(0:length(x)-1);
figure(1)
magx=abs(fft(x));
ssf=(0:N/2-1)/(Ts*N);
plot(ssf,magx(1:N/2))

moonman on 1 Nov 2011
Can anyone help me I am having wave file I want to see its freq response How can i see that