Invalid expression, Correlation Analysis
Afficher commentaires plus anciens
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!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Correlation and Convolution dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!