ΣSigmaStudio Ask AI Русский Log in

Generating clean sawtooth waves with ADAU1701

SigmaDSP & SigmaStudio dualtriode Feb 2, 2023 00:00 2 replies Original on forum ↗
Subscribe
dualtriode Question
Feb 2, 2023 00:00

I would like to generate a sawtooth wave that:

A) Has accurate enough pitch control to be tuned with a precision of a few cents on a musical scale

B) Is free of aliasing

I have gotten each of these requirements to happen individually, but not both at the same time!

I am testing this on an ADAU1701 development board from Parts Express, and in the final product controlling the SigmaDSP with a microcontroller by sending it values over I2C. Both Sigma Studio USB control and microcontroller control give the same results so I am confident the DSP is being controlled correctly from the microcontroller.

Here's what I have tried so far:

1) Sawtooth oscillator module. The tuning was perfect and could be typed in in Hz. However, the sawtooth oscillator module is not band limited, so the aliasing was unacceptable. I made some attempts at filtering it but was not getting a clean sawtooth no matter what I tried.

2) Sinewave VCO with resettable phase and a threshold detector resetting the phase. This was close, but as the frequency went up the tuning lost resolution to the point where it could not be tuned precisely enough. Could this be due to stair-stepping of the amplitude of the sine wave?

3) Sinewave VCO with resettable phase, with the phase being reset by a square wave (which maintained the tuning precision), essentially creating a "hard sync". This had a lot of nasty artifacts at higher frequencies worse than the aliasing of the sawtooth module.

4) Building a "discrete" oscillator out of smaller modules. Another user posted this, so I gave it a try. This got rid of the aliasing but the precision of pitch control was not good enough to keep it tuned to a musical scale. I suspect the precision was lost in the adder module but I am not sure.

Thanks for checking this out. Cheers!

oscillator

Audio Signal Processors

software

sigmaStudio 4.7

sigmastudio

SigmaDSP Audio Processors

SigmaDSP

adau1701

Show More

Sawtooth-Oscillator.png
Sawtooth-Oscillator.png
VCO-with-Threshold-Reset.png
VCO-with-Threshold-Reset.png
VCO-with-Square-Reset.png
VCO-with-Square-Reset.png
1070.image.png
1070.image.png
dualtriode Reply
Feb 2, 2023 00:00

Sorry, this is the right image for #4 above.

Discrete.png
Discrete.png
KJBob Reply
Feb 11, 2023 00:00

Hello,

Is the frequency from the #4 design lower than expected, with the error worsening as the pitch increases? If so, it’s likely caused by the one-sample delay built into the Feedback cells. As a result, your sawtooth wave’s period is always one sample (1/Fs) longer. This matters more at higher frequencies, making the error nonlinear. You could correct for this in your microcontroller code.

To fix the frequency resolution issue at higher pitches, you could have your microcontroller also adjust the nominal 1.0 DC source within a range of 0.95 - 1.00. This would afford a fine-tuning range of about one semitone. It would also introduce a worst-case amplitude variation of 0.5 dB, which shouldn’t be audible.

I’m curious about the aliasing— what symptoms does it cause?

Best regards,

Bob