Download presentation
Presentation is loading. Please wait.
Published byBasil Robbins Modified over 9 years ago
1
Digital Audio II
2
Volume Scaling The volume of a digitized audio source may be increased or decreased by multiplying each sample value by an appropriate constant. This process is also known as applying a "gain" to the audio. A scale factor of 1.5 will increase the waveform amplitude or volume by 50%. A scale factor of 0.25 will reduce the waveform amplitude or volume to 25% of its original value. The pseudo code for the volume scaling effect is given below. For i = 1 to NumSamples Result[i] = Samples[i] * scaleFactor
3
Mixing Two waveforms can be "mixed" together by adding corresponding samples of each source waveform. It may sometimes be necessary to clamp the result values to lie within the dynamic audio range represented by the 8 or 16 bit sample values. For i = 1 to NumSamples// Assume both waveforms have same number of samples Result[i] = Samples1[i] + Samples2[i]
4
Example of mixing two audio waveforms
5
Echo An echo is a delayed and volume reduced copy of the original sound mixed with the original sound. Assume sound travels at a speed of 340 meters per second. To simulate the effect of sound bouncing off a wall 20 meters away, the sound travels 20 + 20 meters over a duration of 0.117 seconds (40 m / 340 m per second). If audio is processed at 11,000 samples per second, then the delay factor in number of samples is 0.117*11,000 = 1,287. By convention, the first n samples remain unchanged since no preceding samples are available. The resulting audio data will be n samples longer due to the echo.
6
For i = 1 to NumSamples+n if (i < n) Result[i] = Samples[i] else if (i >= n) and (i <= NumSamples) Result[i] = Samples[i] + scaleFactor*Samples[i – n] else Result[i] = scaleFactor*Samples[i-n]
7
Reverberation Reverberation is the combination of multiple echo effects, from different distances and with different attenuation factors. Reverb simulates the effect of multiple echoes caused by sound bouncing back and forth within an enclosed space. After each subsequent bounce, the echo produced will have a further reduction in volume and additional delay. Generally, reverberation in a small room decays much faster than reverberation in a large room, because in a small room the sound waves collide with walls much more frequently, and thus are absorbed more quickly, than in a large room.
8
Example, Result[i] = 0.7*Samples[i] + 0.25*Samples[i- 1000] + 0.20*Samples[i-2000] + 0.15*Samples[i-3000] Care must be taken to avoid exceeding the dynamic range, 0..255 for 8-bit samples, by keeping the sum of the scale factors near 1.0 or less.
9
Distortion Distortion is the modification of an original sound. Thus, any audio effect qualifies as "distortion." Outside of this definition, "distortion" is often the collection of audio effects associated with modifying a sound's amplitude without the use of any temporal information. Because no temporal information is needed for distortion, each audio sample can be independently modified.
10
Distortion can be used to simulate the effects of an amplifier that is overdriven, and is frequently used with guitars. The "distorted" signal is identical to the original signal, unless it exceeds the "distortion threshold." When the signal exceeds the distortion threshold, it is changed to the "clamping level." For example: suppose we had a distortion threshold of 10 and a clamping level of 20. Any signal that reaches 10 or more units from equilibrium is converted to a signal of level 20
11
Distortion of an Audio Wave
12
Another form of distortion is called "noise gating. " A noise gate ignores all parts of a waveform below a specified threshold. This allows only louder sounds, or parts of sounds, to pass through the distortion unit. Softer sounds would be suppressed completely. An interesting effect is produced for sounds with waveforms that frequently cross the noise gate's threshold.
13
Noise-Gate Processing of an Audio Wave
14
Donald Duck Effect Create a fast and high-pitched effect by simply redefining the sampling rate. This effect does not change any sample data, but merely causes the audio playback to play the audio data at a faster sampling rate.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.