Real-Time Digital Signal Processing Lab: Quantization and Resolution Overview

Slide Note
Embed
Share

Explore quantization and resolution techniques in real-time digital signal processing. Topics include quantization error analysis, total harmonic distortion, noise immunity in communication systems, human sensory resolution, analog-to-digital conversion, and uniform amplitude quantization. Dive into the intricacies of signal processing with Prof. Brian L. Evans at The University of Texas at Austin.


Uploaded on Apr 18, 2024 | 7 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. ECE 445S Real-Time Digital Signal Processing Lab Spring 2024 Quantization Prof. Brian L. Evans Dept. of Electrical and Computer Engineering The University of Texas at Austin Lecture 8 http://www.ece.utexas.edu/~bevans/courses/realtime

  2. Outline Resolution Quantization Quantization error (noise) analysis Total harmonic distortion Noise immunity in communication systems Conclusion Digital vs. analog audio (optional) 8 - 2

  3. Resolution Human eyes Sample received light on 2-D grid Photoreceptor density in retina falls off exponentially away from fovea (point of focus) Respond logarithmically to intensity (amplitude) of light Human ears Respond to frequencies in 20 Hz to 20 kHz range Respond logarithmically in both intensity (amplitude) of sound (pressure waves) and frequency (octaves) Log-log plot for hearing response vs. frequency Foveated grid: point of focus in middle 8 - 3

  4. Quantization Quantization is an interpretation of a continuous quantity by a finite set of discrete values Analog-to-Digital Conversion Lowpass filter has stopband frequency less than fs to reduce aliasing at sampler output (enforce sampling theorem) Lecture 4 Lecture 8 Analog Lowpass Filter Quantizer Sampler at sampling rate of fs System properties: Linearity Time-Invariance Causality Memory 8 - 4

  5. Uniform Amplitude Quantization Round to nearest integer (midtread) Quantize amplitude to levels {-2, -1, 0, 1} Step size D for linear region of operation Represent levels by {00, 01, 10, 11} or {10, 11, 00, 01} Latter is two's complement representation Rounding with offset (midrise) Quantize to levels {-3/2, -1/2, 1/2, 3/2} Represent levels by {11, 10, 00, 01} Step size Q[x] 1 x -2 1 -2 1 ( ) 2 3 D = = = 1 2 2 1 3 Q[x] 1 x 3 3 Used in slide 8-9 3 2 2 -2 1 2 -1 D = = = 1 2 2 1 3 8 - 5

  6. Audio Compact Discs (CDs) Analog lowpass filter Passband 0 20 kHz Transition band 20 22 kHz Stopband frequency at 22 kHz (i.e. 10% rolloff) Designed to control amount of aliasing that occurs at sampler output (and hence called an anti-aliasing filter) Signal-to-noise ratio when quantizing to B bits 1.76 dB + 6.02 dB/bit * B = 98.08 dB Looseupper bound derived in slides 8-9 to 8-13 Audio CDs have dynamic range of about 95 dB Noise is quantization error (see slide 8-9) Analog Lowpass Filter Quantizer 16 Sample at 44.1 kHz 8 - 6

  7. Dynamic Range Signal-to-noise ratio in dB Why 10 log10 ? For amplitude A, |A|dB = 20 log10 |A| With power P |A|2 , PdB = 10 log10 |A|2 PdB = 20 log10 |A| Signal Power = SNR 10 log dB 10 Noise Power = 10 log Signal Power 10 10 log Noise Power 10 For linear systems, dynamic range equals SNR Lowpass anti-aliasing filter for audio CD format Ideal magnitude response of 0 dB over passband Astopband = 0 dB Noise Power in dB = -98.08 dB 8 - 7

  8. Dynamic Range in Audio Anechoic room 10 dB Whisper 30 dB Rainfall 50 dB Dishwasher 60 dB City Traffic 85 dB Leaf Blower 110 dB Siren 120 dB Sound Pressure Level (SPL) Reference in dB SPL is 20 Pa (threshold of hearing) 40 dB SPL noise in typical living room 120 dB SPL threshold of pain 80 dB SPL resulting dynamic range Estimating dynamic range (a)Find maximum RMS output of the linear system with some specified amount of distortion, typically 1% (b)Find RMS output of system with small input signal (e.g. -60 dB of full scale) with input signal removed from output (c)Divide (b) into (a) to find the dynamic range Slide by Dr. Thomas D. Kite, Audio Precision 8 - 8

  9. Quantization Error (Noise) Analysis Quantization output Input signal plus noise Noise is difference of output and input signals Signal-to-noise ratio (SNR) derivation Quantize to B bits Uniform midrise quant. Example mmax = 2V B = 2 bits L = 2B = 4 levels D = L-1 steps Q[x] 1 x -2 1 2 -1 Input in linear region: m (-mmax, mmax) Quantization error (noise) Q is uniformly distributed Quantization levels L = 2B large enough so QB[ ] m v Quantization error (noise) = = [ ] q Q m m v m 1 1 B 1 L L

  10. Quantization Error (Noise) Analysis Deterministic signal x(t) w/Fourier transformX(f) Power spectrum is square of absolute value of magnitude response (phase is ignored) ( ) ( X f Px = Multiplication in Fourier domain is convolution in time domain Conjugation in Fourier domain is reversal & conjugation in time Autocorrelation of x(t) = * ( ) ( ) * ( ) Rx x x Maximum value (when it exists) is at Rx(0) Rx( ) is even symmetric, i.e. Rx( ) = Rx(- ) 2 = * ) ( ) ( ) f X f X f x(t) 1 0 Ts t Rx( ) Ts ) = * * ( ) ( ) ( ) * ( X f X f F x x -Ts Ts 8 - 10

  11. Quantization Error (Noise) Analysis ) Two-sided random signal n(t) Fourier transform may not exist, but power spectrum exists ( ) ( ) ( ) ( = = when 0 ) ( ) ( ) ( = + = t n t n E Rn = ( ) ( P f F R n n = + = + * * ( ) n ( ) ( ) ( ) ( ) Rn E t n t n t n t dt time-averaged = * * * ) ( ) ( ) * ( ) Rn E n t n t n t n t dt n n For zero-mean Gaussian random processn(t)with variance 2 * 0 = 2 ( ) Pn f = + = * 2 ( ) ( ) ( ) ( ) Rn Estimate noise power spectrum in Matlab E n t n t approximate noise floor N = 16384; % finite no. of samples gaussianNoise = randn(N,1); plot( abs(fft(gaussianNoise)) .^ 2 ); 8 - 11

  12. Quantization Error (Noise) Analysis Input power: Paverage,m Quantizer step size m max 2 Quantization error 2 m D = max Signal Power = SNR 1 L L Noise Power 3 P P 2 average, m average, m = = 2 B SNR D D 2 2 max m q Q 2 2 SNR exponential in B Adding 1 bit increases SNR by factor of 4 q is sample of zero-mean random variable Q Q is uniformly distributed Derivation of SNR in deciBels on next slide = 2 2 2 Q E Q Q zero D 2 1 = = 2 2 max 2 B m 2 Q 8 - 12 12 3

  13. Quantization Error (Noise) Analysis SNR in dB = constant + 6.02 dB/bit * B Loose upper bound 3 P 2 average, m = 2 B 10 log SNR 10 log 10 10 2 max m ( ) ( ) = + + 10 log 3 10 log 20 log 20 B log ) 2 ( 10 P m 10 10 average, m 10 max ( ) ( ) = + + . 0 477 10 log 20 log . 6 02 P m B 10 average, m 10 max 1.76 and 1.17 are common constants used in audio TI Stereo Codec Cirrus Logic WM8994 Signal-to-Noise Ratio 94 dB (15.3 bits) 97 dB (15.8 bits) 92 dB (15.0 bits) 99 dB (16.2 bits) Total Harmonic Distortion 80 dB (13.0 bits) 82 dB (13.3 bits) 91 dB (14.8 bits) 94 dB (15.3 bits) ADC DAC ADC DAC TLV320AIC3106 (differential mode) Using B as the effective number of bits, SNR in dB = 2 + 6 B WM8994 is on our STM ARM board; TLV320AIC3106 used in previus TI OMAP-L138 board

  14. Total Harmonic Distortion + Noise A measure of nonlinear distortion in a system Input is a sinusoidal signal of a single fixed frequency From output of system, the input sinusoid signal is subtracted Compute SNR In audio, sinusoidal signal is often at 1 kHz In Sweet spot for human hearing between 0.8 and 1.2 kHz Example System is ADC Calibrated DAC Signal is x(t) Noise is n(t) x(t) n(t) + D/A A/D ~ + Converter Converter 1 kHz ~ fs Delay

  15. Noise Immunity at Receiver Output Depends on modulation, average transmit power, transmission bandwidth and channel noise Analog communications (receiver output SNR) When the carrier to noise ratio is high, an increase in the transmission bandwidth BT provides a corresponding quadratic increase in the output signal-to-noise ratio or figure of merit of the [wideband] FM system. Simon Haykin, Communication Systems, 4th ed., p. 147. Digital communications (receiver symbol error rate) For code division multiple access (CDMA) spread spectrum communications, probability of symbol error decreases exponentially with transmission bandwidth BT Andrew Viterbi, CDMA: Principles of Spread SpectrumCommunications, 1995, pp. 34-36. 8 - 15

  16. Conclusion Amplitude quantization approximates its input by a discrete amplitude taken from finite set of values Loose upper bound in signal-to-noise ratio of a uniform amplitude quantizer with output of B bits Best case: 6 dB of SNR gained for each bit added to quantizer Key limitation: assumes large number of levels L = 2B Best case improvement in noise immunity for communication systems Analog: improvement quadratic in transmission bandwidth Digital: improvement exponential in transmission bandwidth 8 - 16

  17. Optional Handling Overflow Example: Consider set of integers {-2, -1, 0, 1} Represented in two's complement system {10, 11, 00, 01}. Add ( 1) + ( 1) + ( 1) + 1 + 1 Intermediate computations are 2, 1, 2, 1 for wraparound arithmetic and 2, 2, 1, 0 for saturation arithmetic Saturation: When to use it? If input value greater than maximum, set it to maximum; if less than minimum, set it to minimum Used in quantizers, filtering, other signal processing operators Wraparound: When to use it? Addition performed modulo set of integers Used in address calculations, array indexing Native support in MMX and DSPs Standard two s complement behavior 8 - 17

  18. Optional Digital vs. Analog Audio An audio engineer claims to notice differences between analog vinyl master recording and the remixed CD version. Is this possible? When digitizing an analog recording, the maximum voltage level for the quantizer is the maximum volume in the track Samples are uniformly quantized (to 216 levels in this case although early CDs circa 1982 were recorded at 14 bits) Problem on a track with both loud and quiet portions, which occurs often in classical pieces When track is quiet, relative error in quantizing samples grows Contrast this with analog media such as vinyl which responds linearly to quiet portions 8 - 18

  19. Optional Digital vs. Analog Audio Analog and digital media response to voltage v ( ) 0 0 for v v V V for V v V / 1 3 + v for V v V v V 0 0 0 0 0 = ( ) for D v v V v V = ( ) for A v V v V 0 0 0 0 ( ) for / 1 3 V v V V 0 0 0 For a large dynamic range Analog media: records voltages above V0 with distortion Digital media: clips voltages above V0 to V0 Audio CDs use delta-sigma modulation Effective dynamic range of 19 bits for lower frequencies but lower than 16 bits for higher frequencies Human hearing is more sensitive at lower frequencies 8 - 19

Related


More Related Content