How to see freq response of a wave file
古いコメントを表示
Hi i am having a wave file
I want to see its frequency response.
How can i see that
採用された回答
その他の回答 (4 件)
Dr. Seis
2011 年 11 月 1 日
None of the above works? Try:
wave_file = 'name.wav';
[wave_data_time, sample_rate] = wavread(wave_file);
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;
wave_data_time_pad = zeros(size(f));
wave_data_time_pad(buff:buff-1+N_temp) = wave_data_time;
wave_data_freq = fftshift(fft(wave_data_time_pad));
figure;
plot(f,real(wave_data_freq),'b-',f,imag(wave_data_freq),'r-');
Honglei Chen
2011 年 11 月 1 日
Let's say you have a wav file called foo.wav, you can use spectrum object to see its spectrum
[y,fs] = wavread('foo.wav');
psd(spectrum.periodogram,y,'Fs',fs);
HTH
Naz
2011 年 11 月 1 日
f='name.wav';
[x,sr]=wavread(f) ;
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))
カテゴリ
ヘルプ センター および File Exchange で Spectral Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!