I set my sample rate to 1000hz and then generate a tone at 500hz the audio is blank and there is nothing there.
499hz creates waves, but anything above that appears to be blank. What gives?
If you want it to not care about the relationships between sampling frequency and audio tone, pick a Nyquist value of 2.6 minimum. Nyquist of 2.0 depends on too many tricks and sloppy electronics to work reliably under all circumstances. As above, it can be faked out.
499hz creates waves, but anything above that appears to be blank. What gives?
At a frequency of half the sample rate you get two samples per cycle… One sample-point for the positive-half of the “waveform” and one sample-point for the bottom half of the “waveform”. (If that doesn’t make sense, [u]this tutorial[/u] explains how audio is digitized/sampled.)
Mathematically, the sine of zero-degrees is zero, and the sine of 180 degrees is also zero. If you try to generate a sine wave at one-half of the sample rate, ALL of your samples end-up at zero-degrees and 180 degrees* (where the wave passes-through the zero-crossing) and you’ll get a series of zero-value samples = DIGITAL SILENCE!
However, the cosine of zero degrees and 180 degrees is 1. If you generate a cosine wave at half the sample rate it, will work!
\
To be more precise, all of the samples lie at multiples of 180 degrees (and all multiples of 180 degrees have a sine equal to zero). So, a sine wave has a value of zero (a zero-crossing) every 180 degrees.
The Square Wave choice in Generate > Tone works at half the sample rate in terms of being audible, though the waveform looks untypical of a square wave.
and “Square (no alias)” produces silence.
To see why, look at the starting point of the waveform when generating a tone well below the Nyquist frequency. The starting point will be the first dot, then there will be dots for each consecutive 1/2 cycle.
It’s the same as a cosine wave–the zero crossings are mid-point between samples thus you do not have the zeros from the sine wave.
By the way, shouldn’t we have a little bit more than the current wave-forms?
For example:
Saw-tooth, no alias
Triangle (+ no alias)
Buzz (summation of cosines up to Nyquist, gives single impulses at <=1 Hz)
optionally:
square waves with other duty factors, not only 50 %.
+1 if you can. I find it too hard to locate plug-ins in New Plug-Ins - Audacity Forum and often a search will produce several similar plug-ins that are the same as each other except for one or two different controls.
I still think that the changes should go directly into audacity’s shipped effect.
It makes no sense to have a alias-free square wave but no alternative to saw-tooth.
Perhaps we should ship the Nyquist tone generator instead of the current built in Tone generator.
For the non-alias versions, the Nyquist effect is much faster than the built-in effect, particularly for low frequency waveforms, and we could have a Preview button if we wished to.
Do you think that it is worth having a Preview button on a simple waveform generator? I’m thinking perhaps not as it is not an effect that users are going to be able to “tweak”, though it may be instructive if users can quickly hear the tone difference between allowing or not allowing aliasing.
“Instructive” is the keyword here. It might be helpful for total novices to experiment without reenter the tone generator again and again.
Also, amplitude and frequency are tweaked too, thus it is nice to set them on the fly.
Last but not least, the plug-in can display warnings as well, if the frequency is for instance >= Nyquist. The user has therefore a second chance to enter proper values when he’s tried the preview first.
Well, a 1 hour square wave (with your hq tone plug-in) in 6 seconds is for me fast enough.
The tones will most likely not be longer than a few seconds in average.
They are very boring when listening to them over a longer time–and the dogs get crazy as well.
Omitting the time input spin box is a pity, I admit, especially for special formats and for the fact that the selected time is automatically passed on.
We should keep that in mind for version 4 plug-ins.