quantization

aniruddh Tyagi
aniruddh TyagiSr.Executive-Compression(Ericsson) em Bharti Airtel Limited
Quantization


                Yao Wang
Polytechnic University, Brooklyn, NY11201
       http://eeweb.poly.edu/~yao
Outline


• Review the three process of A to D conversion
• Quantization
      – Uniform
      – Non-uniform
           • Mu-law
      – Demo on quantization of audio signals
      – Sample Matlab codes
• Binary encoding
      – Bit rate of digital signals
• Advantage of digital representation



©Yao Wang, 2006                EE3414:Quantization   2
Three Processes in A/D Conversion


            Sampling                          Quanti-                Binary
                                              zation                 Encoding
xc(t)                     x[n] = xc(nT)                       x[n]              c[n]

             Sampling                      Quantization               Binary
              Period                         Interval                codebook
                T                               Q


        •    Sampling: take samples at time nT
              – T: sampling period;
              – fs = 1/T: sampling frequency
        •    Quantization: map amplitude values into a set of discrete values kQ
              – Q: quantization interval or stepsize
        •    Binary Encoding
              – Convert each quantized value into a binary codeword

 ©Yao Wang, 2006                        EE3414:Quantization                            3
Analog to Digital Conversion


              1
                                   T=0.1
                                   Q=0.25

            0.5



              0



            -0.5

                                                             A2D_plot.m

             -1


                   0   0.2   0.4            0.6    0.8   1




©Yao Wang, 2006              EE3414:Quantization                      4
How to determine T and Q?

• T (or fs) depends on the signal frequency range
      – A fast varying signal should be sampled more frequently!
      – Theoretically governed by the Nyquist sampling theorem
           • fs > 2 fm (fm is the maximum signal frequency)
           • For speech: fs >= 8 KHz; For music: fs >= 44 KHz;
• Q depends on the dynamic range of the signal amplitude and
  perceptual sensitivity
      – Q and the signal range D determine bits/sample R
           • 2R=D/Q
           • For speech: R = 8 bits; For music: R =16 bits;
• One can trade off T (or fs) and Q (or R)
      – lower R -> higher fs; higher R -> lower fs
• We considered sampling in last lecture, we discuss quantization
  in this lecture



©Yao Wang, 2006                    EE3414:Quantization              5
Uniform Quantization

• Applicable when the signal is in
a finite range (fmin, fmax)

• The entire data range is divided
into L equal intervals of length Q
(known as quantization interval or
quantization step-size)

      Q=(fmax-fmin)/L

• Interval i is mapped to the
middle value of this interval

• We store/send only the index of
                                                                                       f − f min 
quantized value                               Index of quantized value = Qi ( f ) = 
                                                                                     
                                                                                               Q 
                                              Quantized value = Q ( f ) = Qi ( f )Q + Q / 2 + f min

  ©Yao Wang, 2006                    EE3414:Quantization                                         6
Special Case I:
             Signal range is symmetric

• (a) L=even, mid-rise
Q(f)=floor(f/q)*q+q/2




     L = even, Mid - Riser                                       L = odd, Mid - Tread
                       f                            Q                             f
     Qi ( f ) = floor ( ), Q ( f ) = Qi ( f ) * Q +             Qi ( f ) = round ( ), Q( f ) = Qi ( f ) * Q
                       Q                            2                             Q

©Yao Wang, 2006                                  EE3414:Quantization                                          7
Special Case II:
                  Signal range starts at 0




                                                f min = 0, B = f max , q = f max / L
                                                                  f
                                                Qi ( f ) = floor ( )
                                                                  Q
                                                                          Q
                                                Q( f ) = Qi ( f ) * Q +
                                                                          2




©Yao Wang, 2006           EE3414:Quantization                                          8
Example

•   For the following sequence {1.2,-0.2,-0.5,0.4,0.89,1.3…}, Quantize it using a
    uniform quantizer in the range of (-1.5,1.5) with 4 levels, and write the quantized
    sequence.
•   Solution: Q=3/4=0.75. Quantizer is illustrated below.

                       -1.125            -0.375              0.375             1.125



                -1.5             -0.75                0                0.75              1.5


      Yellow dots indicate the partition levels (boundaries between separate quantization intervals)
      Red dots indicate the reconstruction levels (middle of each interval)

      1.2 fall between 0.75 and 1.5, and hence is quantized to 1.125

•   Quantized sequence:
      {1.125,-0.375,-0.375,0.375,1.125,1.125}



©Yao Wang, 2006                             EE3414:Quantization                                        9
Effect of Quantization Stepsize

                  Q=0.25                                           Q=0.5
     1.5                                    1.5

        1                                         1

     0.5                                    0.5

        0                                         0

    -0.5                                   -0.5

       -1                                     -1

    -1.5                                   -1.5
            0     0.2      0.4                        0          0.2              0.4
                                                          demo_sampling_quant.m




©Yao Wang, 2006             EE3414:Quantization                                         10
Demo: Audio Quantization

                      0.02


                                                            original at 16 bit
Original             0.015                                  quantized at 4 bit
Mozart.wav
                      0.01



                     0.005
Quantized
Mozart_q16.wav
                         0



                     -0.005



                      -0.01
                              2   2.002 2.004 2.006 2.008   2.01   2.012 2.014 2.016 2.018   2.02
                                                                                              4
                                                                                         x 10


   ©Yao Wang, 2006                    EE3414:Quantization                                           11
Demo: Audio Quantization (II)

 0.02                                                                            0.02
                                                                                                                                        original at 16 bit
                                                                                                                                        quantized at 6 bit
                                        original at 16 bit
0.015                                   quantized at 4 bit                      0.015



 0.01                                                                            0.01



0.005                                                                           0.005



    0                                                                               0



-0.005                                                                          -0.005



 -0.01                                                                           -0.01
         2    2.002 2.004 2.006 2.008   2.01   2.012 2.014 2.016 2.018   2.02            2   2.002 2.004 2.006 2.008   2.01   2.012 2.014 2.016 2.018        2.02
                                                                          4                                                                                   4
                                                                     x 10                                                                              x 10




                              Quantized                                                                        Quantized
                              Mozart_q16.wav                                                                   Mozart_q64.wav


             ©Yao Wang, 2006                                      EE3414:Quantization                                                                 12
Non-Uniform Quantization


• Problems with uniform quantization
      – Only optimal for uniformly distributed signal
      – Real audio signals (speech and music) are more
        concentrated near zeros
      – Human ear is more sensitive to quantization errors at small
        values
• Solution
      – Using non-uniform quantization
           • quantization interval is smaller near zero




