データ解析ツールoctaveを語ろう Part 2at UNIX
データ解析ツールoctaveを語ろう Part 2 - 暇つぶし2ch620:名無しさん@お腹いっぱい。
18/09/24 10:21:00.69 .net
>>618
help spcegram から拾ってきた。
融通を聞かせたいなら,sepcgram自体で書かせるのでなく,
変数の返り値を操作してimagesecで描く。
軸の操作などは set(gca, .....) で行う。
[x, Fs] = auload(file_in_loadpath("sample.wav")); # audio file
step = fix(5*Fs/1000); # one spectral slice every 5 ms
window = fix(40*Fs/1000); # 40 ms data window
fftn = 2^nextpow2(window); # next highest power of 2
[S, f, t] = specgram(x, fftn, Fs, window, window-step);
S = abs(S(2:fftn*4000/Fs,:)); # magnitude in range 0<f<=4000 Hz.
S = S/max(S(:)); # normalize magnitude so that max is 0 dB.
S = max(S, 10^(-40/10)); # clip below -40 dB.
S = min(S, 10^(-3/10)); # clip above -3 dB.
imagesc (t, f, log(S)); # display in log scale
set (gca, "ydir", "normal"); # put the 'y' direction in the correct direction


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch