Invalid expression, Correlation Analysis
Show older comments
N = length(data);
Mlen=256;
Mstep=192;
Nramek=floor((N-Mlen)/Mstep+1);
ramki = zeros(Mlen, Nramek);
Xr = zeros(Mlen * 2 - 1, Nramek);
for i=0:Nramek-1
ramki(:, i+1) = data(1 + i*Mstep : i*Mstep + Mlen);
ramki(:, i+1) = ramki(:,i+1) - mean(ramki(:, i+1));
[Xr(:,i+1), lags] = xcorr(ramki(:, i+1));
end
offset = 20;
[XrMax, idxMax] = max(Xr(lags > offset,:));
idxVoiced = XrMax > 0.35*Xr(lags == 0);
lags = lags(lags > offset);
lags = lags(idxMax(idxVoiced));
T = mean(lags) / Fs;
fpod = Fs/mean(lags)
I have question, why this code does not work? I have been thinking about this problem for hours and have no idea :(
Thank for help!
Accepted Answer
More Answers (0)
Categories
Find more on Correlation and Convolution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!