How are waveforms generated?

Thread Starter

Green Bean

Joined Mar 31, 2017
126
Square waves are generated from simple oscillators, it's either on or off. That I understand. And as far as I know, if music is being produced from a speaker, "frequency" defines the rate at which the speaker is being vibrated. A high frequency (very fast vibration) produces a high-pitched tone, and a low frequency (slow vibration) produces a low-pitched tone.

I think that the vibrations are caused by the oscillating electrical pulses. But if that's the case, how are sine, triangle, and sawtooth waves generated? I thought that there had to be a pulse of electricity, and then nothing at all to vibrate the speaker. But it seems like what matters is that there's a change in voltage at all and that the extent of that change doesn't matter, as long as there is a change, there will be a vibration. Going from 5v to 0v vibrates the speaker, but so does going from 5v to 4.5v. So a sawtooth wave for example, would be produced by increasing the voltage at a constant rate, and then suddenly dropping to 0v, and repeating.

Does this all sound right? Just looking for clarification. ;)
 

crutschow

Joined Mar 14, 2008
38,503
................I thought that there had to be a pulse of electricity, and then nothing at all to vibrate the speaker. But it seems like what matters is that there's a change in voltage at all and that the extent of that change doesn't matter, as long as there is a change, there will be a vibration.
Yes, music is a continuous change in voltage, example below.
Ideally the speaker movement follows that waveform precisely to accurately reproduce the music sound.

Music, sinewaves , triangular waves, and sawtooth waves are definitely not a pulse on/off type of signal.
The voltage for those is continuously varying.
Only square-waves are an on/off or high/low type of signals.
 

MrChips

Joined Oct 2, 2009
34,807
You're almost there. Instead, you may want to picture wave motion.
Imagine an object like a ball floating on a pond of water. The ball can move up and down slowly or quickly depending on the shape of the wave.
The cone of a loudspeaker can do the same thing, depending on the voltage applied to the speaker. It can be a slowly oscillating sine wave, an increasing rise at constant rate, or a sharp step.

It does not have to be a pulse. A triangular wave is a constantly increasing voltage followed by a constantly decreasing voltage.

What you hear depends on both the rate of change and amplitude. Higher amplitude of course makes the sound louder.

An essential property of the wave is its frequency. You may naturally want to think of the frequency as oscillation. However, the wave does not necessarily have to oscillate. A step function alone (like a tsunami wave) can also produce sound. If you hit a hammer on a table you still hear sound. In theory, when the hammer strikes the table, the sound wave generated is equivalent to sound at infinite number of frequencies all mixed together.

A single pure note is oscillation of a single sine wave at a single frequency. A flute generates almost a perfect sine wave.
The note from a violin string while being bowed is not a single frequency sine wave even though it may be the same musical pitch as the note from the flute. The note from the violin string contains sine waves at other frequencies, multiples of the original frequency. The original or base frequency is called the fundamental frequency. The other sine waves at multiple frequencies are called harmonics or overtones.
 

Marley

Joined Apr 4, 2016
519
Basically you are right. A square wave may look like it's either on or off. But in fact there will be a rise time and a fall time - no square wave is actually square. The "squarer" it is, the more high frequencies it contains.

Although it may be hard to understand, all waves whether they are "square", sawtooth or any other shape are equivalent to (or are made up of) a number of sine waves of different amplitudes and phases all mixed together. Only a "pure" sine wave is made of one frequency only. If it deviates from a sine wave, even slightly, this is because other frequencies have been introduced.

In an audio system, a microphone produces a voltage that is proportional to the pressure of the air touching the diaphragm (sometimes the velocity of the air at the diaphragm but don't worry). Higher pressure, the more the diaphragm moves - in and out, positive and negative voltage. This voltage is amplified and with any luck, the loudspeaker cone will move in exactly the same way and at the same time. Reproducing the sound. Of course, due to limitations in the system, the sound out of the loudspeaker does not sound the same as the sound at the microphone. This is because all these sine waves are not all amplified the same (their amplitude changes) or take the same time to pass through the system (their phase changes).

Actually, our ears cannot detect phase so you can have two waves that look completely different on an oscilloscope but sound the same. However, our ears do detect all the different sine waves that make up the wave so if some are missing or are different amplitudes then you can tell the difference.
 
Last edited:
Top