©Yao Wang, 2006                 EE3414:Quantization                   13
Quantization: General Description




                  Quantization levels : L
                  Partition values : bl
                  Partition regions : Bl = [bl −1 , bl )
                  Reconstruction values : g l
                  Quantized Index : Qi ( f ) = l , if f ∈ Bl
                  Quantizer value : Q( f ) = g l , if f ∈ Bl

©Yao Wang, 2006               EE3414:Quantization              14
Function Representation




                    Q ( f ) = gl , if f ∈ Bl

©Yao Wang, 2006       EE3414:Quantization      15
Design of Non-Uniform Quantizer


• Directly design the partition and reconstruction levels
• Non-linear mapping+uniform quantization
              µ-law quantization




©Yao Wang, 2006                    EE3414:Quantization      16
µ-Law Quantization




                  y =F [ x ]
                                  |x| 
                          log 1+µ
                                  X max 
                                         .sign[ x]
                  = X max
                            log[1 + µ ]




©Yao Wang, 2006                     EE3414:Quantization   17
Implementation of µ-Law Quantization
           (Direct Method)

      – Transform the signal using µ-law: x->y
                       y =F [ x ]
                                       |x| 
                               log 1+µ
                                        X max 
                        = X max              .sign[ x]
                                 log[1 + µ ]


      – Quantize the transformed value using a uniform quantizer: y->y^
      – Transform the quantized value back using inverse µ-law: y^->x^

                         x =F −1[ y ]
                          X        log(1+ µ ) y 
                         = max    10 X max − 1 sign(y)
                           µ                    
                                                




©Yao Wang, 2006                     EE3414:Quantization                   18
Implementation of µ-Law Quantization
           (Indirect Method)

• Indirect Method:
      – Instead of applying the above computation to each sample,
        one can pre-design a quantization table (storing the partition
        and reconstruction levels) using the above procedure. The
        actual quantization process can then be done by a simple
        table look-up.
      – Applicable both for uniform and non-uniform quantizers
      – How to find the partition and reconstruction levels for mu-law
        quantizer
           • Apply inverse mu-law mapping to the partition and
             reconstruction levels of the uniform quantizer for y.
           • Note that the mu-law formula is designed so that if x ranges
             from (-x_max, x_max), then y also has the same range.


©Yao Wang, 2006                 EE3414:Quantization                         19
Example

•   For the following sequence {1.2,-0.2,-0.5,0.4,0.89,1.3…}, Quantize it
    using a mu-law quantizer in the range of (-1.5,1.5) with 4 levels, and
    write the quantized sequence.

•   Solution (indirect method):
      – apply the inverse formula to the partition and reconstruction levels found for
        the previous uniform quantizer example. Because the mu-law mapping is
        symmetric, we only need to find the inverse values for y=0.375,0.75,1.125
              µ=9, x_max=1.5, 0.375->0.1297, 0.75->0.3604, 1.125->0.7706
      – Then quantize each sample using the above partition and reconstruction
        levels.




©Yao Wang, 2006                     EE3414:Quantization                                  20
Example (cntd)

                   -1.125            -0.375                0.375             1.125



            -1.5             -0.75                 0                0.75               1.5

                                                                                 x =F −1[ y ]
                                                        Inverse µ-law
                                                                                      X       log(1+ µ ) y 
                                                                                     = max   10 X max − 1 sign(y)
                                                                                       µ                   
                                                                                                           
                            -0.77         -0.13     0.13              0.77


            -1.5                       -0.36        0      0.36                         1.5




 • Original sequence: {1.2,-0.2,-0.5,0.4,0.89,1.3…}
 • Quantized sequence
      – {0.77,-0.13,-0.77,0.77,0.77,0.77}
©Yao Wang, 2006                               EE3414:Quantization                                               21
Uniform vs. µ-Law Quantization

             Uniform: Q=0.5                               µ-law: Q=0.5,µ=16
1.5                                            1.5

   1                                              1
0.5                                            0.5

   0                                              0

-0.5                                          -0.5
  -1                                             -1

-1.5                                          -1.5
       0          0.2       0.4                       0       0.2        0.4

            With µ-law, small values are represented more accurately,
            but large values are represented more coarsely.


©Yao Wang, 2006                   EE3414:Quantization                          22
Uniform vs. µ-Law for Audio
            0.02                                  0.02
                                 q32                          q64

            0.01                                  0.01


                   0                                 0
  Mozart_q32.wav                                                              Mozart_q64.wav

           -0.01                                  -0.01
                       2       2.01      2.02             2    2.01      2.02
                                              4                               4
                                       x 10                            x 10
            0.02                                  0.02
                              q32µ4                           q32µ16
            0.01                                  0.01


                0
Mozart_q32_m4.wav                                    0
                                                                       Mozart_q32_m16.wav


           -0.01                                  -0.01
                       2       2.01      2.02             2    2.01      2.02
                                              4                               4
                                       x 10                            x 10
Evaluation of Quantizer Performance

 • Ideally we want to measure the performance by how close is the
   quantized sound to the original sound to our ears -- Perceptual
   Quality
 • But it is very hard to come up with a objective measure that
   correlates very well with the perceptual quality
 • Frequently used objective measure – mean square error (MSE)
   between original and quantized samples or signal to noise ratio
   (SNR)
                                1
                  MSE : σ q =
                          2

                                N
                                    ∑ ( x(n) − x(n))
                                    n
                                               ˆ       2



                                                 (
                  SNR(dB) : SNR = 10 log10 σ x / σ q
                                             2     2
                                                           )
                  where N is the number of samples in the sequence.
                                                                    1
                  σ x is the variance of the original signal, σ z2 = ∑ ( x(n)) 2
                    2

                                                                    N n

©Yao Wang, 2006                         EE3414:Quantization                        24
Sample Matlab Code

Go through “quant_uniform.m”, “quant_mulaw.m”




©Yao Wang, 2006        EE3414:Quantization      25
Binary Encoding


• Convert each quantized level index into a codeword
  consisting of binary bits
• Ex: natural binary encoding for 8 levels:
      – 000,001,010,011,100,101,110,111
• More sophisticated encoding (variable length coding)
      – Assign a short codeword to a more frequent symbol to
        reduce average bit rate
      – To be covered later




©Yao Wang, 2006             EE3414:Quantization                26
Example 1: uniform quantizer

•   For the following sequence {1.2,-0.2,-0.5,0.4,0.89,1.3…}, Quantize it using a
    uniform quantizer in the range of (-1.5,1.5) with 4 levels, and write the quantized
    sequence and the corresponding binary bitstream.
