Computer Science 1033A/B Lecture Notes - Audio File Format, Tv Tuner Card, Hertz
8 views6 pages
COMP SCI – WEEK 11
Warm up questions
•which of these will NOT affect the size of the video file?
◦Video size (height and width)
◦type of font used for credits – at this pint, it's just compressing pixels
◦number of frames per second
◦length of video clip
◦all of the above will affect the size
•what is codec?
◦A type of video capture card
◦a piece of software used for compression/decompression of videos and audio
◦a piece of software used to edit video
◦none of the above
Introduction to sound
◦set a mood
◦sell, sell, sell
◦allow communication over the web via Internet audio conferencing
▪allows two-way, full-duplex audio conversations over the web. With Internet
telephoning, you can talk to friends or family without the cost of a long-distance phone
Where can you get sound?
◦purchase a CD – must watch for copyright infringements when using sound on your site
◦download sound from companies
•Create your own sound
◦recording program with a computer's operating system (such as Sound Recorder) and speak
into a microphone attached to the computer – quality will not be the best
◦recording studio with equipment such as DAT (Digital Audio Tape) devices that record
sounds digitally. Produces a high quality commercial product
◦electronic instruments such as synthesizers can be used to create music sound files.
Connecting the instrument to a computer allows the sounds to be captures in an MIDI
(music Instrument Digital Interface) format.
What is sound?
•Sounds are pressure waves of air
•as sound waves hit the ear they vibrate our ear drum
•transmitted by longitudinal waves / compression waves
•visualize the sounds as a series of recurring called waveforms
•Q: which part of the wave indicates the volume of the sound?
•Q: which part of the wave indicates the pitch or frequency?
•voice muscles vibrate and cause the air to move and thus cause sound (a series of waves)
•two people (or one person talking to music) talking causes two sets of overlapping waves. The
overlapping waves actually form a new wave
How do computers represent sound?
•Computer must somehow represent the wave
•Q: what two things does a computer always do when it needs to represent something?
◦Take samples – the more samples, the higher the quality
◦always sample and quantify things
The Nyquist limit
•this rule says you MUST take at least 2 samples for every cycle of the wave. If you take less
than two samples, you will get a completely different sound wave
•Q: what does the Nyquist Limit rule imply about taking samples for higher pitched sounds than
lower pitched sounds?
◦Implies that for higher pitch sounds you must take more samples
•we MUST take 2 or more samples per wave
•Q: what is the advantage of taking lots of samples per wave?
◦Better representation of sound
•Q: what is the disadvantage of taking lots of samples per wave?
◦You're going to get a large file size
•number of samples per second is represented in Hertz (Hz)
•number of 1000 samples per second is represented by KiloHertz (Khz)
•humans can hear between 20 Hz to 20 Khz
•for CD quality, we need 44, 100 samples per second or 44, 100 HZ or 44.1 KHz
•sample rate – number of samples we take per second of audio or number of times per second
the waveform is measured
•it is breaking sound waves into chunks
•typical sounds rates
◦voice only (telephone quality) – 8 Khz
◦AM radio quality – 11.025 Khz
◦FM radio quality – 22 Khz
◦CD quality music – 44.1 Khz
◦one of these was sampled at 8000 Hz (8 Khz) and one at 16000 Hz (16 KHz)
◦Q: which one sounds better?
Quantizing – (aka Sample Size)
•CDs use 16-bit rate (65, 536 possible values could be given to each sample)
•Q: what is the advantage of having a higher bit rate for the sampling size?
◦More bits = better quality
•Q: what is the disadvantage of having a higher but rate for the sample size?
◦Bigger file size
How does the sound wave get converted to be stored on our computer?
•Computers have a sound card which samples (sets the number of sample and quangtizes) the
sound wave from a microphone
•sound card has an Analog-to-Digital Converter (ADC) for recording, and a Digital-to-Analog
Converter (DAC) for playing audio
•operating system (Windows, Mac OS X, Linux, etc.) talks to the sound card to actually handle
the recording and playback
•now we have the sound in the computer, let's edit the sound bit. What can we do to it?
•Rearrange the Waveform
◦cut, copy, drag, trim parts of the waveform
◦overlap two or more piece f audio
◦find words you want to edit out and cut them from the waveform
•Modify the Volume
◦use amplify, fade-in, fade-out, envelope, normalize
▪sometimes songs from CDs play much louder than others , even at the same volume
setting. Normalization corrects this by scanning audio files to find peak or average
levels and proportionally increasing or reducing the levels to obtain the desired volume
▪noise within a given frequency range
▪software examines the audio and finds unusual differences from waveforms and
removes them. Need a longer piece of audio than for Hiss Reduction because software
had to analyze the audio to generate stats on what is unusual
◦adding echo, changing pitch of a portion
•Downsample and reduce the bits depth
◦compress to reduce the file size
Why compress sound?
•An example of uncompressed sound with CD quality for 1 minute of audio?
◦1 minute of recording – 60 seconds
◦60 x 44, 100 samples/seconds = 2, 646, 000 samples
◦2, 646, 000 samples x 16 buts per sample = 42, 336, 000 bits
◦42, 336, 000 bits x 2 (stereo, 2 channels) = 84, 672, 000 bits
◦84, 672, 000 / 8 bits per byte = 10, 884, 100. About 10 MB