¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Is There a Digital Audio Sinewave Generator That Uses Delta Modulation?


 

A digital audio sinewave generator that uses delta modulation is supposed to have one output only (one MCU pin, for example).

It outputs a delta bits stream which, after filtering, gives a low THD (around 1%) sinewave.

The audio spectrum is, typically, from 20 to 20,000 Hz.

?

I asked this question because I work on such generator since about 2 years (though not full time, just in my free time).

I used to call its project ¡®Delta Sinewave Synthesis, DSS.

?

As most of you know, there is already DDS, Direct Digital Synthesis, generators.

So, if we call DDS a parallel DAC, DSS would be called a serial DAC.

?

The goal of my project is to let the hardware very simple. For example, the LPF could be just a passive 3 RC one (3 poles). This is possible if the frequency of the delta clock is made to be much higher than of the highest sinewave one of interest. In my project, it is 2,000,000 Hz (100 times higher than 20 KHz).

?

But perhaps I was just re-inventing the wheel :(

?
Kerim


 

On 11/25/24 09:32, Kerim via groups.io wrote:
I used to call its project ¡®Delta Sinewave Synthesis, DSS.
But perhaps I was just re-inventing the wheel
Well, yes, there are other DSS audio generators available
in which the 'D' means direct.

I've done some DSS work as well using an FPGA, and like
you, was reinventing DSS generators. Still, it a lot of
fun to think about the problem. Sometime a solution has
applications in other projects. In my case it was the
sine look-up table that I was able to reuse.

Bob

BTW: is your code posted anywhere?


 

On Tue, Nov 26, 2024 at 02:19 AM, Bob Smith wrote:

BTW: is your code posted anywhere?

I don't think it can exist now other than on my laptop :)

?

As you know, a delta bits stream is defined by 3 parameters:

[1] The frequency of the delta clock (say, Fclock).

[2] The number of delta bits in a cycle (say, Nbits).

[3] The delta step (say, Dstep).

?

Fclock depends on how fast the code loop is. I had to use the old MCU, ATmega32A. My code loop is 4 MCU cycles (2 MHz bit rate with an 8MHz crystal).

?

I started the Nbits from 96 bits and ended at 3088 bits. This produces the frequencies from 20833 Hz down to 647.67 Hz (the high band). By lowering 32 times the bit rate (62,500 Hz), the same delta bits streams of the high band produce the frequencies from 651.04 Hz down to 20.240 Hz (the low band). Each band has 485 frequencies: 970 frequencies total. The ratio of two consecutive frequencies is between 1.04% and 0.52%.?

?

The problem is to find the Dstep that generates the delta bits and satisfies a certain condition; like lowest THD for each frequency or constant amplitude for all frequencies, for example.?

?

Since I had no clear idea on how to let the MCU calculate the THD of a bit stream, I chose the second one which is rather easy to code.

So, my first basic code (sorry, I had to write all my codes, since many decades ago, in assembly language only, because of sanctions) generates a table (written on the MCU EEPROM, size 1024 bytes) of the 485 Dstep's (2 bytes each) which lets the generated amplitudes be close to a certain level.?

?

The second basic code uses the results (Dstep's table) from the first one to output a sinewave once it gets a frequency index [0 to 969].

To test the code, I decided to use 3 encoded BCD 10-state thumbwheels connected to 12 IO pins. I also added a push-button to break the wave loop in order to generate another frequency whose index is set already on the thumbwheels.

?

I guess it is clear that my project is more about advanced programming than electronics. I have always no problem to share my work with others (for instance, I personally have 'nothing' to hide in my entire life; intellectual and personal as well). It is up to the owner of the list, since I am just a guest, if discussing here this project in detail is a good idea or not.

?

Kerim

?


 

On Tue, Nov 26, 2024 at 02:19 AM, Bob Smith wrote:
BTW: is your code posted anywhere?
Sorry, I remember now that, 3 days ago, I attached my first code at a post I wrote in the eevblog forum:
https://www.eevblog.com/forum/projects/simple-sinewave-generator-with-arduino-(100hz-100khz)/msg5724993/#msg5724993
?
Since I didn't get any comment, I forgot about it.
?