|
|
|
|
38
|
|
38
|
|
39
|
## Digital Sound Processing
|
39
|
## Digital Sound Processing
|
40
|
|
40
|
|
41
|
-
|
|
|
42
|
Sounds are vibrations that propagate through elastic media such as air, water, and solids. The sound waves are generated by a sound source, such as the vibrating diaphragm of a stereo speaker [2]. Sound waves consist of areas of high and low pressure called compressions and rarefractions, respectively.
|
41
|
Sounds are vibrations that propagate through elastic media such as air, water, and solids. The sound waves are generated by a sound source, such as the vibrating diaphragm of a stereo speaker [2]. Sound waves consist of areas of high and low pressure called compressions and rarefractions, respectively.
|
43
|
|
42
|
|
44
|
Microphones turn sound waves into electrical signals. These electrical signals can be digitized, i.e. converted to a stream of numbers, where each number is the intensity of the electrical signal at an instant in time. The *sample rate* is the number of samples of a sound signal taken per second. For example, a *sample rate* of 44,100 samples per second is used in CD-quality recordings. This means that every second, for each of the channels (left and right), 44,100 samples of the audio signal are taken and converted to numbers.
|
43
|
Microphones turn sound waves into electrical signals. These electrical signals can be digitized, i.e. converted to a stream of numbers, where each number is the intensity of the electrical signal at an instant in time. The *sample rate* is the number of samples of a sound signal taken per second. For example, a *sample rate* of 44,100 samples per second is used in CD-quality recordings. This means that every second, for each of the channels (left and right), 44,100 samples of the audio signal are taken and converted to numbers.
|
|
|
|
|
65
|
|
64
|
|
66
|
**Digital sound processing** techniques can be used to enhance sound quality by removing noise and echo, to perform data compression, and to improve transmission. Digital sound processing also plays an important role in voice recognition applications and in scientific research such as in biodiversity recognition using sound sensors [4]. Digital sound can also be easily manipulated to produce special effects.
|
65
|
**Digital sound processing** techniques can be used to enhance sound quality by removing noise and echo, to perform data compression, and to improve transmission. Digital sound processing also plays an important role in voice recognition applications and in scientific research such as in biodiversity recognition using sound sensors [4]. Digital sound can also be easily manipulated to produce special effects.
|
67
|
|
66
|
|
68
|
-Since digital sound recordings are in essence, a collection of numeric values that represent a sound wave, digital sound processing can be as simple as applying arithmetic operations over those values. For example, let's say that you are given a digital sound recording. The louder the recording, the higher the absolute values of the numbers that it contains. To decrease the volume of the whole recording we could multiply each value by a positive number smaller than 1.
|
|
|
|
|
67
|
+Since digital sound recordings are in essence, a collection of numeric values that represent a sound wave, digital sound processing can be as simple as applying arithmetic operations over those values. For example, let's say that you are given a digital sound recording; the louder the recording, the higher the absolute values of the numbers that it contains. To decrease the volume of the whole recording we could multiply each value by a positive number smaller than 1.
|
69
|
|
68
|
|
70
|
---
|
69
|
---
|
71
|
|
70
|
|
|
|
|
|
129
|
|
128
|
|
130
|
The `SoundProcessing` project contains the skeleton of an application to process stereo sound. The application you will complete will allow the user to apply four different algorithms to process sound. The sub-directory called `WaveSamples` contains sound files for you to test your implementations.
|
129
|
The `SoundProcessing` project contains the skeleton of an application to process stereo sound. The application you will complete will allow the user to apply four different algorithms to process sound. The sub-directory called `WaveSamples` contains sound files for you to test your implementations.
|
131
|
|
130
|
|
132
|
-### Exercise 1 - Remove vocals on a recording
|
|
|
|
|
131
|
+
|
|
|
132
|
+### Exercise 1 - Remove Vocals on a Recording
|
133
|
|
133
|
|
134
|
A cheap (but many times ineffective) way to remove the vocals from a recording is by taking advantage of the fact that voice is commonly recorded in both left and right channels, while the rest of the instruments may not. If this is the case, then we can remove vocals from a recording by subtracting the left and right channels.
|
134
|
A cheap (but many times ineffective) way to remove the vocals from a recording is by taking advantage of the fact that voice is commonly recorded in both left and right channels, while the rest of the instruments may not. If this is the case, then we can remove vocals from a recording by subtracting the left and right channels.
|
135
|
|
135
|
|
|
|
|
|
172
|
|
172
|
|
173
|
**Algorithm:**
|
173
|
**Algorithm:**
|
174
|
|
174
|
|
175
|
-To apply a fade in to a sound, we multiply successive samples by constantly increasing fractional numbers between `0` and `1`. Multiplying samples by `0` silences them, and multiplying by `1` keeps them the same; multiplying by a factor between `0` and `1` scales their volume by that factor. Both channels of the samples should be multiplied by the same factor.
|
|
|
|
|
175
|
+To apply a fade in to a sound, we multiply successive samples by constantly increasing fractional numbers between `0` and `1`. Multiplying samples by `0` silences them, and multiplying by `1` keeps them the same; multiplying by a factor between `0` and `1` scales their volume by that factor. It's important to mention that both channels of the samples should be multiplied by the same factor.
|
176
|
|
176
|
|
177
|
For instance, if `fade_length` is 4, the filter will be applied to the first 4 samples:
|
177
|
For instance, if `fade_length` is 4, the filter will be applied to the first 4 samples:
|
178
|
|
178
|
|
|
|
|
|
209
|
The multiplicative factors for `fade_out` are the same as for `fade_in`, but are applied in the reverse order. For example, if `fade_length` were `4`, the samples in the fourth-before-last positions would be multiplied by `0.75` (in both channels), the samples in the third-before-last positions would be multiplied by `0.5`, the samples in the penultimate positions would be multiplied by `0.25`, the samples in the final positions would be multiplied by `0.0`.
|
209
|
The multiplicative factors for `fade_out` are the same as for `fade_in`, but are applied in the reverse order. For example, if `fade_length` were `4`, the samples in the fourth-before-last positions would be multiplied by `0.75` (in both channels), the samples in the third-before-last positions would be multiplied by `0.5`, the samples in the penultimate positions would be multiplied by `0.25`, the samples in the final positions would be multiplied by `0.0`.
|
210
|
|
210
|
|
211
|
|
211
|
|
212
|
-### Exercise 4 - Panning from left to right
|
|
|
|
|
212
|
+### Exercise 4 - Panning from Left to Right
|
213
|
|
213
|
|
214
|
The sound effect we want to produce in this exercise is to start hearing sound from the left channel, then fading from that channel, intensifying in the right channel, and ending up completely on the right channel.
|
214
|
The sound effect we want to produce in this exercise is to start hearing sound from the left channel, then fading from that channel, intensifying in the right channel, and ending up completely on the right channel.
|
215
|
|
215
|
|
|
|
|
|
259
|
|
259
|
|
260
|
[6] http://www.hearingreview.com/2013/03/designing-hearing-aid-technology-to-support-benefits-in-demanding-situations-part-1/
|
260
|
[6] http://www.hearingreview.com/2013/03/designing-hearing-aid-technology-to-support-benefits-in-demanding-situations-part-1/
|
261
|
|
261
|
|
262
|
-[7] http://diveintodotnet.com/2014/12/02/programming-basics-what-are-strings/
|
|
|
|
|
262
|
+[7] http://diveintodotnet.com/2014/12/02/programming-basics-what-are-strings/
|