📄 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 + -