•   Solution: Q=3/4=0.75. Quantizer is illustrated below.
•   Codewords: 4 levels can be represented by 2 bits, 00, 01, 10, 11

      codewords                  00               01            10             11

     Quantized values          -1.125           -0.375          0.375          1.125



                        -1.5            -0.75             0             0.75           1.5



•   Quantized value sequence:
      {1.125,-0.375,-0.375,0.375,1.125,1.125}
•   Bitstream representing quantized sequence:
      {11, 01, 01, 10, 11, 11}



©Yao Wang, 2006                           EE3414:Quantization                                27
Example 2: mu-law quantizer
codewords               00                01                 10                 11
                       -1.125            -0.375                  0.375            1.125



                -1.5             -0.75                 0                 0.75               1.5

                                                                                      x =F −1[ y ]
                                                             Inverse µ-law
                                                                                           X       log(1+ µ ) y 
                                                                                          = max   10 X max − 1 sign(y)
  codewords                     00                01        10            11                µ                   
                                                                                                                
                                -0.77          -0.13    0.13               0.77


                -1.5                       -0.36        0        0.36                        1.5




     • Original sequence: {1.2,-0.2,-0.5,0.4,0.89,1.3…}
     • Quantized sequence: {0.77,-0.13,-0.77,0.77,0.77,0.77}
     • Bitstream: {11,01,00,11,11,11}
    ©Yao Wang, 2006                               EE3414:Quantization                                                28
Bit Rate of a Digital Sequence

• Sampling rate: f_s sample/sec
• Quantization resolution: B bit/sample, B=[log2(L)]
• Bit rate: R=f_s B bit/sec
• Ex: speech signal sampled at 8 KHz, quantized to 8 bit/sample,
  R=8*8 = 64 Kbps
• Ex: music signal sampled at 44 KHz, quantized to 16 bit/sample,
  R=44*16=704 Kbps
• Ex: stereo music with each channel at 704 Kbps: R=2*704=1.4
  Mbps
• Required bandwidth for transmitting a digital signal depends on
  the modulation technique.
      – To be covered later.
• Data rate of a multimedia signal can be reduced significantly
  through lossy compression w/o affecting the perceptual quality.
      – To be covered later.



©Yao Wang, 2006                EE3414:Quantization                  29
Advantages of Digital
                     Representation (I)
                       1.5
More immune to
noise added in                                               original signal
channel and/or                                               received signal
storage
                         1

The receiver applies
a threshold to the
received signal:       0.5

   0 if x < 0.5
 x=
 ˆ
   1 if x ≥ 0.5
                         0




                       -0.5
                              0   10         20         30        40           50   60




  ©Yao Wang, 2006                 EE3414:Quantization                                    30
Advantages of Digital
                   Representation (II)

• Can correct erroneous bits and/or recover missing
  bits using “forward error correction” (FEC) technique
      – By adding “parity bits” after information bits, corrupted bits
        can be detected and corrected
      – Ex: adding a “check-sum” to the end of a digital sequence
        (“0” if sum=even, “1” if sum=odd). By computing check-sum
        after receiving the signal, one can detect single errors (in
        fact, any odd number of bit errors).
      – Used in CDs, DVDs, Internet, wireless phones, etc.




©Yao Wang, 2006              EE3414:Quantization                         31
What Should You Know

• Understand the general concept of quantization
• Can perform uniform quantization on a given signal
• Understand the principle of non-uniform quantization, and can
  perform mu-law quantization
• Can perform uniform and mu-law quantization on a given
  sequence, generate the resulting quantized sequence and its
  binary representation
• Can calculate bit rate given sampling rate and quantization
  levels
• Know advantages of digital representation
• Understand sample matlab codes for performing quantization
  (uniform and mu-law)



©Yao Wang, 2006           EE3414:Quantization                     32
References

• Y. Wang, Lab Manual for Multimedia Lab, Experiment on
  Speech and Audio Compression. Sec. 1-2.1. (copies provided).




©Yao Wang, 2006          EE3414:Quantization                     33
1 de 33

Recomendados

Digital communication por
Digital communicationDigital communication
Digital communicationmeashi
7.6K visualizações141 slides
Quantization por
QuantizationQuantization
Quantizationwtyru1989
5.2K visualizações34 slides
Quantization por
QuantizationQuantization
QuantizationMaj. Sanjaya Prasad
4.3K visualizações9 slides
Power delay profile,delay spread and doppler spread por
Power delay profile,delay spread and doppler spreadPower delay profile,delay spread and doppler spread
Power delay profile,delay spread and doppler spreadManish Srivastava
44.8K visualizações23 slides
Multirate DSP por
Multirate DSPMultirate DSP
Multirate DSP@zenafaris91
16.6K visualizações36 slides
Differential pulse code modulation por
Differential pulse code modulationDifferential pulse code modulation
Differential pulse code modulationRamraj Bhadu
10K visualizações11 slides

Mais conteúdo relacionado

Mais procurados

Pulse modulation por
Pulse modulationPulse modulation
Pulse modulationstk_gpg
53.6K visualizações38 slides
DPCM por
DPCMDPCM
DPCMsuryateja swamy
28.2K visualizações23 slides
M ary psk modulation por
M ary psk modulationM ary psk modulation
M ary psk modulationAhmed Diaa
37.7K visualizações12 slides
M ary psk and m ary qam ppt por
M ary psk and m ary qam pptM ary psk and m ary qam ppt
M ary psk and m ary qam pptDANISHAMIN950
7.4K visualizações33 slides
Loop Antennas por
Loop AntennasLoop Antennas
Loop AntennasRoma Rico Flores
10.7K visualizações18 slides
Sampling theorem por
Sampling theoremSampling theorem
Sampling theoremShanu Bhuvana
35.6K visualizações16 slides

Mais procurados(20)

