Press the monitor buttons, or type in keyboard commands to listen to what is happening with digital audio. Adjust settings in real-time using mouse sliders.
View and listen as a continuous wave is sampled and quantized into an audible sound. For those who want to hear what happens after it’s converted, press O to listen to the original signal with no conversion limits. For those who prefer to listen to the quantized version, press C to go back to the converter output. If you’d like some silence, just hit S to mute the test bench.
How to Use the Digital Audio Tool
Want to run an automated sweep where it will fly the frequency right past the Nyquist barrier? Press N for that. Want to try your luck at guessing the signal type in a blind listening trial? Press B for that. Guesses are entered using the number keys.
The scope at the top shows the waveform as it travels through the converter. You will notice that the source pitch is retuned instantly by dragging the mouse around on the canvas. This allows you to play with what happens when different frequencies meets the sample rate. Keep an eye out for the red stepped line, which shows how the sample and hold process captures moments in time as separate snapshots.
The oscillator uses a slider for its pitch source which you can adjust and even make as high as you like to test the Nyquist limit. Use the dropdown menu to choose the type of wave you’d like: square, sawtooth, triangle, or sine. Lower sample rates and bit depths will impact each one in different ways.
The length slider controls the number of bits. Lower values like two or three bits create fewer amplitude levels and harsh quantization noise. Higher numbers (closer to studio quality) create smoother curves.
The sample clock slider adjusts the sample rate in kilohertz. If you set it too low and then play a pitch higher than half that value, you’ll hear aliasing.
There is an adjustable monitor level slider. This controls the overall volume. Quantization noise can be piercing at high levels. Make it comfortabley.
The Inject dither button adds a triangular noise to your signal. It can smooth out harmonic distortion at very low bit depths. It also decorrelates quantization error. The dither switch is worth a try with extreme bit depths, as it can make the noise floor sound better.
Quick contrast button dials in a preset for crunchy speech rate audio. It sets low bits and a moderate sample rate for immediate dramatic effects. Recalibrate button brings everything back to its default studio-like values.
This is the Nyquist gate visualizer. It demonstrates how far above or below your sample rate (or frequency if you’re using a pitch) your source pitch is compared to Nyquist. Adjust your sample rate or frequency up/down, and watch the red dot move across the screen. When it reaches the center line, you’ve exceeded Nyquist and will experience aliasing.
The binary word display shows current digital code of the active sample. To test out your ears, begin with a blind round using the artifacts of your converter. Choose a revealing clock and bit depth. Then fire up the trial. For a brief moment, the system conceals the converted or pristine path. Guess what you’ve just heard. Keep track of your score.
If the converted path is easy to identify, the settings are low. To get a clear sense of what’s going on, listen for aliasing as you play around with lower sample rate and higher frequency. For just rounding amplitudes, drop your bit depth down to three or two. With low level signals, listen with dither on and off.
Use fullscreen mode to give yourself more room to see the evolving waveform. Digital audio is limited in two ways: sample rate fixes how time is captured, and bit depth rounds the volume into set levels. The widget illustrates what that means for you: You’ll be able to hear aliasing distortion versus quantization noise. Explore it all interactively with the controls.
The ability to tweak the pitch is available via the frequency slider and drag of the scope. Keyboard shortcuts make it easy to switch between monitors and run sweeps quickly. Have fun with the Nyquist sweep that demonstrates the behavior of folded frequencies. I also like the blind trial which makes for a fun part of the listening exercise.
So spend a little time, mess around with it, and pay attention to the results. When you move that bit depth slider, watch what happens in the scope as the waveform appears and the red line gets jaggier as you drop the resolution. With the sample rate slider, see where fewer samples fail to capture an interesting part of the wave.
The dither button shows you what noise shaping can do for low bit depth audio. It breaks up correlated errors by adding a small amount of random noise. That’s why sometimes this makes the quantization distortion sound less harsh. You can try some extreme sound experiments by using the preset recipes as great starting points.
If you wish, you can also reset your converter and begin again with the normal settings. There’s a reset button that sets everything back to the default of medium quality and sine wave. If you’ve been pushing it to the max with high frequency or low bits this will come in handy.
With the click of a button, switch back to the original monitor for the clean sound. The interface provides visual and audio feedback to the input. As it samples the signal, it updates the binary display in realtime. You’ll be able to visualize what those abstract numbers mean from the waveform which shows which bits were active at any given time. It provides a visual aid that helps link the abstract numbers with your heard sound.
If you play around with the square wave at lower sample rates, you can hear some severe aliasing. The reason is that the square wave has rich harmonics, which wrap back into the audible range quite easily. This contrasts with the sine wave that will only produce aliasing when its fundamental falls above Nyquist. All these examples illustrate parts of the sampling theorem.
Compare dithered output to bare quantization. Bare quantization produces harmonic distortion that follows the tone. With dither, it distributes the error in the form of broadband noise that is often less objectionable. Listen with your ear to determine what sounds best for your particular setup.
This is the Nyquist ceiling meter. This indicates how high a frequency you can represent. As the sample rate changes, so does the maximum frequency. Try not to go above this value and create unwanted aliasing effects. You can visually monitor for this using the gate visualizer.
Resting your ears between experiments is as easy as hitting the mute button. If you’ve been listening to digital distortion for too long it will get tiring on the ears. The bench will stop any automatic trials or sweep in progress when muted. Simply select another monitor path and pick up right where you left off.
The Trial Score measures how well you can hear a difference between pristine and converted files. If it’s easy for you, then your settings are producing noticeable artifacts; lower the sample rate or bit depth accordingly. Otherwise raise the quality level until it becomes more subtle (and therefore less audible).
Test out the limits of what goes wrong with digital audio. Set the bit depth to as low as it will go, and the sample rate to as low as it will go. See how undersampling and extreme quantization ruin your sound, then slowly ramp up the settings until you begin to hear the signal come back into focus.
There are no external dependencies, it runs entirely in your browser. Everything is generated on the fly: The waveform is drawn in real time using Web Audio, which also generates the sounds. As soon as you load the page, you’re ready to play around. No plugins or downloads are necessary.
If you want to play with it, drag the source pitch slider gently and listen as the converter does its thing. As you near the maximum frequency, listen for the change in the alias frequency. The higher the pitch, the more obvious the frequency mirror effect. Even though the source increases in pitch, the alias falls down by an equal amount.
Finally, listen to the triangle wave for its harmonic response to quantization. Compared to the square wave, the triangle will have fewer harmonics but more than a sine. So, this is a nice compromise between the two for you to hear the quantization noise in action. You’ll note the odd distortion characteristics as well. They’re not hard to hear by ear.
A sawtooth wave also has lots of harmonics, which makes it prone to aliasing. At a moderate sample rate, you’ll notice that there are folded frequencies. To increase the aliasing effect, try reducing the sample rate. These high-frequency components can be seen clearly on the scope.
Leave your volume slider where you feel most comfortable for the test. Dropping down to a lower bit depth will result in some sudden, loud quantization noise. Set your volume to something moderate so that you can hear what’s going on but not turn it up too far until you’re sure you’ve found something solid.
There’s also a handy shortcut reference in the help panel, which you can expand by clicking the how to play button. It will remind you of the basic interaction tips and keyboard mapping. It is handy if you come back to it after a while.
It’s also compatible with touch controls on mobile devices. You can drag the scope around with your finger like you would a mouse cursor. Buttons and sliders respond to your touch input. The user interface adapts to smaller screens.
The widget is also easy on the eyes, thanks to dark mode support. It automatically follows your system preferences for color scheme. Colors also adapt to reduce glare in low light environments. This makes it more comfortable for long experiments.
This is a fun little test