MUSC 108. Introduction to Music Technology - Fall 2013

12 Time Domain Effects

[Syllabus] [Overview]

Time domain Effects

An audio effect can be thought of as a black box whose input is an audio signal and whose output is a modified version of that signal. Common digital audio effects are known by the names: amplification, normalization, reverb, distortion, flanging, chorusing, compression, limiting, enhancing, equalize, parametric equalizers, and delay lines. The signal can be processed mathematically (software) or electronically (hardware). Some effects are subtle and some effects are obnoxious. Software effects can be classified as time domain effects or frequency domain effects. Time domain effects manipulate the actual samples. Frequency domain effects take the FFT of the signal, modify the frequency spectrum, and then convert the modified spectrum back into the time domain with the IFFT.

Many of the time domain effects have their origins in the days of analog tape studios. The audio signal was recorded onto magnetic tape and played back through a tape deck. Effects were produced by speed changes, playing the tape backwards, and cutting the tape into small fragments and reassembling the fragments in a different order. Similar effects are found in virtually all sound editing software programs.

Remove DC Offset

Time domain effects work optimally when the mean of all sample amplitudes is zero. Another way of stating this is that the sum of all positive amplitudes and the the sum of all negative amplitudes should equal zero. The term DC stands for "Direct Current". In electronics and analog synthesizers you could and a small amount of current to a waveform to balance its symmetry above or below the x axis. In digital audio you want the DC line to lie right on the x axis. The Remove DC Offset effect should be the first effect used on an audio file.

DC = 0 (good)
DC = .2 (bad)
good DC bad DC

Amplify

The Amplify effect raises or lowers the volume of a sound to a specific decibel level. Conversion formulas between amplitude and decibels are shown below.

Formula Example Comments
amplitude to decibel formula amplitude to decibel example 0.5 is a ratio where the amplitude of one sound is half as that of another
decibels to amplitude formula decibels to amplitude formula example If one sounds os -6dB softer than another its amplitdue will be half that of the louder sound, on an amplitude scale from -1 to +1.

Normalize

The Normalize effect will raise the volume of a sound to its maximum level just short of clipping. You find a scaling factor that when multiplied by each sample brings the maximum amplitude very close to 1.0 and the minimum amplitude very close to -1.0. A Normalized file would be very close to, but should never exceed zero decibels.

Before
Amplified to -6dB

Normalized

Normalize before

Amplify -6 dB

Normalize After

Envelope

You studied envelope functions in Unit 10. An envelope amplifies segments of a sound by varied amounts.

Change Speed

The most common method of changing the speed of a sound is to skip samples or play the same sample more than once. This type of speed change affects the pitch as well as the length of the file. Integer speeds are easy. It gets more complicated when you need to change the pitch to a specific frequency. Here's the Music108 sound played at normal speed, half speed, twice the speed, and three quarter speed.

Speed Procedure Sound Pitch File Length
Normal Speed Play every sample Unable to play MP3 normal 1x
Twice as Slow Play every sample twice Unable to play MP3 one octave lower 2x
Twice as Fast Play every other sample Unable to play MP3 one octave higher 0.5x
0.75 as Fast In Unit 11 labs. Unable to play MP3    

Delay

Delay Lines are frequently used in audio software. The technique originated with tape recorder where the magnetic tape was sometimes run through two tape decks whose play heads were a separated by several inches to several feet. A short delay (distance) "fattened" the sound. A long delay sounded like an echo. Multiple decaying delays could simulate reverberation.

Digital Delay Lines

Sound samples are long lists of numbers representing the amplitude of the sound wave at each sample point. These sequential lists of amplitudes are often called arrays, vectors or lists. This picture represents the first twenty samples of the sound.

diagram of 20 consecutive memeory addresses

By adding zeros at the beginning of the sound, you can delay the start. A ten millisecond delay would add 441 zeros. This picture shows the sound delayed by four samples.

Samples delayed by 4

In Octave, before you can add the delayed samples and the original samples the two vectors have to be of equal length. Either the delayed waveform will need to be truncated, or an equivalent delay will need to be added to the end of the original waveform. This picture illustrates truncation, four zeros were added at the beginning, four samples were chopped off at the end.

Delay four samples

Delay Times

Delay times can be measured in samples, but they're usually measured in milliseconds or seconds. Tempo delays are calculated as a fractions of a beat. Delay times can be categorized as:

Three sound files will be used to illustrate the different delay times. The Violin pizzicato sounds have a sharp attack and almost no sustain. The cello sounds have a smooth attack and long sustain. The third sound is speech. The melody played by the violin and cello is one I created for this example.

