Resolution of tone generator?

I’m not sure where to look this up, so I thought I would ask on the forum.

What is the resolution (precision) of the default tone generator in audacity?

Is it integer values of hertz, or some number of decimals?

The tone generator screen allows data entry of non-integer values for the hertz to generate, but I’m wondering how many, if any, decimal values are actually recognized and used to generate the tone.

So I believe this is double precision floating point.

You can check yourself in the source code for the Audacity Tone generators:
(Of course it is a little tricky to follow). :wink:

Thank you. Yes, the CPP code references a double precision floating point number. I did a little project, which I’ll post, showing the tone generator does indeed recognize the decimal portion of a real number entered as the Hz for the generated tone.

After @jademan’s comment, with the appropriate source code to review, (the CPP code has the Hz as a double), I decided to do a little project.

I generated a mono 440.00 Hz tone track (full left), and separate mono tracks (also full left) at 440.00 Hz, 440.10 Hz, and 440.01 Hz, each of duration 60 seconds, and amplitude set at 0.4.

I then output three separate wav files with 440.00 & 440.00 Hz, 440.00 & 440.10 Hz, and 440.00 & 440.01 Hz.

As expected,

the 440.00 & 440.00 did not beat,
the 440.00 & 440.10 beat with a frequency of 10 seconds = 1/(440.10 - 440.00) seconds, and
the 440.00 & 440.01 beat with a frequency of 100 seconds = 1/(440.01 - 440.00) seconds.

The beating is visible in the waveforms, and is audible as well. Hearing the beat occur in the 440.00 and 440.01 is hard to track, unless you know it’s there, with a half-period of 50 seconds.

If I can figure out how to attach an image, I’ll attach a screenshot of the audacity project. The top audio track is a reference mono of 440.00 Hz. The next three audio tracks are 440.00, 440.10, and 440.01 Hz. The bottom three audio tracks are the result of combining 440.00 with 440.00, 440.10, and 440.01, respectively.

So, yes, Audacity generates tones to at least 2 decimal points, with discernible audible output.


Glad to hear you are happy with Audacity’s tone generators. :grinning:

The tone generator [advertising link removed]