Sounds PDF
Sounds PDF
Sounds PDF
6:54 PM
Lectures Page 1
Logarithmically?
Its strange, but our hearing works on ratios not
differences, e.g., for pitch.
We hear the difference between 200 Hz and 400 Hz,
as the same as 500 Hz and 1000 Hz
Similarly, 200 Hz to 600 Hz, and 1000 Hz to 3000 Hz
Decibel is a logarithmic
measure
A decibel is a ratio between two intensities: 10 *
log10(I1/I2)
As an absolute measure, its in comparison to
threshold of audibility
0 dB cant be heard.
Normal speech is 60 dB.
A shout is about 80 dB
Lectures Page 2
us the amplitude at an
instant as a number: a
sample
How many samples do we
need?
Nyquist Theorem
We need twice as many samples as the maximum
frequency in order to represent (and recreate, later) the
original sound.
The number of samples recorded per second is the
sampling rate
If we capture 8000 samples per second, the highest
frequency we can capture is 4000 Hz
Thats how phones work
If we capture more than 44,000 samples per second, we
capture everything that we can hear (max 22,000 Hz)
CD quality is 44,100 samples per second
Lectures Page 3
+/- 32K
Each sample can be between -32,768 and 32,767
Sounds as arrays
Samples are just stored one right after the other in the
computers memory
(Like pixels in a picture)
Thats called an array
Its an especially efficient (quickly accessed) memory
structure
Manipulating Sounds
Lectures Page 4
2.
the sound as an array. The array is of object class
SoundSample. Analagous to the Pixel array result
from getPixels() on a Picture.
3. Perform the desired manipulations on the sample(s)
4. Perhaps write the sound back out to a new file.
System.out.println(mysound);
Lectures Page 5