1
$\begingroup$

Context:

I'm investigating using a DPLL to track input from a microphone. The mic will be capturing the output of a flute-like instrument. I'm trying to figure out how to configure the DPLL to track the mic input and I'm turning here for help.

Details:

I've implemented something like this:

enter image description here

... but I'm not having much luck in getting it to track, let alone lock, even when given a pure input sine wave. I'm hoping to configure it to capture and track tones from 261 Hz (C4) to 523 Hz (C5).

Note that I'm passing both the mic and the DCO output through a signum function, which outputs [-1, 0, +1] depending on the sign of the input. This is mostly so I don't have to worry about gain control on the mic output. The DCO takes a frequency input (in Hz) and outputs a sine wave. I've set f0 to 261 Hz (the bottom end of my target range).

I may be asking the wrong questions but:

  • How do I determine the right value for the loop gain?
  • I'm using a biquad filter in LPF configuration. Is this acceptable?
  • If so, how do I determine the right cutoff frequency for the low-pass filter?
  • What else should I know or try?
$\endgroup$

1 Answer 1

2
$\begingroup$

Some random pointers

  1. The signum function probably don't help here. PLLs can lock to any harmonic (not just the fundamental) and the signum function will generate lots and lots of harmonics and also some non-linear noise.
  2. If you only want to track pitch over a single octave, you should probably bandpass the signal over that range. That should get rid of most harmonics and also the breathing and sounds.
  3. Most algorithms of this type work with a little state machine: a quick "search mode" where you try to roughly determine whether the signal is periodic in the first place and what roughly the repetition frequency is and a "measurement mode" where you track and measure the frequency with high precision. Search mode can be done with an FFT, max/min tracking, a fast moving delay locked or phase locked loop, etc. DLL is a decent choice for measurement mode as well, but would run a lot slower.
$\endgroup$
2
  • $\begingroup$ Re 1: the loop filter can probably deal with the harmonics. $\endgroup$
    – polwel
    Commented Aug 28, 2022 at 18:58
  • $\begingroup$ > Most algorithms of this type work with a little state machine Ah - that makes sense! I've got a Yin pitch detector waiting in the wings and will use that for the initial f0 of the tracking oscillator. $\endgroup$ Commented Aug 29, 2022 at 2:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.