Oscillators: Introduction

Oscillators


The most basic sound-generating process in digital sound is the oscillator. An oscillator creates a periodic waveform of some shape (sine, square, saw, triangle, etc) and repeats it in time. The number of times it repeats per second is its fundamental frequency. This is measured in units of Hertz (Hz) or cycles per second. The reciprocal of frequency is the period, or the number of seconds per cycle.

As a concept


Unit Circle

It is helpful to visualize a sine oscillator as a wheel and spoke.

Unfasor

The angle of the “spoke” is the phase at a given moment in time while the frequency are the number of rotations per second. The length (magnitude) of the spoke is the amplitude at any given point.

Phase

The phase of a waveform, often denoted with the Greek letter phi (Φ), is a means to define a specifc point on a waveform. Phase change is measured on a unit circle, that is, a circle with a radius of 1.0. As the circumference of the circle is 2πr, one rotation has 2π of phase. The unit used to measure phase is the radian.

Sampled Signals

When programming digital audio, we will be working primarily with sampled waveforms. A waveform is generated by calculating samples at a certain (and usually a fixed) rate. This is the sample rate (seconds per sample).

To convert time to a number of samples, simply multiply the time in seconds by the sample rate. For instance: an oscillator at 200 Hz has a period of 1/200 (or .005) seconds. To find the number of samples for this period with a sample rate of 44100; multiply 44100 * .005. The answer is 220.5 samples.

Leave a Reply

Your email address will not be published.