realtime spectrogram

Hello, I am trying to read in using analoginput, then what i want to do is display the spectrogram in real-time. i managed to do this using audiorecorder, but it wasn`t every smooth, it wouldn`t continuously display the spectrogram.
i did this; in= analoginput('winsound'); chan = addchannel(in,[1 2]);
% Now i have the input.
a=0
while a<100
start(in);
data=getdata(in);
specgram(data(:),512);
a=a+1;
end
but the spectrogram is so bad, (quality wise), and it doesn`t continuously change, can anyone show me how to do this (please)
I want the spectrogram to scroll from right to left, in real time. Please help.

1 件のコメント

Walter Roberson
Walter Roberson 2011 年 7 月 16 日
Please do not post duplicate questions (referring to the duplicate I already deleted.) You can edit your existing question if you want to add more information.

サインインしてコメントする。

回答 (1 件)

Walter Roberson
Walter Roberson 2011 年 7 月 16 日

0 投票

Only do the start(in) once, before the loop.

4 件のコメント

rave
rave 2011 年 7 月 16 日
i tried that now, but samething, its not scrolling from right to left and the spectrum quality is so bad:
i came across this: http://www.mathworks.com/matlabcentral/fx_files/2549/1/SoundRecorderDemo.zip
it displays the wave form, from right to left, its exactly i want expect it should display the spectrogram.
i tried to modify it, i saw only thing that has to be modified was the plot_handle fucntion, i changed that to spectrogram(getdata(daw_object))
rave
rave 2011 年 7 月 16 日
..but when i changed to spectrogram(getdata(daw_object)); it gave me tons of erros.
Walter Roberson
Walter Roberson 2011 年 7 月 16 日
See http://www.mathworks.com/matlabcentral/fileexchange/18596-real-time-microphone-and-camera-data-acquisition-and-audio-video-processing/content/Documentation.html
rave
rave 2011 年 7 月 16 日
i don`t know if it`s me or not. but when i try to run it, the spectrogram doesn`t update the spectrum at realtime

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeMatrix Indexing についてさらに検索

製品

タグ

質問済み:

2011 年 7 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by