Pulse modulation por stk_gpg
Pulse modulationPulse modulation
Pulse modulation
stk_gpg53.6K visualizações
DPCM por suryateja swamy
DPCMDPCM
DPCM
suryateja swamy28.2K visualizações
M ary psk modulation por Ahmed Diaa
M ary psk modulationM ary psk modulation
M ary psk modulation
Ahmed Diaa37.7K visualizações
M ary psk and m ary qam ppt por DANISHAMIN950
M ary psk and m ary qam pptM ary psk and m ary qam ppt
M ary psk and m ary qam ppt
DANISHAMIN9507.4K visualizações
Loop Antennas por Roma Rico Flores
Loop AntennasLoop Antennas
Loop Antennas
Roma Rico Flores10.7K visualizações
Sampling theorem por Shanu Bhuvana
Sampling theoremSampling theorem
Sampling theorem
Shanu Bhuvana35.6K visualizações
Precoding por Khalid Hussain
PrecodingPrecoding
Precoding
Khalid Hussain8.6K visualizações
Matched filter por srkrishna341
Matched filterMatched filter
Matched filter
srkrishna34128.9K visualizações
Overlap Add, Overlap Save(digital signal processing) por Gourab Ghosh
Overlap Add, Overlap Save(digital signal processing)Overlap Add, Overlap Save(digital signal processing)
Overlap Add, Overlap Save(digital signal processing)
Gourab Ghosh50.7K visualizações
Design of Filters PPT por Imtiyaz Rashed
Design of Filters PPTDesign of Filters PPT
Design of Filters PPT
Imtiyaz Rashed11.9K visualizações
Coherent and Non-coherent detection of ASK, FSK AND QASK por naimish12
Coherent and Non-coherent detection of ASK, FSK AND QASKCoherent and Non-coherent detection of ASK, FSK AND QASK
Coherent and Non-coherent detection of ASK, FSK AND QASK
naimish1267.3K visualizações
Modulation techniques por Sathish Kumar
Modulation techniquesModulation techniques
Modulation techniques
Sathish Kumar13.9K visualizações
DIGITAL SIGNAL PROCESSING por Snehal Hedau
DIGITAL SIGNAL PROCESSINGDIGITAL SIGNAL PROCESSING
DIGITAL SIGNAL PROCESSING
Snehal Hedau46.5K visualizações
SAMPLING & RECONSTRUCTION OF DISCRETE TIME SIGNAL por karan sati
SAMPLING & RECONSTRUCTION  OF DISCRETE TIME SIGNALSAMPLING & RECONSTRUCTION  OF DISCRETE TIME SIGNAL
SAMPLING & RECONSTRUCTION OF DISCRETE TIME SIGNAL
karan sati1.5K visualizações
Diversity Techniques in Wireless Communication por Sahar Foroughi
Diversity Techniques in Wireless CommunicationDiversity Techniques in Wireless Communication
Diversity Techniques in Wireless Communication
Sahar Foroughi46.2K visualizações
Application of DSP por KUNAL RANA
Application of DSPApplication of DSP
Application of DSP
KUNAL RANA2.7K visualizações
Companding & Pulse Code Modulation por Yeshudas Muttu
Companding & Pulse Code ModulationCompanding & Pulse Code Modulation
Companding & Pulse Code Modulation
Yeshudas Muttu3.2K visualizações
Delta modulation por mpsrekha83
Delta modulationDelta modulation
Delta modulation
mpsrekha831.3K visualizações

Similar a quantization

Quantifying the call blending balance in two way communication retrial queues... por
Quantifying the call blending balance in two way communication retrial queues...Quantifying the call blending balance in two way communication retrial queues...
Quantifying the call blending balance in two way communication retrial queues...wrogiest
260 visualizações22 slides
Quadrature amplitude modulation qam transmitter por
Quadrature amplitude modulation qam transmitterQuadrature amplitude modulation qam transmitter
Quadrature amplitude modulation qam transmitterAsaad Drake
7.4K visualizações16 slides
Cosmological Perturbations and Numerical Simulations por
Cosmological Perturbations and Numerical SimulationsCosmological Perturbations and Numerical Simulations
Cosmological Perturbations and Numerical SimulationsIan Huston
529 visualizações37 slides
An automated and user-friendly optical tweezers for biomolecular investigat... por
An automated and user-friendly optical  tweezers for biomolecular  investigat...An automated and user-friendly optical  tweezers for biomolecular  investigat...
An automated and user-friendly optical tweezers for biomolecular investigat...Dr. Pranav Rathi
1.2K visualizações63 slides
Finite automata examples por
Finite automata examplesFinite automata examples
Finite automata examplesankitamakin
17.5K visualizações68 slides
Finite automata examples por
Finite automata examplesFinite automata examples
Finite automata examplesankitamakin
774 visualizações68 slides

Similar a quantization(20)

Quantifying the call blending balance in two way communication retrial queues... por wrogiest
Quantifying the call blending balance in two way communication retrial queues...Quantifying the call blending balance in two way communication retrial queues...
Quantifying the call blending balance in two way communication retrial queues...
wrogiest260 visualizações
Quadrature amplitude modulation qam transmitter por Asaad Drake
Quadrature amplitude modulation qam transmitterQuadrature amplitude modulation qam transmitter
Quadrature amplitude modulation qam transmitter
Asaad Drake7.4K visualizações
Cosmological Perturbations and Numerical Simulations por Ian Huston
Cosmological Perturbations and Numerical SimulationsCosmological Perturbations and Numerical Simulations
Cosmological Perturbations and Numerical Simulations
Ian Huston529 visualizações
An automated and user-friendly optical tweezers for biomolecular investigat... por Dr. Pranav Rathi
An automated and user-friendly optical  tweezers for biomolecular  investigat...An automated and user-friendly optical  tweezers for biomolecular  investigat...
An automated and user-friendly optical tweezers for biomolecular investigat...
Dr. Pranav Rathi1.2K visualizações
Finite automata examples por ankitamakin
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin17.5K visualizações
Finite automata examples por ankitamakin
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin774 visualizações
Ee443 phase locked loop - presentation - schwappach and brandy por Loren Schwappach
Ee443   phase locked loop - presentation - schwappach and brandyEe443   phase locked loop - presentation - schwappach and brandy
Ee443 phase locked loop - presentation - schwappach and brandy
Loren Schwappach5.5K visualizações
EC8553 Discrete time signal processing por ssuser2797e4
EC8553 Discrete time signal processing EC8553 Discrete time signal processing
EC8553 Discrete time signal processing
ssuser2797e4403 visualizações
Sparsity and Compressed Sensing por Gabriel Peyré
Sparsity and Compressed SensingSparsity and Compressed Sensing
Sparsity and Compressed Sensing
Gabriel Peyré2K visualizações
Fourier transform por Naveen Sihag
Fourier transformFourier transform
Fourier transform
Naveen Sihag25K visualizações
Chapter 5 por Imran Abdullah
Chapter 5Chapter 5
Chapter 5
Imran Abdullah6.2K visualizações
Aquifer Parameter Estimation por C. P. Kumar
Aquifer Parameter EstimationAquifer Parameter Estimation
Aquifer Parameter Estimation
C. P. Kumar29K visualizações
SOCG: Linear-Size Approximations to the Vietoris-Rips Filtration por Don Sheehy
SOCG: Linear-Size Approximations to the Vietoris-Rips FiltrationSOCG: Linear-Size Approximations to the Vietoris-Rips Filtration
SOCG: Linear-Size Approximations to the Vietoris-Rips Filtration
Don Sheehy476 visualizações
Ultrasound Modular Architecture por Jose Miguel Moreno
Ultrasound Modular ArchitectureUltrasound Modular Architecture
Ultrasound Modular Architecture
Jose Miguel Moreno303 visualizações
Short-time homomorphic wavelet estimation por UT Technology
Short-time homomorphic wavelet estimation Short-time homomorphic wavelet estimation
Short-time homomorphic wavelet estimation
UT Technology820 visualizações
Signal Processing Course : Sparse Regularization of Inverse Problems por Gabriel Peyré
Signal Processing Course : Sparse Regularization of Inverse ProblemsSignal Processing Course : Sparse Regularization of Inverse Problems
Signal Processing Course : Sparse Regularization of Inverse Problems
Gabriel Peyré3.9K visualizações
Dissertation Slides por Sanghui Ahn
Dissertation SlidesDissertation Slides
Dissertation Slides
Sanghui Ahn726 visualizações
Tuto cvpr part1 por zukun
Tuto cvpr part1Tuto cvpr part1
Tuto cvpr part1
zukun693 visualizações
CVPR2010: Sparse Coding and Dictionary Learning for Image Analysis: Part 1: S... por zukun
CVPR2010: Sparse Coding and Dictionary Learning for Image Analysis: Part 1: S...CVPR2010: Sparse Coding and Dictionary Learning for Image Analysis: Part 1: S...
CVPR2010: Sparse Coding and Dictionary Learning for Image Analysis: Part 1: S...
zukun2.6K visualizações
IGARSS2011 FR3.T08.3 BenDavid.pdf por grssieee
IGARSS2011 FR3.T08.3 BenDavid.pdfIGARSS2011 FR3.T08.3 BenDavid.pdf
IGARSS2011 FR3.T08.3 BenDavid.pdf
grssieee243 visualizações

