Any chance of a square wave osc with pwm?

Hi Brian,
Any chance of a square wave osc with pwm?

At least 99%. :smile_cat: Aliasing version first.


I’m assuming we could add a filter directly after the oscillator and set it to the highest cut-off frequency value to act as an-antialiasing filter?

Unfortunately, no. Sampling a waveform containing frequencies above the half the sampling rate (Nyquist) will fold (i.e. alias) those high frequencies down into the lower frequencies so that a low pass filter is not effective. The low pass filter has to be applied before sampling.

There are many techniques for anti-aliased digital oscillators and its something that has been gone over many times by others. Here is an interesting recent one:

Once I have time to do a proper survey of the field and make some evaluations, I will be adding antialiased oscillators to the mix.


Gotcha, as this isn’t an analog brick wall filter before hitting an ADC chip… so it has to be done at the code level.

No stress - the oscillators sound great so far! :slight_smile:

Finally got round to reading this - amazing - thanks for sharing!

Imagining anything better is way beyond my brain power - stoked to think we will be getting something like this in the ER-301 :smiley: