我試圖使MATLAB的頻譜, 這裏是我的代碼:編程MATLAB(如何在實時處理)
% Record your voice for 100 seconds.
recObj = audiorecorder;
disp('Start speaking.')
recordblocking(recObj, 100);
% Store data in double-precision array.
my= getaudiodata(recObj);
figure;
specgram(my,512);
的問題是,當我說我想要的頻譜是顯示,所以它應該更新,因爲我說話。如何在聲音來自麥克風時繪製頻譜圖?所以我應該能夠看到頻譜實時
我也試過這個
% Record your voice for 100 seconds.
recObj = audiorecorder;
disp('Start speaking.')
a=0;
figure;
while a<60
recordblocking(recObj, 100);
% Store data in double-precision array.
my= getaudiodata(recObj);
specgram(my,512);
a=a+1;
end
,但它只會顯示頻譜時,while循環魚(因此運行60次後)
我不是matlab的專家,但你不只是需要一個循環周圍4至9?順便說一句,這被標記爲C,但我看不到關係。 –