Mais de aniruddh Tyagi

whitepaper_mpeg-if_understanding_mpeg4 por
whitepaper_mpeg-if_understanding_mpeg4whitepaper_mpeg-if_understanding_mpeg4
whitepaper_mpeg-if_understanding_mpeg4aniruddh Tyagi
229 visualizações51 slides
BUC BLOCK UP CONVERTER por
BUC BLOCK UP CONVERTERBUC BLOCK UP CONVERTER
BUC BLOCK UP CONVERTERaniruddh Tyagi
14 visualizações149 slides
digital_set_top_box2 por
digital_set_top_box2digital_set_top_box2
digital_set_top_box2aniruddh Tyagi
10 visualizações10 slides
Discrete cosine transform por
Discrete cosine transformDiscrete cosine transform
Discrete cosine transformaniruddh Tyagi
65 visualizações29 slides
DCT por
DCTDCT
DCTaniruddh Tyagi
8 visualizações17 slides
EBU_DVB_S2 READY TO LIFT OFF por
EBU_DVB_S2 READY TO LIFT OFFEBU_DVB_S2 READY TO LIFT OFF
EBU_DVB_S2 READY TO LIFT OFFaniruddh Tyagi
10 visualizações10 slides

Mais de aniruddh Tyagi(20)

whitepaper_mpeg-if_understanding_mpeg4 por aniruddh Tyagi
whitepaper_mpeg-if_understanding_mpeg4whitepaper_mpeg-if_understanding_mpeg4
whitepaper_mpeg-if_understanding_mpeg4
aniruddh Tyagi229 visualizações
BUC BLOCK UP CONVERTER por aniruddh Tyagi
BUC BLOCK UP CONVERTERBUC BLOCK UP CONVERTER
BUC BLOCK UP CONVERTER
aniruddh Tyagi14 visualizações
digital_set_top_box2 por aniruddh Tyagi
digital_set_top_box2digital_set_top_box2
digital_set_top_box2
aniruddh Tyagi10 visualizações
Discrete cosine transform por aniruddh Tyagi
Discrete cosine transformDiscrete cosine transform
Discrete cosine transform
aniruddh Tyagi65 visualizações
EBU_DVB_S2 READY TO LIFT OFF por aniruddh Tyagi
EBU_DVB_S2 READY TO LIFT OFFEBU_DVB_S2 READY TO LIFT OFF
EBU_DVB_S2 READY TO LIFT OFF
aniruddh Tyagi10 visualizações
ADVANCED DVB-C,DVB-S STB DEMOD por aniruddh Tyagi
ADVANCED DVB-C,DVB-S STB DEMODADVANCED DVB-C,DVB-S STB DEMOD
ADVANCED DVB-C,DVB-S STB DEMOD
aniruddh Tyagi5 visualizações
DVB_Arch por aniruddh Tyagi
DVB_ArchDVB_Arch
DVB_Arch
aniruddh Tyagi25 visualizações
haffman coding DCT transform por aniruddh Tyagi
haffman coding DCT transformhaffman coding DCT transform
haffman coding DCT transform
aniruddh Tyagi8 visualizações
Classification por aniruddh Tyagi
ClassificationClassification
Classification
aniruddh Tyagi6 visualizações
tyagi 's doc por aniruddh Tyagi
tyagi 's doctyagi 's doc
tyagi 's doc
aniruddh Tyagi4 visualizações
quantization_PCM por aniruddh Tyagi
quantization_PCMquantization_PCM
quantization_PCM
aniruddh Tyagi6 visualizações
ECMG & EMMG protocol por aniruddh Tyagi
ECMG & EMMG protocolECMG & EMMG protocol
ECMG & EMMG protocol
aniruddh Tyagi5 visualizações
7015567A por aniruddh Tyagi
7015567A7015567A
7015567A
aniruddh Tyagi2 visualizações
Basic of BISS por aniruddh Tyagi
Basic of BISSBasic of BISS
Basic of BISS
aniruddh Tyagi14 visualizações
euler theorm por aniruddh Tyagi
euler theormeuler theorm
euler theorm
aniruddh Tyagi20 visualizações
fundamentals_satellite_communication_part_1 por aniruddh Tyagi
fundamentals_satellite_communication_part_1fundamentals_satellite_communication_part_1
fundamentals_satellite_communication_part_1
aniruddh Tyagi28 visualizações
quantization por aniruddh Tyagi
quantizationquantization
quantization
aniruddh Tyagi22 visualizações
art_sklar7_reed-solomon por aniruddh Tyagi
art_sklar7_reed-solomonart_sklar7_reed-solomon
art_sklar7_reed-solomon
aniruddh Tyagi3 visualizações
DVBSimulcrypt2 por aniruddh Tyagi
DVBSimulcrypt2DVBSimulcrypt2
DVBSimulcrypt2
aniruddh Tyagi3 visualizações

