Steps:
- Apply the pitch track to find the period at each frame, not use overalp in your pitch track, you need do it synchronous and linearly.
- At every time that you find the Period = P search the maximun absolute amplitude on the signal between the range 1 to P*2
these two steps can be done like this:
while ( (k+Step-1) <= Nsamples )
frame = x(k:k+steps-1);
P=PITCHTRACK_FUNCTION_HERE
[v, l] = max(abs(frame(1:P*2)));
if count == 1
marks(count) = l;
else
marks(count) = l+k-1;
count = count +1;
k=k+Step;
end
you now have all marks referring to your entire signal, then walk around the vector marks to aplly a Hamming window of two pitch periods long !
test=zeros(length(x),1); for p=2:length(marks)-2 last=marks(p-1); next=marks(p+1); test(last:next)=test(last:next) + x(last:next) .* hamming(length(x(last:next))); end
PS:
x = your signal
Nsamples = length(x)
k = begins with 1
Step = 256 or 512 or 1024 or 2048