Types of Audio Effects


In general, audio effects fit into three categories, or domains :

  • Time

  • Frequency

  • Amplitude

Time Domain Effects

Time-domain effects simulate the reflections that occur when sound waves strike surfaces in the physical world. If you have ever shouted into a canyon and heard your own voice echo back to you some seconds later, you have experienced a very obvious, time-domain effect. However, many of the reflections that you hear from day to day are not as obvious or discrete as the canyon echo. When you have a conversation with a colleague in an office, many reflections occur as your voices careen off the various surfaces in the room. Because the distances between these surfaces (the walls, the desk, the floor) tend to be relatively short, you don t perceive the reflected sounds as echoes. Nevertheless, these reflections are short, attenuated echoes that combine to color your perception of your colleague s voice, and to provide your brain with subtle cues about the size and composition of the space around you.

Now, imagine having the same conversation in a school gymnasium. In this space, some of the surfaces are fairly close to you, such as the floor. Others, like the walls, are farther away (although not nearly as far as the opposite wall of a canyon). As you speak, the sound waves produced by your voice create short echoes that you hear almost immediately. The sound waves also create a large number of longer echoes that occur over different periods of time. The paths followed by these sound waves occur rather randomly as the sound reflects first off a nearby wall, then the ceiling, then off another wall, and finally, off the floor before reaching your ear. As some of these multiple reflective paths cause sound waves to reach your listening position at various intervals, you experience the time domain effect called reverberation , or reverb . If you closed your eyes, you certainly could guess that you were no longer standing in an office, and you could probably estimate the size and composition of the space.

You can use digital algorithms to recreate real-world, time domain effects, like those that occur in canyons, offices, and gymnasiums. You can also use digital technology to create effects that don t occur naturally.

DirectSound provides the following time-domain audio-effect algorithms to create special effects:

  • Echo

  • Reverb

  • Chorus

  • Flanger

Frequency Domain Effects

Sound waves occur in a periodic manner. The number of times that one cycle of a wave repeats during a given time interval is called the frequency of the wave. For sound waves, frequency is measured in cycles per second, or hertz (Hz).

Sound frequency is analogous to pitch; the higher the frequency, the higher the perceived pitch. The generally accepted range for audible frequencies is from 20 Hz to 20,000 Hz (20 kHz).

Complex sound waveforms, like the human voice or a piano note, are actually composed of a fundamental sine wave and a number of additional sine waves, called harmonics. The fundamental and the harmonics each occur at different frequencies, with the harmonics occurring at successively higher multiples of the fundamental frequency. When you hear a note played on a piano, the pitch that you perceive for the note is the pitch of the fundamental frequency. It is the combination of the fundamental and the harmonics that give the piano its unique character, or timbre .

Figure 5.1 shows an example of output from a spectrum analyzer, which shows the amplitude of a signal at various frequencies. In the figure, you can see the amplitude of the fundamental tone, followed by the amplitudes of six harmonic tones.

start sidebar
Spectrum Analyzers

Spectrum analyzers for audio come in a variety of forms. Analog spectrum analyzers use a series of electronic filters to isolate the various frequency bands to be measured. Digital spectrum analyzers use a digital algorithm called a fast Fourier transform, or FFT. FFT algorithms take advantage of Fourier s Theorem (after Baron Jean Baptiste Joseph Fourier). Simply put, Fourier s Theorem states that a complex waveform can be represented by a series of sine and cosine waves. FFT algorithms recursively devolve a complex waveform into its component waves, and then output the amplitude for each frequency.

Spectrum analyzers are available as hardware devices, software programs, and as combination hardware/software packages. Some audio-editing software includes spectrum analysis as a feature.

Windows Media Player uses an FFT algorithm to provide amplitude and frequency data for visualization code. You can see two different views of spectrum analysis by watching the visualizations named Bars and Scope that come with Windows Media Player 9 Series. You can inspect the code for these two visualizations by creating a sample visualization project using the Windows Media Player plug-in wizard, which is a feature of the Windows Media Player 9 Series SDK.

end sidebar
 
click to expand
Figure 5.1: Spectrum analysis showing a fundamental tone and its harmonics.

Frequency domain effects change the relationship between the various components of a complex waveform by changing the amplitude within a given frequency range. This process is commonly called equalization , and the devices (real or virtual) that create this effect are called equalizers. The most common equalizers are the bass and treble controls that can be found on most home stereo equipment. DirectSound provides one frequency domain effect, ParamEq, to enable you to apply equalization to your sound.

Amplitude Domain Effects

Amplitude domain effects process sound volume. The unit of measurement for sound volume is the decibel (dB). The decibel represents the logarithm of a ratio, usually a power ratio or a voltage ratio. By itself, the decibel has little meaning; it is meaningful only when referenced to some standard level. Therefore, it is not useful to say, The volume of the sound is 85 dB, unless it is understood to mean that the sound is 85 dB louder than the threshold of hearing. It is useful, and common, to use positive values to refer to volume increases above some reference level, and to use negative values to refer to volume decreases below the reference. Therefore, it is useful to say, The threshold level is set at -50 dB, if, for instance, it is understood to mean that the threshold is 50 dB below some predetermined level, like digital full scale .

The range of possible volumes that can be represented by a given system, analog or digital, is called the dynamic range . For digital systems, each doubling of the level yields a 6 dB increase in volume. Conversely, each halving of the level yields a 6 dB decrease in volume. Given that each binary digit corresponds to a doubling of available values, a 16-bit representation of audio can effectively represent a 96 dB dynamic range (16 x 6 = 96). A particular sound or soundtrack can have its own dynamic range as well, which clearly must be less than or equal to the available dynamic range of the system. Figure 5.2 shows the relationship between the dynamic ranges of human hearing and 16-bit digital audio.

click to expand
Figure 5.2: Dynamic range of human hearing compared to 16-bit digital audio.

Amplitude domain effects give you the means to manipulate the dynamic range of your audio content.

DirectSound provides the following amplitude domain effects:

  • Gargle

  • Distortion

  • Compressor




Fundamentals of Audio and Video Programming for Games
Fundamentals of Audio and Video Programming for Games (Pro-Developer)
ISBN: 073561945X
EAN: 2147483647
Year: 2003
Pages: 120

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net