Último

iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... por
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...Bernd Ruecker
33 visualizações69 slides
SAP Automation Using Bar Code and FIORI.pdf por
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdfVirendra Rai, PMP
22 visualizações38 slides
Data-centric AI and the convergence of data and model engineering: opportunit... por
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...Paolo Missier
39 visualizações40 slides
Spesifikasi Lengkap ASUS Vivobook Go 14 por
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14Dot Semarang
37 visualizações1 slide
DALI Basics Course 2023 por
DALI Basics Course  2023DALI Basics Course  2023
DALI Basics Course 2023Ivory Egg
16 visualizações12 slides
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... por
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...James Anderson
66 visualizações32 slides

Último(20)

iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... por Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker33 visualizações
SAP Automation Using Bar Code and FIORI.pdf por Virendra Rai, PMP
SAP Automation Using Bar Code and FIORI.pdfSAP Automation Using Bar Code and FIORI.pdf
SAP Automation Using Bar Code and FIORI.pdf
Virendra Rai, PMP22 visualizações
Data-centric AI and the convergence of data and model engineering: opportunit... por Paolo Missier
Data-centric AI and the convergence of data and model engineering:opportunit...Data-centric AI and the convergence of data and model engineering:opportunit...
Data-centric AI and the convergence of data and model engineering: opportunit...
Paolo Missier39 visualizações
Spesifikasi Lengkap ASUS Vivobook Go 14 por Dot Semarang
Spesifikasi Lengkap ASUS Vivobook Go 14Spesifikasi Lengkap ASUS Vivobook Go 14
Spesifikasi Lengkap ASUS Vivobook Go 14
Dot Semarang37 visualizações
DALI Basics Course 2023 por Ivory Egg
DALI Basics Course  2023DALI Basics Course  2023
DALI Basics Course 2023
Ivory Egg16 visualizações
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... por James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson66 visualizações
Igniting Next Level Productivity with AI-Infused Data Integration Workflows por Safe Software
Igniting Next Level Productivity with AI-Infused Data Integration Workflows Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Igniting Next Level Productivity with AI-Infused Data Integration Workflows
Safe Software257 visualizações
AMAZON PRODUCT RESEARCH.pdf por JerikkLaureta
AMAZON PRODUCT RESEARCH.pdfAMAZON PRODUCT RESEARCH.pdf
AMAZON PRODUCT RESEARCH.pdf
JerikkLaureta19 visualizações
The details of description: Techniques, tips, and tangents on alternative tex... por BookNet Canada
The details of description: Techniques, tips, and tangents on alternative tex...The details of description: Techniques, tips, and tangents on alternative tex...
The details of description: Techniques, tips, and tangents on alternative tex...
BookNet Canada126 visualizações
Case Study Copenhagen Energy and Business Central.pdf por Aitana
Case Study Copenhagen Energy and Business Central.pdfCase Study Copenhagen Energy and Business Central.pdf
Case Study Copenhagen Energy and Business Central.pdf
Aitana16 visualizações
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive por Network Automation Forum
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLiveAutomating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Automating a World-Class Technology Conference; Behind the Scenes of CiscoLive
Network Automation Forum30 visualizações
Voice Logger - Telephony Integration Solution at Aegis por Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma31 visualizações
Perth MeetUp November 2023 por Michael Price
Perth MeetUp November 2023 Perth MeetUp November 2023
Perth MeetUp November 2023
Michael Price19 visualizações
Empathic Computing: Delivering the Potential of the Metaverse por Mark Billinghurst
Empathic Computing: Delivering  the Potential of the MetaverseEmpathic Computing: Delivering  the Potential of the Metaverse
Empathic Computing: Delivering the Potential of the Metaverse
Mark Billinghurst476 visualizações
Scaling Knowledge Graph Architectures with AI por Enterprise Knowledge
Scaling Knowledge Graph Architectures with AIScaling Knowledge Graph Architectures with AI
Scaling Knowledge Graph Architectures with AI
Enterprise Knowledge28 visualizações
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors por sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab19 visualizações
Microsoft Power Platform.pptx por Uni Systems S.M.S.A.
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptx
Uni Systems S.M.S.A.52 visualizações
Attacking IoT Devices from a Web Perspective - Linux Day por Simone Onofri
Attacking IoT Devices from a Web Perspective - Linux Day Attacking IoT Devices from a Web Perspective - Linux Day
Attacking IoT Devices from a Web Perspective - Linux Day
Simone Onofri15 visualizações