Canon melody

Instrument Original Sound
Violin Pizzicato Unable to play MP3
Speech Unable to play MP3
Cello Unable to play MP3

Short Delays

Short delays range from a few samples to a few milliseconds, generally less than 10 ms and are sometimes used to compensate for phase issues in stereo recordings. If two microphones are more than a few inches apart, sounds reach the left and right microphones at different times and can cause phase cancellation. By calculating the distance between the microphones and knowing the speed of sound, you can calculate the number of samples needed to delay one of the signals in order to reduce the phase cancellation problems.

Instrument Delayed Sound - 8 ms
Violin Pizzicato Unable to play MP3
Speech Unable to play MP3
Cello Unable to play MP3

Medium Delays

Medium delays in the rage of 10-50 milliseconds have the effect of "fattening" a signal.

Instrument Delayed Sound - 45 ms
Violin Pizzicato Unable to play MP3
Speech Unable to play MP3
Cello Unable to play MP3

Medium delays in the range of 60-100 milliseconds are sometimes called Slapback echoes.

Instrument Delayed Sound - 80 ms
Violin Pizzicato Unable to play MP3
Speech Unable to play MP3
Cello Unable to play MP3

Long Delays

Delays longer than 100 milliseconds are heard as distinct echoes.

Instrument Delayed Sound - 150 ms
Violin Pizzicato Unable to play MP3
Speech Unable to play MP3
Cello Unable to play MP3

Multitap Delays

This effect is caused by mixing multiple delays at different time intervals.

Tempo Sync Delays

When delays follow the tempo they're known as Tempo Sync Delays. This example was tempo sync'd to the 16th note.

Notes Pattern Sound
12 d12 Unable to play MP3
13 d13 Unable to play MP3
14 d14 Unable to play MP3
123 d123 Unable to play MP3
124 d124 Unable to play MP3
134 d134 Unable to play MP3
234 d234 Unable to play MP3
1234 d1234 Unable to play MP3

Reverb

A form of reverb can be created using multiple delays with each delay decaying exponentially. Here's an example using 6 delays spaced 100 milliseconds apart. The initial gain is around 0.9. Each successive delay 0.9^n.

Instrument Comb Filter Reverb
Violin Pizzicato Unable to play MP3
Speech Unable to play MP3
Cello Unable to play MP3

Rearrangement

Three common methods of rearrangement are reversal, splicing and looping. Reversing the sound on tape was easy, just play the tape backwards. With digital audio you just play the samples in reverse order. Tape splicing involved recording multiple copies of one tape and then cutting the copies into small pieces, rearranging the pieces and splicing them back together to form a new tape. A tape loop could be created by splicing the ends of the tape together so it would play continuously.

Reverse

Here are some sound clips played in reverse. Some sounds are affected more than others.

  Normal Reverse
FM brass Unable to play MP3 Unable to play MP3
Piano Unable to play MP3 Unable to play MP3
FM drums Unable to play MP3 Unable to play MP3
Guitar Unable to play MP3 Unable to play MP3
Saxophone melody Unable to play MP3 Unable to play MP3
Speech Unable to play MP3 Unable to play MP3

Morphing

Morphing is a form of splicing where combine the a attack portion of one sound, the sustain portion of another sound, and apply the release portion of a third sound to create a new sound. This example uses the attack of a guitar, the steady state of a piano, and the release of a violin.

Unable to play MP3

Stutter

Splicing can create a stutter effect by copying small segments of a file and pasting them one or more times to create a different arrangement.

Audacity stutter effect Track 1 Normal Unable to play MP3
Track 2 Slices Unable to play MP3
Track 3 Stutter Unable to play MP3

Looping

When you repeat a sound over and over it's called a sound loop or simply a loop. In this example a single FMdrum sound was copied (looped) four times exactly 44100 samples (one second) apart. That one measure was copied four times to create a four measure loop. The four measure phrase could be looped to create an eight measure phrase, etc. The second track is a copy of the first delayed by one half beat and reduced in amplitude by -6 dB. The third track is a copy of the second delayed by an additional one quarter beat and further reduced in amplitude by -3 dB. Beats 1 and 3 were deleted in track three.

FM drums audacity loop
Unable to play MP3

Zero Crossings

The point where the waveform crosses the X axis is known as a zero crossing point. You want to join file segments together at zero crossing points. Otherwise the discontinuity will create a click.

[Syllabus] [Overview]

Revised John Ellinger, January - September 2013