資源簡介
此程序為matlab環境下的基音周期提取算法,通過該算法能夠區分清音和濁音
代碼片段和文件信息
function?pitchwatch(xTs)
%?Plot?the?pitch?keys.
%?pitchwatch(x[Ts])
%?
%?::?Syntax
%????The?array?x?is?the?input?signal?and?Ts?is?the?(optional)?sampling?period.
%????Example?on?use:?[xFs]?=?wavread(‘Hum.wav‘);
%????????????????????pitchwatch(x1/Fs);
%?
%?::?Information
%????Make?your?own?wav-files?with?the?Windows?Sound?Recorder.?Choose?the?attributes
%????PCM?8000Hz?16bit?Mono?when?saving?the?wav-file.?For?more?information?on?pitch
%????keys?go?to?http://www.bookrags.com/wiki/Piano_key_frequencies.
%?Set?parameters.
if?nargin?2?Ts?=?1/8000;?end
%?Set?constants.
xlen?=?length(x);
wlen?=?512;
wlag?=?128;
%?Zero-pad?signal.
xpad?=?wlag-rem(xlen-wlen-1wlag)-1;
x????=?[x(:);?zeros(xpad1)];
L????=?(xlen+xpad-wlen)/wlag+1;
L????=?L-wlen/wlag/2;
%?Calculate?the?AMDF?and?AMDF-fractional?pitch?periods.
for?k1?=?1:L
???k2?=?(k1-1)*wlag;
???for?k3?=?1:wlen/2-1?c(k3)?=?sum(abs(x(k2+(1:wlen))-x(k2+k3+(1:wlen))));?end
???
???n?=?findpeaks(
- 上一篇:基于遺傳算法的BP神經網絡MATLAB代碼
- 下一篇:第三代小波變換curvelet
評論
共有 條評論