quantization

  • 1. Quantization Yao Wang Polytechnic University, Brooklyn, NY11201 http://eeweb.poly.edu/~yao
  • 2. Outline • Review the three process of A to D conversion • Quantization – Uniform – Non-uniform • Mu-law – Demo on quantization of audio signals – Sample Matlab codes • Binary encoding – Bit rate of digital signals • Advantage of digital representation ©Yao Wang, 2006 EE3414:Quantization 2
  • 3. Three Processes in A/D Conversion Sampling Quanti- Binary zation Encoding xc(t) x[n] = xc(nT) x[n] c[n] Sampling Quantization Binary Period Interval codebook T Q • Sampling: take samples at time nT – T: sampling period; – fs = 1/T: sampling frequency • Quantization: map amplitude values into a set of discrete values kQ – Q: quantization interval or stepsize • Binary Encoding – Convert each quantized value into a binary codeword ©Yao Wang, 2006 EE3414:Quantization 3
  • 4. Analog to Digital Conversion 1 T=0.1 Q=0.25 0.5 0 -0.5 A2D_plot.m -1 0 0.2 0.4 0.6 0.8 1 ©Yao Wang, 2006 EE3414:Quantization 4
  • 5. How to determine T and Q? • T (or fs) depends on the signal frequency range – A fast varying signal should be sampled more frequently! – Theoretically governed by the Nyquist sampling theorem • fs > 2 fm (fm is the maximum signal frequency) • For speech: fs >= 8 KHz; For music: fs >= 44 KHz; • Q depends on the dynamic range of the signal amplitude and perceptual sensitivity – Q and the signal range D determine bits/sample R • 2R=D/Q • For speech: R = 8 bits; For music: R =16 bits; • One can trade off T (or fs) and Q (or R) – lower R -> higher fs; higher R -> lower fs • We considered sampling in last lecture, we discuss quantization in this lecture ©Yao Wang, 2006 EE3414:Quantization 5
  • 6. Uniform Quantization • Applicable when the signal is in a finite range (fmin, fmax) • The entire data range is divided into L equal intervals of length Q (known as quantization interval or quantization step-size) Q=(fmax-fmin)/L • Interval i is mapped to the middle value of this interval • We store/send only the index of f − f min  quantized value Index of quantized value = Qi ( f ) =    Q  Quantized value = Q ( f ) = Qi ( f )Q + Q / 2 + f min ©Yao Wang, 2006 EE3414:Quantization 6
  • 7. Special Case I: Signal range is symmetric • (a) L=even, mid-rise Q(f)=floor(f/q)*q+q/2 L = even, Mid - Riser L = odd, Mid - Tread f Q f Qi ( f ) = floor ( ), Q ( f ) = Qi ( f ) * Q + Qi ( f ) = round ( ), Q( f ) = Qi ( f ) * Q Q 2 Q ©Yao Wang, 2006 EE3414:Quantization 7
  • 8. Special Case II: Signal range starts at 0 f min = 0, B = f max , q = f max / L f Qi ( f ) = floor ( ) Q Q Q( f ) = Qi ( f ) * Q + 2 ©Yao Wang, 2006 EE3414:Quantization 8
  • 9. Example • For the following sequence {1.2,-0.2,-0.5,0.4,0.89,1.3…}, Quantize it using a uniform quantizer in the range of (-1.5,1.5) with 4 levels, and write the quantized sequence. • Solution: Q=3/4=0.75. Quantizer is illustrated below. -1.125 -0.375 0.375 1.125 -1.5 -0.75 0 0.75 1.5 Yellow dots indicate the partition levels (boundaries between separate quantization intervals) Red dots indicate the reconstruction levels (middle of each interval) 1.2 fall between 0.75 and 1.5, and hence is quantized to 1.125 • Quantized sequence: {1.125,-0.375,-0.375,0.375,1.125,1.125} ©Yao Wang, 2006 EE3414:Quantization 9
  • 10. Effect of Quantization Stepsize Q=0.25 Q=0.5 1.5 1.5 1 1 0.5 0.5 0 0 -0.5 -0.5 -1 -1 -1.5 -1.5 0 0.2 0.4 0 0.2 0.4 demo_sampling_quant.m ©Yao Wang, 2006 EE3414:Quantization 10
  • 11. Demo: Audio Quantization 0.02 original at 16 bit Original 0.015 quantized at 4 bit Mozart.wav 0.01 0.005 Quantized Mozart_q16.wav 0 -0.005 -0.01 2 2.002 2.004 2.006 2.008 2.01 2.012 2.014 2.016 2.018 2.02 4 x 10 ©Yao Wang, 2006 EE3414:Quantization 11
  • 12. Demo: Audio Quantization (II) 0.02 0.02 original at 16 bit quantized at 6 bit original at 16 bit 0.015 quantized at 4 bit 0.015 0.01 0.01 0.005 0.005 0 0 -0.005 -0.005 -0.01 -0.01 2 2.002 2.004 2.006 2.008 2.01 2.012 2.014 2.016 2.018 2.02 2 2.002 2.004 2.006 2.008 2.01 2.012 2.014 2.016 2.018 2.02 4 4 x 10 x 10 Quantized Quantized Mozart_q16.wav Mozart_q64.wav ©Yao Wang, 2006 EE3414:Quantization 12
  • 13. Non-Uniform Quantization • Problems with uniform quantization – Only optimal for uniformly distributed signal – Real audio signals (speech and music) are more concentrated near zeros – Human ear is more sensitive to quantization errors at small values • Solution – Using non-uniform quantization • quantization interval is smaller near zero ©Yao Wang, 2006 EE3414:Quantization 13
  • 14. Quantization: General Description Quantization levels : L Partition values : bl Partition regions : Bl = [bl −1 , bl ) Reconstruction values : g l Quantized Index : Qi ( f ) = l , if f ∈ Bl Quantizer value : Q( f ) = g l , if f ∈ Bl ©Yao Wang, 2006 EE3414:Quantization 14
  • 15. Function Representation Q ( f ) = gl , if f ∈ Bl ©Yao Wang, 2006 EE3414:Quantization 15
  • 16. Design of Non-Uniform Quantizer • Directly design the partition and reconstruction levels • Non-linear mapping+uniform quantization µ-law quantization ©Yao Wang, 2006 EE3414:Quantization 16
  • 17. µ-Law Quantization y =F [ x ]  |x|  log 1+µ  X max  .sign[ x] = X max log[1 + µ ] ©Yao Wang, 2006 EE3414:Quantization 17
  • 18. Implementation of µ-Law Quantization (Direct Method) – Transform the signal using µ-law: x->y y =F [ x ]  |x|  log 1+µ X max  = X max  .sign[ x] log[1 + µ ] – Quantize the transformed value using a uniform quantizer: y->y^ – Transform the quantized value back using inverse µ-law: y^->x^ x =F −1[ y ] X  log(1+ µ ) y  = max 10 X max − 1 sign(y) µ     ©Yao Wang, 2006 EE3414:Quantization 18
  • 19. Implementation of µ-Law Quantization (Indirect Method) • Indirect Method: – Instead of applying the above computation to each sample, one can pre-design a quantization table (storing the partition and reconstruction levels) using the above procedure. The actual quantization process can then be done by a simple table look-up. – Applicable both for uniform and non-uniform quantizers – How to find the partition and reconstruction levels for mu-law quantizer • Apply inverse mu-law mapping to the partition and reconstruction levels of the uniform quantizer for y. • Note that the mu-law formula is designed so that if x ranges from (-x_max, x_max), then y also has the same range. ©Yao Wang, 2006 EE3414:Quantization 19
  • 20. Example • For the following sequence {1.2,-0.2,-0.5,0.4,0.89,1.3…}, Quantize it using a mu-law quantizer in the range of (-1.5,1.5) with 4 levels, and write the quantized sequence. • Solution (indirect method): – apply the inverse formula to the partition and reconstruction levels found for the previous uniform quantizer example. Because the mu-law mapping is symmetric, we only need to find the inverse values for y=0.375,0.75,1.125 µ=9, x_max=1.5, 0.375->0.1297, 0.75->0.3604, 1.125->0.7706 – Then quantize each sample using the above partition and reconstruction levels. ©Yao Wang, 2006 EE3414:Quantization 20
  • 21. Example (cntd) -1.125 -0.375 0.375 1.125 -1.5 -0.75 0 0.75 1.5 x =F −1[ y ] Inverse µ-law X  log(1+ µ ) y  = max 10 X max − 1 sign(y) µ     -0.77 -0.13 0.13 0.77 -1.5 -0.36 0 0.36 1.5 • Original sequence: {1.2,-0.2,-0.5,0.4,0.89,1.3…} • Quantized sequence – {0.77,-0.13,-0.77,0.77,0.77,0.77} ©Yao Wang, 2006 EE3414:Quantization 21
  • 22. Uniform vs. µ-Law Quantization Uniform: Q=0.5 µ-law: Q=0.5,µ=16 1.5 1.5 1 1 0.5 0.5 0 0 -0.5 -0.5 -1 -1 -1.5 -1.5 0 0.2 0.4 0 0.2 0.4 With µ-law, small values are represented more accurately, but large values are represented more coarsely. ©Yao Wang, 2006 EE3414:Quantization 22
  • 23. Uniform vs. µ-Law for Audio 0.02 0.02 q32 q64 0.01 0.01 0 0 Mozart_q32.wav Mozart_q64.wav -0.01 -0.01 2 2.01 2.02 2 2.01 2.02 4 4 x 10 x 10 0.02 0.02 q32µ4 q32µ16 0.01 0.01 0 Mozart_q32_m4.wav 0 Mozart_q32_m16.wav -0.01 -0.01 2 2.01 2.02 2 2.01 2.02 4 4 x 10 x 10
  • 24. Evaluation of Quantizer Performance • Ideally we want to measure the performance by how close is the quantized sound to the original sound to our ears -- Perceptual Quality • But it is very hard to come up with a objective measure that correlates very well with the perceptual quality • Frequently used objective measure – mean square error (MSE) between original and quantized samples or signal to noise ratio (SNR) 1 MSE : σ q = 2 N ∑ ( x(n) − x(n)) n ˆ 2 ( SNR(dB) : SNR = 10 log10 σ x / σ q 2 2 ) where N is the number of samples in the sequence. 1 σ x is the variance of the original signal, σ z2 = ∑ ( x(n)) 2 2 N n ©Yao Wang, 2006 EE3414:Quantization 24
  • 25. Sample Matlab Code Go through “quant_uniform.m”, “quant_mulaw.m” ©Yao Wang, 2006 EE3414:Quantization 25
  • 26. Binary Encoding • Convert each quantized level index into a codeword consisting of binary bits • Ex: natural binary encoding for 8 levels: – 000,001,010,011,100,101,110,111 • More sophisticated encoding (variable length coding) – Assign a short codeword to a more frequent symbol to reduce average bit rate – To be covered later ©Yao Wang, 2006 EE3414:Quantization 26
  • 27. Example 1: uniform quantizer • For the following sequence {1.2,-0.2,-0.5,0.4,0.89,1.3…}, Quantize it using a uniform quantizer in the range of (-1.5,1.5) with 4 levels, and write the quantized sequence and the corresponding binary bitstream. • Solution: Q=3/4=0.75. Quantizer is illustrated below. • Codewords: 4 levels can be represented by 2 bits, 00, 01, 10, 11 codewords 00 01 10 11 Quantized values -1.125 -0.375 0.375 1.125 -1.5 -0.75 0 0.75 1.5 • Quantized value sequence: {1.125,-0.375,-0.375,0.375,1.125,1.125} • Bitstream representing quantized sequence: {11, 01, 01, 10, 11, 11} ©Yao Wang, 2006 EE3414:Quantization 27
  • 28. Example 2: mu-law quantizer codewords 00 01 10 11 -1.125 -0.375 0.375 1.125 -1.5 -0.75 0 0.75 1.5 x =F −1[ y ] Inverse µ-law X  log(1+ µ ) y  = max 10 X max − 1 sign(y) codewords 00 01 10 11 µ     -0.77 -0.13 0.13 0.77 -1.5 -0.36 0 0.36 1.5 • Original sequence: {1.2,-0.2,-0.5,0.4,0.89,1.3…} • Quantized sequence: {0.77,-0.13,-0.77,0.77,0.77,0.77} • Bitstream: {11,01,00,11,11,11} ©Yao Wang, 2006 EE3414:Quantization 28
  • 29. Bit Rate of a Digital Sequence • Sampling rate: f_s sample/sec • Quantization resolution: B bit/sample, B=[log2(L)] • Bit rate: R=f_s B bit/sec • Ex: speech signal sampled at 8 KHz, quantized to 8 bit/sample, R=8*8 = 64 Kbps • Ex: music signal sampled at 44 KHz, quantized to 16 bit/sample, R=44*16=704 Kbps • Ex: stereo music with each channel at 704 Kbps: R=2*704=1.4 Mbps • Required bandwidth for transmitting a digital signal depends on the modulation technique. – To be covered later. • Data rate of a multimedia signal can be reduced significantly through lossy compression w/o affecting the perceptual quality. – To be covered later. ©Yao Wang, 2006 EE3414:Quantization 29
  • 30. Advantages of Digital Representation (I) 1.5 More immune to noise added in original signal channel and/or received signal storage 1 The receiver applies a threshold to the received signal: 0.5 0 if x < 0.5 x= ˆ 1 if x ≥ 0.5 0 -0.5 0 10 20 30 40 50 60 ©Yao Wang, 2006 EE3414:Quantization 30
  • 31. Advantages of Digital Representation (II) • Can correct erroneous bits and/or recover missing bits using “forward error correction” (FEC) technique – By adding “parity bits” after information bits, corrupted bits can be detected and corrected – Ex: adding a “check-sum” to the end of a digital sequence (“0” if sum=even, “1” if sum=odd). By computing check-sum after receiving the signal, one can detect single errors (in fact, any odd number of bit errors). – Used in CDs, DVDs, Internet, wireless phones, etc. ©Yao Wang, 2006 EE3414:Quantization 31
  • 32. What Should You Know • Understand the general concept of quantization • Can perform uniform quantization on a given signal • Understand the principle of non-uniform quantization, and can perform mu-law quantization • Can perform uniform and mu-law quantization on a given sequence, generate the resulting quantized sequence and its binary representation • Can calculate bit rate given sampling rate and quantization levels • Know advantages of digital representation • Understand sample matlab codes for performing quantization (uniform and mu-law) ©Yao Wang, 2006 EE3414:Quantization 32
  • 33. References • Y. Wang, Lab Manual for Multimedia Lab, Experiment on Speech and Audio Compression. Sec. 1-2.1. (copies provided). ©Yao Wang, 2006 EE3414:Quantization 33