?? processpw.m
字號:
function processed = processpw;
% record input signal, detect endpoints and crop, calculate mel-frequency
% cepstrum co-efficients (functions melcepst.m and melbank.m taken from
% http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html, freeware copyright of
% Mel Brookes of Cambridge University.
fs = 10000; % set sampling rate
choppedok = 0; % initialise variable
% grab waveform and process it
while (choppedok == 0)
recording; % notify user
grabpw = wavrecord(fs*3,fs); % grab for 3 secs
close(recording);
if (length(grabpw) > 2000)
chopped = endp(grabpw,fs); % chop the signal at the endpoints
if (length(chopped) < 1000)
tryagain; % display error box
else
choppedok = 1;
processed = melcepst(chopped,fs); % calculate 12 co-efficients to represent signal
end;
end;
end;
return;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -