Using an oscilloscope, we can look at the output signal.

 

On the left are the four waveforms that can be generated. All are at 440 Hz.  All four look relatively nice and smooth.

However, if we zoom in on the 440Hz sine wave we can see that it's not a smooth curve. Rather it's quite jaggy and noisy.

 

If the frequency is increased to 8440 the sine curve has degenerated into something very unlike a sine wave. This is because the sample rate is fixed, so as the frequency increases there are fewer samples available for a full cycle. That means fewer points on the signal, and that means a chunkier curve.

 

The easy answer to this is just to increase the sample rate. That, however, is limited by the speed of the underlying hardware. A more significant problem is the sample array. A higher sample rate means a bigger sample array at lower frequencies.

 

This is where the Feather M4 has an advantage over a Feather M0, it's faster and has more memory for more samples.

Speaker

You can hook the speaker to the output to hear the sounds of the various waveforms you generate. Without an amplifier, the volume is fixed and not very loud.

If you use a speaker with a JST connector on the end, use jumper wires to plug into the connector and the other end will plug into the breadboard easily.

This guide was first published on Oct 17, 2018. It was last updated on Mar 16, 2024.

This page (Operation) was last updated on Mar 08, 2024.

Text editor powered by tinymce.