?? homotime.m
字號(hào):
function homoTime(x, Fs)
index1 = Fs/500; % maximum speech freq = 500Hz
index2 = Fs/50;%minimum speech freq supposed to be 50Hz
subplot(2,1,1),plot(x);title('Signal');xlabel('Time(ms)'); ylabel('Amplitude');
auto=xcorr(x,index2,'coeff'); %autocorrelation
d=(-index2:index2)/Fs;
subplot(2,1,2),plot(d,auto);
title('Autocorrelation');xlabel('Delay(ms)'); ylabel('Correlation Coefficient');
auto=auto(index2+1:2*index2+1);%taking one side of the autocorrelation
[auto_maxim,locs]=max(auto(index1:index2)); %searching for maxima in min to max range
fprintf('Pitch Frequency in Time Domain = %gHz\n',Fs/(index1+locs-1));
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -