Audio Sampling - PowerPoint PPT Presentation

1 / 58
About This Presentation
Title:

Audio Sampling

Description:

The unit of measure for signal rate is baud ... signal transmission rate (baud rate) can be related to the data rate. We have to know the baud rate (signals per ... – PowerPoint PPT presentation

Number of Views:28
Avg rating:3.0/5.0
Slides: 59
Provided by: McMor6
Category:
Tags: audio | baud | sampling

less

Transcript and Presenter's Notes

Title: Audio Sampling


1
Audio Sampling
  • Read Chapter 11 in text book!
  • Chapter 3 of optional text has excellent material
    that complements the required text
  • Chapter 10 of text provides some additional
    information you may find useful (In other words,
    read the chapter)
  • We will cover in some detail exactly how
    continuously variable (analog) signals become
    digital (discrete) binary code

2
Background
  • Audio signal (sound) reflects the motion of air
    particles in space
  • Microphone converts this motion of air particles
    into an electrical signal
  • Audio signals have frequency components that are
    complex
  • In other words, most audio signals are made up of
    many different frequencies, combining to make the
    sound we recognize (I just saved you from Fourier)

3
Audio Signal
  • Audio signals have certain characteristics that
    are well known
  • Human voice varies from about 100 Hz to 4000 Hz
  • Piano Concert A above Middle C is 440 Hz
  • Hertz (Hz) means cycles per second
  • Sound varies in a manner similar to a Sine Wave
  • Concert A varies 440 times per second
  • My voice sounds different than a pianoWhy?

4
Audio Signal Components
Concert A on a vibraphone
5
Voice Signal Components
6
More information
  • Bandwidth
  • Is often represented by the highest frequency
    signal in a sample. But in common usage is used
    to describe the data rate a channel supports
  • Can be thought of as the range of frequencies
    some transmission medium (air, water, cable,
    fiber optics) can support
  • Concert A has a bandwidth of 440 Hz
  • A human voice has a varying bandwidthbut we said
    that we well know that the average humans
    highest frequency component is 3000 Hz
    (3kHz)What is the bandwidth?

7
Periods Signal and Sampling
  • Take the 440 Hz Concert Ahow long is one cycle?
  • Ts 1/fs ? Ts 1/440 Hz 0.00227 sec
  • Also fs 1/Ts ? fs 1/ 0.00227 sec 440 Hz
  • In English The Time period of one cycle is equal
    to the inverse of the frequency of the signal in
    Hz
  • Problem now is that the Concert A is a
    continuously variable signal, and we want to
    digitize it
  • How often should we sample the signal?

8
Nyquist
  • Harry Nyquist, working at Bell Labs (youve heard
    that before, havent you?) developed what has
    become known as the Nyquist Sampling Theorem
  • In order to be perfectly represented by its
    samples, a signal must be sampled at a sampling
    rate equal to at least twice its highest
    frequency component
  • Or fs 2f ? Also represented as fs 2B Hz
    where B is bandlimited to a highest frequency
  • Note that fs here is frequency of sampling, not
    the frequency of the sample

9
For Example
  • Take Concert A 440 Hz
  • What would be the minimum sampling rate needed to
    accurately capture this signal?
  • Plug and chug fs 2 x 440 Hz 880 Hz
  • Take your telephone ? used for voice, mostly
  • Highest voice component is 3000 Hz
  • Minimum sampling rate fs 2 x 3000 Hz 6000 Hz
  • Bell Labs built in some slop ? real telephone
    digitization is done at 8000 Hz sampling rate
    (supporting a 4 kHz bandwidth). Why? Remember
    that Nyquist said equal to at least twice

10
Example Speech Waveform
11
Sharp Check
  • Some of you might be wondering The telephone
    line can support 4 kHz of bandwidth? It sounds
    like something is fishy since I can use a 56 kbps
    modem on that line.
  • Stay tuned for Shannons Law
  • Modulation schemes

12
Nyquists Revenge
  • If you oversample (exceed the Nyquist rate), we
    create more bits to store and to transmit than is
    necessary to accurately send the signal to the
    distant end
  • But, moderate oversampling can work to our
    advantage, making the system more robust and
    easier to implement ? Thats why Bell Labs
    decided to sample at 8 kHz vice 6 kHz

13
Nyquists Revenge, Cont
  • If you undersample (sample at less than the
    Nyquist rate), you run the danger of aliasing
  • Aliasing is when the signal you decode is not the
    signal you encoded
  • Aliasing then, is bad!

14
UndersamplingA Very Bad Thing
Thanks to http//euphoria.org/home/help/nyquist.h
tml
15
Quantization
  • Read Chapters 12 and 14 in text book!
  • Chapter 3 of optional text has excellent material
    that complements the required text
  • Chapter 10 of text provides some additional
    information you may find useful (In other words,
    read the chapter)
  • We will cover in some detail exactly how
    continuously variable (analog) signals become
    digital (discrete) binary code

16
Quantization
  • Audio Signals Continuous in time and amplitude
  • Digitization of Audio Signals Must be made
    discrete in time and amplitude
  • Weve learned how to make Continuous signals
    discrete in Time Sampling (Dont forget about
    Nyquist!)
  • To make Continuous signals discrete in Amplitude,
    we Quantize

17
What is Quantization?
  • Quantization establishes a range of values of the
    continuous function that we say can be
    represented by a particular binary code
  • Looking at it another way We round things off
  • For example We can say that the continuous
    temperature range 40.0 to 40.1 degrees F can be
    represented by one binary code (lets just say
    0110010000)--The temperature obviously can vary
    over 40.0 to 40.1 (temp might actually be
    40.00987 degrees), but we say that measuring to
    within a tenth of a degree is OK

18
Picking the Code
  • We have a trade-off to make (recurring theme)
  • Number of bits we want to use versus precision of
    digitization (What does that mean?)
  • Go back to when you were Thermometer Engineers
    We want to measure -40º F to 140º F (over 180º F)
  • We decided to implement an 8 bit code at first
  • If we use all the bits, what degree of precision
    do we achieve?

19
Precision of Quantization
  • 8 bit code can represent 256 codewords
  • Our thermometer can measure to
  • (Range of Measurement)/Number of Codewords
  • Or 180º F/256 Codewords 0.703º F per codeword
  • The text on p. 174 uses an example of sampling a
    voltage that ranges from -10V to 10V
  • The range measured is over 20V, encoded with 4
    bits
  • Or 20V/16 Codewords 1.25V per codeword
  • For the text example, lets look at the
    Quantization Codetable

20
A Time Quantized Audio Waveform
21
Problems with Quantization
  • Some information is lost
  • Error is introduced (Noise is introduced)
  • Codetable on p. 174 uses the Range Center as the
    value of quantization to minimize both effects
    (Noise and Error)

22
Problems with Quantization Cont.
  • Difference between the actual value of signal and
    the quantized value is the Quantization Error
  • In book example Say actual voltage value when
    sampled (a point in time) is 8.5V
  • Error is 8.5V - 8.125V 0.375V
  • Another example Actual voltage is 7.75V
  • Error is 7.75V - 8.125V -0.375V

23
Quantizing and Re-Constructing the Signal
  • Analog-to-Digital Converter (ADC) provides the
    sampled and quantized binary code
  • Digital-to-Analog Converter (DAC) converts the
    quantized binary code back into an approximation
    of the analog signal by clocking the code to the
    same sample rate as the ADC conversion
  • Quantize and Reconstruct the analog signal
    Example on the next couple of slides

24
Quantizing
25
Reconstructing
26
Another Example
27
Things we can do to improve Quantizing performance
  • Use Companding
  • Quantization levels are non-uniform
  • Levels are close where we expect most signals to
    fall, and farther apart where we expect them less
    often
  • Instead of Quantizing entire range, we can
    quantize just the difference in level from the
    last sample

28
Data Rate, Decibels, Signal-to-Noise Ratio,
Channel Capacity (Shannons Law)
  • You really should read the sections of Chapter 8
    of the optional textbook
  • Nyquist is only part of the equation when you are
    developing a digital transmission system
  • Nyquist tells you how often you should sample,
    but not how much information a channel (a medium
    through which data moves) can support
  • Hang on, this one covers a lot of ground!

29
Little Background on Data Rate
  • There is a difference between signal rate and
    data rate
  • The unit of measure for signal rate is baud
  • The unit of measure for data rate is bits per
    second
  • The difference? A signal rate is equal to the
    number of signal events in a period of time.
  • One bit per signal event--baud rate and bit rate
    are the same!
  • More than one bit per signal event--bit rate
    exceeds baud rate!
  • Dont believe me? Lets go to the next two charts

30
One Bit per Signal Event
Amplitude (V)
1 -- V1
Why arent the vertical lines vertical?
How many signal events here and here?
0 -- V0
time
One signal event--one bit sent per signal event
31
Signal Events with More than One Bit
Amplitude (V)
111 -- V7
110 -- V6
101 -- V5
100 -- V4
011 -- V3
010 -- V2
001 -- V1
000 -- V0
time
One signal event--three bits sent per signal event
32
Channel Noise and Decoding
Little noise decoding with M8 More noise
results in error The same amount of noise but
decoding with M2
33
Relating Baud to Data Rate
  • The signal transmission rate (baud rate) can be
    related to the data rate
  • We have to know the baud rate (signals per
    second)
  • We have to know how many bits are being sent per
    signal event, then know how many symbols this
    number of bits can take on (optional text refers
    to this as M-ary transmission--more in the
    modulation lecture)
  • We have to know how to take log2 of a value
  • log2 of x is log10 x/log10 2 (shortcut if power
    of 2, equal to number of bits needed to encode a
    number of symbols)
  • We have to know D R log2 M bps
  • Where D is data rate, R is baud rate and M is
    number of symbols per signal event

34
For Example
  • A system signals at 1 baud, 1 bit per signal
    event (2 symbols per event)
  • D R log2 M bps --gt D 1 log2 2 bps 1
    bps
  • A system signals at 75 baud, 8 bits per signal
    event (256 symbols per event)
  • D R log2 M bps --gt D 75 log2 256 bps
    600 bps
  • A system signals at 4000 baud, 8 bits per signal
    event (256 symbols per event)
  • D R log2 M bps --gt D 4000 log2 256 bps
    32000 bps
  • But a semaphore signaler signals at 2 baud (each
    signal could represent 26 symbols)
  • D R log2 M bps --gt D 2 log2 26 bps 9.4
    bps

35
Decibels
  • Whats a decibel?
  • In electronics and communications, the decibel
    (abbreviated as dB) is a logarithmic expression
    of the ratio between two signal power, voltage,
    or current levels. In acoustics, the decibel is
    used as an absolute indicator of sound power per
    unit area. A decibel is one-tenth of a Bel, a
    seldom-used unit named for Alexander Graham Bell,
    inventor of the telephone (What is)
  • Power (unit of measurement watts (W))
  • dB 10 log P2/P1
  • Voltage or Amperage
  • dB 20 log V2/V1
  • dB 20 log A2/A1

Important! Note that dB are log base 10, not base
2!
36
For Example
  • You want to express in dB the power relationship
    between your stereo and the TV (roommate fight)
  • Stereo has 200W of power, TV has 50W of power
  • dBW 10 log 200/50 6.02 dBW
  • Stereo wins this battle
  • Note the other way-- Roomies TV has 50W, Stereo
    200W
  • dBW 10 log 50/200 -6.02 dBW
  • Roomies TV loses the battle

37
Signal-to-Noise Ratio
  • S/N is normally measured in dB, as a relationship
    between the signal you want versus the noise that
    you dont but is in the medium (to include your
    radioheat causes noiseever notice that your
    radio warms up when it is on?)
  • It can be thought of as a fractional relationship
    (that is, before you take the log of it)
  • 1000W of power v. 20W of noise is either
  • 50 (unitless!)
  • or about 17 dBW gt 10 log 1000/20 16.9897 dBW

38
Shannons Law(Shannons Limit for Information
Capacity)
  • Claude Shannon at Bell Labs (where else?) figured
    out how much information a channel could
    theoretically carry
  • I B log2 (1 S/N)
  • Where I is Information Capacity in bps
  • B is bandwidth in Hz
  • S/N is Signal-to-Noise ratio (unitlessdont make
    into dB)

Note we are back to log base 2!
39
Shannon in Action
  • You have a telephone system with a 3 kHz
    bandwidth and a S/N ratio of 1000 (very good
    indeed!)
  • I B log2 (1 S/N) --gt I 3000 Hz log2 (1
    1000) I 3000 Hz log2 1001 --gt 29902 bps
    (29.9 kbps)
  • You have a telephone system with a 3 kHz
    bandwidth and a S/N ratio of 10 (very bad!)
  • I B log2 (1 S/N) --gt I 3000 log2 (1 10)
    I 3000 log2 (11) --gt 10378 bps
    (10.4 kbps)

40
Shannons Law Caveats
  • In order to achieve the theoretical Shannon
    limit, the transmission system is not binary, it
    is some form of M-ary (i.e. more than one bit is
    sent per signal event)
  • You see that in order to increase capacity, you
    must either increase the bandwidth of the channel
    or increase the S/N ratio (make the signal
    stronger or reduce the noise on the channel)

41
Modulation
  • Re-read Section 14.7 of the text
  • Modulation is process of impressing a
    low-frequency information signal onto a higher
    frequency carrier signal
  • Modulation is done to bring information signals
    up to the Radio Frequency (or higher) signal
  • Some systems even have two stage modulation,
    where the information is brought up to an
    Intermediate Frequency (IF), and then increased
    to the transmission frequency

42
Some Definitions
  • Baseband Signal is a term used to describe the
    unmodulated signalor in other words, the
    information signal
  • Carrier Signal is what the information signal is
    combined with to form the new modulated
    signalthe frequency of the carrier is described
    as the center frequency of the signal
  • BOTH the baseband and carrier have
    bandwidth--that matters for AM, but not for FM/PM
    modulated bandwidth

43
Types of Analog or Traditional Modulation
  • Amplitude Modulation (AM)
  • Information signal is added and subtracted to and
    from a carrier signal
  • Frequency Modulation (FM)
  • Information signal varies a constant amplitude
    carrier signals frequency directly in proportion
    to the informations frequency
  • Phase Modulation (PM)
  • Information signal varies a constant amplitude
    carrier signals phase directly in proportion to
    the informations frequency
  • Both FM and PM are forms of Angle Modulation

44
Amplitude Modulation
Carrier
Baseband
Modulated
45
AM Continued
  • Note that my diagram is highly out of scale
  • Carrier Signal is centered on one frequency, and
    has a bandwidth (like 1000 kHz, 5 kHz)
  • Baseband Signal varies from 0 -- some value Hz
    (human voice 0 -- 4 kHz)
  • AM naturally has two sidebands, but only one
    sideband is needed to get back all the
    information
  • Two bands? 1000 kHz 3 kHz 997 kHz and 1003
    kHz
  • Figure 14.14 shows this in another way

46
AM Modulation and AM Channels
47
Frequency Modulation
48
FM Continued
  • Same scale issues on diagram
  • FM is constant amplitude--another way of thinking
    about it FM always has the same bandwidth
  • FM signal varies around the maximum and minimum
    deviations of the baseband signal
  • Modulated signal is more compressed around the
    maximum deviationmore spread out around the
    minimum deviation
  • In other words, the variance of the frequency of
    the constant amplitude carrier is directly
    proportional to the amplitude of the modulating
    signal at a rate equal to the frequency of the
    modulating signal

49
FM Modulation and FM Channels
50
Phase Modulation
  • We wont show
  • It differs from FM in the time domain, given the
    same baseband and carrier signals, but is
    otherwise identical

51
Digital Modulation (Some of them, anyway)
  • Frequency Shift Key (FSK)
  • Binary Phase Shift Key (BPSK)
  • Quadrature Phase Shift Key (QPSK)
  • 8-PSK
  • Offset QPSK (OQPSK)
  • Quadrature Amplitude Modulation (QAM)
  • Pulse Code Modulation (PCM)
  • And we didnt cover optical--thats later

52
Frequency Shift Key
  • Similar to FM
  • A low frequency for a time means 0
  • A high frequency for a time means 1
  • Derived from TTY days Shift and Mark

0 1 0 1
0 0 1 1
53
Phase Shift Key
  • Phase Shift Key depends on being able to
    differentiate the angle of the signal (and this
    depends on how many states you are trying to
    represent)--but is constant amplitude
  • BPSK is binary Two states (one bit per signal
    event), so the difference in angle is 180º
  • QPSK has four states (two bits per signal event),
    so the difference in angle is 90º

54
QAM
  • Similar to PSK, but throw in amplitude as well
    (not a constant amplitude signal)
  • Normally represented by a truth table and a
    constellation diagram

55
8-QAM Truth Table and Constellation
  • Code A (V) Phase
  • 000 .765V -135
  • 001 1.848V -135
  • 010 .765V -45
  • 011 1.848V -45
  • 100 .765V 135
  • 101 1.848V 135
  • 110 .765V 45
  • 111 1.848V 45

111
101
100
110
010
000
001
011
56
Something to Note
  • As you begin to use more bits (go from BPSK to
    QPSK to 8-QAM) you are more susceptible to noise
    errors
  • There are 64-QAM modems out there today
  • Is a 64-QAM modem more susceptible to noise than
    a 32-QAM modem? A BPSK modem?
  • Which should be faster, a 64-QAM modem or a BPSK
    modem?

57
Sample QAM Signal Requirements
Bits/symbol (I,Q) QAM constellation size
Required SNR 2 (1,1) 4 (QPSK) 14.5 dB 3
(1,2) 8 19.3 dB 4 (2,2) 16 21.5 dB 5
(2,3) 32 24.5 dB 6 (3,3) 64 27.7 dB 7
(3,4) 128 30.6 dB 8 (4,4) 256 33.8
dB 10 (5,5) 1024 39.8 dB 12 (6,6) 4096
45.8 dB 15 (7,8) 32768 54.8 dB
58
Pulse Code Modulation
  • PCM is what we did for the Quantization exercise
    we did in class and the homework
  • We quantize an analog signal directly into
    digital values that represent a signal level
    (does it always represent it exactly?
  • Your 56 kbps modem uses PCM
  • 56 kbps downstream because ISP uses a pure
    digital PCM signal
  • 33 kbps upstream because your modem converts to
    an analog signal
Write a Comment
User Comments (0)
About PowerShow.com