Uploaded by manosha.kabbary

lecture6 file size and quality

advertisement
BASICS OF AUDIO FILTERS
What is an audio filter?


This helps eliminate the unwanted noise from the
audio signal and improves the tone of the output
audio.
The audio filters are the electronic circuits designed
to amplify a certain range of frequency
components.
terms are frequently used in context to the audio filters

a cutoff frequency is a boundary in a system's frequency
response at which energy flowing through the system begins to
be reduced rather than passing through.
terms are frequently used in context to the audio filters
1) Bandwidth –
 This is the range of frequencies allowed to
pass by the filter.
 The bandwidth can be defined as the
difference in upper and lower cut-off
frequency.
 Sometimes it is also known as Pass Band
Bandwidth.
 The bandwidth determines the frequency
response of the filter within the set range of
frequencies.
Filters types


Based on the frequency band allowed to pass by
the filters, they are categorized as follows:
1) Highpass Filter
2) Lowpass Filter
3) Bandpass Filter
4) Bandstop Filter
5) Notch Filter
Highpass Filter

This filter passes all the frequencies above its cutoff frequency and blocks all the frequencies below
the cut-off frequency.

For the RC network shown, the cut off frequency is
related to the resistor and capacitor as follows:
fh = 1/ (2πRC)
Example:


Find the value of the capacitor for a high pass filter, whose cutoff
frequency is at 2KHz. Assume the resistor R is 10 KΩ.
As we know that the cutoff frequency is given by;
Lowpass Filter

This filter passes all the frequencies below its cut-off
frequency and blocks the frequencies above it. The
frequency response of a lowpass filter is as follows:
Bandpass Filter


This filter only passes a band of frequencies in its cut-off
frequency range.
The bandpass filter has two cut-off frequencies, one is lower
cut off, and another one is upper cut off frequency.
Bandstop Filter


A bandstop filter passes all the frequencies except a
specific range of frequencies.
It passes all the frequencies below its lower cut-off and
all the frequencies above its higher cut-off but not
frequencies ranging between lower and higher cut-off.
The higher cut-off and lower cut-off frequencies are
deviations of a center frequency for which the gain of
the filter circuit is ideally zero (practically minimum).
Notch Filter

– A notch filter is a bandstop filter with a very
narrow stopband. Due to the very narrow stopband,
these filters have a very high Quality Factor.
True or false

If the cut-off frequency will be 160 Hz
approximately. The above highpass filter will pass
all the frequencies above 160 Hz and reduce the
frequencies below it.
Choose

The filter allows all the frequencies below the cutoff frequency to pass but reduces the frequencies
above the cut-off frequency.
A.
B.
C.
D.
Highpass filter
Lowpass filter
Bandpass filter
Stopband filter
The type of filter is----A.
B.
C.
D.
Highpass filter
Lowpass filter
Bandpass filter
Stopband filter
At lower frequency in HPF, the circuit is ____?
A.
B.
C.
D.
Open Circuited
Short Circuited
Break downed
None of the above
QUALITY VERSUS FILE SIZE
Audio file format
19

Sampling rate


Bit depth


Describes the resolution of the audio data
Channels


Number of sample taken of a signal in a given time (usually one second)
E.g. Stereo has two channels
Duration

Measured per second
Sampling rate
20




The more sample taken per second, the higher the accuracy.
Typically measured in kilohertz (KHz).
CD audio has 44,100 samples per second (44.1KHz).
8 KHz produces lower quality radio sound.
Sampling rate = 2*f max; f : Frequency. Nyquist Rule
For Human sound : 22,050Hz
We take 2* 22,050 = 44,100 sample/sec
Bit depth
21




Also called “sampling resolution” or “word
length”.
The more bits, the better is the quality of the
audio (and a larger file of course).
Common bit depths are 8-bit (telephone like),
16-bit (CD quality), and 20, 24, 32, 48-bit
depths.
Quantization
It is better to use a larger number of bits for each quantization interval. For instance,
when 16 bits are used, the number of bands/quantization intervals is 216 = 65,536.
Thus less poor than 8-bit samples. 16-bit sampling is in fact the norm for sound
digitization.
Channels
22

Audio file can support one to six channels of audio formats.

Mono – one channel
Stereo – two channels
Some others – three, four channels.

More multi-channel formats announce in the coming years.


