问题
As seen in comment link a pitch by Talkin’s Robust Algorithm for Pitch Tracking in voicebox (function name is "fxrapt") is extracted.
http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/doc/voicebox/fxrapt.html
However, I need to find pitch pulses in the LP error signal by detecting the maximum amplitude within each pitch period. For each pitch pulse, a Hamming window of two pitch periods long. if T(i-1), T(i), T(i+1) denote the locations of three successive pitch pulses. How can I design a analysis window for the pitch pulse at spans from T(i-1) to T(i+1), as illustrated in bellow link Figure ?
I am looking for MATLAB code for it. I will really appreciate, if anyone can help me. Thanks.
回答1:
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
来源:https://stackoverflow.com/questions/21952495/find-pitch-synchronous-windowing-based-on-pitch-tracking