spkit.TWM_f0

spkit.TWM_f0(pfreq, pmag, f0min=0.01, f0max=None, f0_pre=0, f0max_err=1, verbose=0)

Two-Way Mismatch algorithm

Two-Way Mismatch algorithm: Selecting f0 from possible candidates

Parameters:
pfreqpeak frequencies
pmagmagnitudes of respective frequencies
f0_pre: f0 of previous frame, (default=0, when not present)
f0minminimum f0 (default f0=0.01)
f0maxmaximum f0 (if None f0max = max(pfreq), max from candidates f0)
f0max_err: maximum error allowed
Returns:
if stable:

f0: fundamental frequency in Hz

else

f0 = 0 (no f0 found)