Channel:
Mono vs. stereo:
• Mono describes a system where all the audio signals are mixed
together and routed through a single audio channel.
• Stereo sound systems have two independent audio channels, and the
signals are reproduced by two channels separated by some distance.
• The two sound channels give the illusion that the sound is coming from a
certain location.
• However, going to mono will reduce the file size by half. Sometimes
a well- designed mono system is better than a low quality stereo system.
The difference between mono and stereo?
Duration
25

recording duration seconds
Quality versus File Size
26

The size of a digital recording depends on the sampling
rate, resolution and number of channels.
S = R  (b/8)  C  D





S file size bytes
R sampling rate (samples / second)
b resolution bits
C channels 1 - mono, 2 - stereo
D recording duration seconds
Introduction to Multimedia
Quality versus File Size
27


Higher sampling rate, higher resolution gives higher quality but bigger file
size.
For example, if we record 10 seconds of stereo music with sampling rate
44.1kHz, 16 bits, the size will be:
S = 44100  (16/8)  2  10
= 1,764,000 bytes
= 1722.7 Kbytes
= 1.68 Mbytes
High quality sound files are very big, however, the file size can be reduced by
compression.
Introduction to Multimedia
28
Exercises
Introduction to Multimedia
Introduction to Multimedia
Computer Music MIDI
32
Computer Music (MIDI)
33



Sound waves, whether occurred natural or man-made, are
often very complex, i.e., they consist of many frequencies.
Digital sound is relatively straight forward to record complex
sound. However, it is quite difficult to generate (or synthesize)
complex sound.
There is a better way to generate high quality music. This is
known as MIDI — Musical Instrument Digital Interface.
Introduction to Multimedia
Computer Music (MIDI)
35



It is a communication standard developed in the early
1980s for electronic instruments and computers.
It specifies the hardware connection between
equipments as well as the format in which the data are
transferred between the equipments.
Common MIDI devices
synthesizers, modules.
include
Introduction to Multimedia
electronic
music
MIDI Hardware
36

An electronic musical instrument or a computer which has
MIDI interface should has one or more MIDI ports. The MIDI
ports on musical instruments are usually labeled with:




IN — for receiving MIDI data;
OUT — for outputting MIDI data that are generated by the
instrument;
THRU — for passing MIDI data coming from IN to the next
instrument.
MIDI devices can be daisy-chained together.
Introduction to Multimedia
MIDI Hardware
37
Introduction to Multimedia
Multi-port MIDI Interface (2 in/out pairs)
OUT
A B
Lights!
Thru switch – connects In to Out,
for use without a computer
Leave in ‘out’ position!
39
Introduction to Multimedia
A
IN
B
USB port
Multi-port MIDI Interface (8 in/out pairs)
Front
MIDI Outputs
MIDI Inputs
Back
USB port
40
Introduction to Multimedia
41
Introduction to Multimedia
MIDI Data
42



Unlike digital sound, MIDI data does not encode individual
samples. MIDI data encode musical events and commands to
control instruments.
MIDI data are grouped into MIDI messages. Each MIDI
message represents a musical event, e.g., pressing a key,
setting a switch or adjusting foot pedals.
A sequence of MIDI messages is grouped into a track.
Introduction to Multimedia
MIDI music
43
Musical instruments are tuned to produce a set of fixed pitches.

Octave
(0.125)
Introduction to Multimedia
Octave
44


For example, any two sounds whose frequencies make a 2:1 ratio are
said to be separated by an octave and result in a particularly
pleasing sound when heard.
Similarly two sounds with a frequency ratio of 5:4 are said to be
separated by an interval of a third; such sound waves also sound
good when played together.
Interval
Frequency Ratio
Examples
Octave
2:1
512 Hz and 256 Hz
Third
Fourth
Fifth
5:4
4:3
3:2
320 Hz and 256 Hz
342 Hz and 256 Hz
384 Hz and 256 Hz
Introduction to Multimedia
MIDI File
46
Music produced by musical instruments can be stored as codes since
it produces discrete number of sounds (no. of keys).
 For a piano of 12 sounds (12 keys):
- Code 0-11 (position of a key) : 1 byte
- Octave 0-7 (principle sounds): 1 byte
- Duration of using a key: 1 byte
For a key press it needs 3 bytes.

For 20 press/sec: 20 press * 3 bytes/press = 60 bytes/sec
Introduction to Multimedia
MIDI versus digital audio
47
Introduction to Multimedia

You have 30 seconds audio file sampled at a rate
of 44.1 KHz and quantized using 8 bits ; calculate
the bit rate and the size of mono and stereo
versions of this file
Download