how to use periodogram?
10 ビュー (過去 30 日間)
古いコメントを表示
i want to analyse a .wav file using spectral.periodogram, but i have a trouble, what should i do?
x = wavread('balaclava5s.wav'); size(x); N = 350208; Fs = 44100; ts = 1/fs; tmax = (N-1)*ts; t = 0:ts:tmax; periodogram(x)
is it right? i'm new to digital signal processing, and i have no basic.
0 件のコメント
採用された回答
Wayne King
2012 年 10 月 2 日
編集済み: Wayne King
2012 年 10 月 2 日
wavread() will return the sampling frequency. Then you input the sampling frequency into periodogram() (along with the other documented inputs) to get a meaningful frequency vector as an output.
[x,Fs] = wavread('balaclava5s.wav');
[Pxx,Freq] = periodogram(x,rectwin(length(x)),length(x),Fs);
plot(Freq,10*log10(Pxx))
grid on;
xlabel('Hz'); ylabel('dB/Hz');
Just
periodogram(x,rectwin(length(x)),length(x),Fs);
produces a plot without outputting any data.
0 件のコメント
その他の回答 (1 件)
nah
2012 年 10 月 2 日
2 件のコメント
Wayne King
2012 年 10 月 2 日
編集済み: Wayne King
2012 年 10 月 2 日
You likely have a two-channel recording from the .wav file.
Try this
[x,Fs] = wavread('balaclava5s.wav');
x = x(:,1);
[Pxx,Freq] = periodogram(x,rectwin(length(x)),length(x),Fs);
plot(Freq,10*log10(Pxx))
grid on;
xlabel('Hz'); ylabel('dB/Hz');
Then the rest of my example.
参考
カテゴリ
Help Center および File Exchange で Spectral Measurements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!