I’ve been using a PWM square wave as my demodulation source for a project with a lock in amplifier. When used to drive a mosfet it’s a great way to streamline control and readout of my circuit, but the PLL doesn’t seem to play well with square inputs, and at high bandwidth actually ends up adding a ton of noise to the system…
Maybe this isn’t such a big deal as I’m still getting a phase stable 2kHz signal as the demodulation frequency, but as my PWM duty cycle goes to extremes the resulting signal amplitude gets diminished which isn’t ideal. I’d expect that for a digital signal like a square wave the PLL should actually be much easier to implement. I’m really partial to using a square wave here since you have finer resolution over pulse width than you would with a simple analog output- it’s been allowing a cheaper system like the moku go to punch above it’s weight for my particular application. Yes there’s a little systematic error from the harmonics in the square wave, but that can be compensated for.
As an aside, is there any reason that rectification isn’t an option when operating in the external demodulation source mode? That would also be a fine solution for this situation.
PS: I’ve really enjoyed the ability to probe around within the moku like this- being able to see your signal anywhere in the chain has been both educational and useful for troubleshooting.
Cheers.
-Jack