[sdiy] Mixing PWM audio from 2 different devices. Ouch!

Gordonjcp gordonjcp at gjcp.net
Fri Jul 21 14:16:37 CEST 2023


On Thu, Jul 20, 2023 at 04:17:27PM +0100, Tom Wiltshire wrote:
> If the tone is the result of beating between the two PWM frequencies, then better filtering to remove the PWM clock will help.
> 
> I'm betting both of the individual synths use the PWM at such a high frequency that they probably don't bother with much filtering. You can't hear it anyway, so what's the problem?! That's fine until you do something like you've done, and then the problems begin.
> 
> I'd run the audio from each synth through a lowpass filter set for 20KHz before mixing them together, and see if that helps. If the frequencies are really high, a simple 2nd or 3rd pole filter would do it. A MFB filter is to be preferred in this situation for the better high frequency response - it continues to roll off, whereas a SK doesn't.
> 

I've had excellent results from using a 2-pole Sallen-Key filter at some suitable cutoff (a bit below half the sample rate), and then a notch at the PWM "carrier" frequency.

The S-K filter does the "reconstruction" back into a plausible-looking waveform and the notch mops up the very last of the carrier. Since the problem frequency is one specific frequency and it's possible to make extremely deep notches, this works well for a low component count.

-- 
Gordonjcp



More information about the Synth-diy mailing list