Numbering Systems Basic Building Blocks Scaling and Round-off Noise. Number Representation. Floating vs. Fixed point. DSP Design.

Similar documents
Numbering Systems. Computational Platforms. Scaling and Round-off Noise. Special Purpose. here that is dedicated architecture

DSP Design Lecture 2. Fredrik Edman.

Dealing with quantitative data and problem solving life is a story problem! Attacking Quantitative Problems

Problem Set #2 Due: Friday April 20, 2018 at 5 PM.

Lecture 2: Discrete-Time Signals & Systems. Reza Mohammadkhani, Digital Signal Processing, 2015 University of Kurdistan eng.uok.ac.

Chapter 6 Folding. Folding

SER/BER in a Fading Channel

Linear-Phase FIR Transfer Functions. Functions. Functions. Functions. Functions. Functions. Let

Announce. ECE 2026 Summer LECTURE OBJECTIVES READING. LECTURE #3 Complex View of Sinusoids May 21, Complex Number Review

Slide 1. Slide 2. Slide 3 DIGITAL SIGNAL PROCESSING CLASSIFICATION OF SIGNALS

DSP-First, 2/e. LECTURE # CH2-3 Complex Exponentials & Complex Numbers TLH MODIFIED. Aug , JH McClellan & RW Schafer

5.80 Small-Molecule Spectroscopy and Dynamics

10. The Discrete-Time Fourier Transform (DTFT)

ANALYSIS IN THE FREQUENCY DOMAIN

Finite element discretization of Laplace and Poisson equations

4. (5a + b) 7 & x 1 = (3x 1)log 10 4 = log (M1) [4] d = 3 [4] T 2 = 5 + = 16 or or 16.

2. Laser physics - basics

On the Design of an On-line Complex FIR Filter


ECE 344 Microwave Fundamentals

Random Process Part 1

Optics and Non-Linear Optics I Non-linear Optics Tutorial Sheet November 2007

Chapter 13 GMM for Linear Factor Models in Discount Factor form. GMM on the pricing errors gives a crosssectional

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018

6. The Interaction of Light and Matter

Why is a E&M nature of light not sufficient to explain experiments?

Lecture 37 (Schrödinger Equation) Physics Spring 2018 Douglas Fields

A Propagating Wave Packet Group Velocity Dispersion

Supplementary Materials

Outline. Why speech processing? Speech signal processing. Advanced Multimedia Signal Processing #5:Speech Signal Processing 2 -Processing-

ECE Department Univ. of Maryland, College Park

Communication Technologies

4.2 Design of Sections for Flexure


1 General boundary conditions in diffusion

A Sub-Optimal Log-Domain Decoding Algorithm for Non-Binary LDPC Codes

The graph of y = x (or y = ) consists of two branches, As x 0, y + ; as x 0, y +. x = 0 is the

Linear Non-Gaussian Structural Equation Models

Continuous probability distributions

Chapter 6. The Discrete Fourier Transform and The Fast Fourier Transform

Data Assimilation 1. Alan O Neill National Centre for Earth Observation UK

Symmetric centrosymmetric matrix vector multiplication

22/ Breakdown of the Born-Oppenheimer approximation. Selection rules for rotational-vibrational transitions. P, R branches.

Analysis of Finite Wordlength Effects

Voltage, Current, Power, Series Resistance, Parallel Resistance, and Diodes

Image Filtering: Noise Removal, Sharpening, Deblurring. Yao Wang Polytechnic University, Brooklyn, NY11201

September 23, Honors Chem Atomic structure.notebook. Atomic Structure

Background: We have discussed the PIB, HO, and the energy of the RR model. In this chapter, the H-atom, and atomic orbitals.

BINOMIAL COEFFICIENTS INVOLVING INFINITE POWERS OF PRIMES. 1. Statement of results

Alpha and beta decay equation practice

2. Background Material

orbiting electron turns out to be wrong even though it Unfortunately, the classical visualization of the

2008 AP Calculus BC Multiple Choice Exam

Brief Introduction to Statistical Mechanics

Quasi-Classical States of the Simple Harmonic Oscillator

Coupled Pendulums. Two normal modes.

Chapter 8: Electron Configurations and Periodicity

Davisson Germer experiment Announcements:

EXST Regression Techniques Page 1

The pn junction: 2 Current vs Voltage (IV) characteristics

Answer Homework 5 PHA5127 Fall 1999 Jeff Stark

P. Bruschi - Notes on Mixed Signal Design

Homework #3. 1 x. dx. It therefore follows that a sum of the

EEO 401 Digital Signal Processing Prof. Mark Fowler

Types of Transfer Functions. Types of Transfer Functions. Types of Transfer Functions. Ideal Filters. Ideal Filters

Electrochemistry L E O

Digital Signal Processing, Fall 2006

Abstract Interpretation: concrete and abstract semantics

Hydrogen Atom and One Electron Ions

An Extensive Study of Approximating the Periodic. Solutions of the Prey Predator System

Y 0. Standing Wave Interference between the incident & reflected waves Standing wave. A string with one end fixed on a wall

CO-ORDINATION OF FAST NUMERICAL RELAYS AND CURRENT TRANSFORMERS OVERDIMENSIONING FACTORS AND INFLUENCING PARAMETERS

u 3 = u 3 (x 1, x 2, x 3 )

The Transfer Function. The Transfer Function. The Transfer Function. The Transfer Function. The Transfer Function. The Transfer Function

A Prey-Predator Model with an Alternative Food for the Predator, Harvesting of Both the Species and with A Gestation Period for Interaction

Fourier Transforms and the Wave Equation. Key Mathematics: More Fourier transform theory, especially as applied to solving the wave equation.

Middle East Technical University Department of Mechanical Engineering ME 413 Introduction to Finite Element Analysis

Introduction to Condensed Matter Physics

u x v x dx u x v x v x u x dx d u x v x u x v x dx u x v x dx Integration by Parts Formula

Higher order derivatives

1973 AP Calculus AB: Section I

2013 Specialist Mathematics GA 3: Written examination 2

Classical Magnetic Dipole

Contemporary, atomic, nuclear, and particle physics

ECE602 Exam 1 April 5, You must show ALL of your work for full credit.

2.3 Matrix Formulation

The van der Waals interaction 1 D. E. Soper 2 University of Oregon 20 April 2012

INTRODUCTION TO AUTOMATIC CONTROLS INDEX LAPLACE TRANSFORMS

Problem Set 6 Solutions

ECE 407 Computer Aided Design for Electronic Systems. Instructor: Maria K. Michael. Overview. CAD tools for multi-level logic synthesis:

2/12/2013. Overview. 12-Power Transmission Text: Conservation of Complex Power. Introduction. Power Transmission-Short Line

Prod.C [A] t. rate = = =

A Low-Cost and High Performance Solution to Frequency Estimation for GSM/EDGE

2. Finite Impulse Response Filters (FIR)

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list.

Applied Statistics II - Categorical Data Analysis Data analysis using Genstat - Exercise 2 Logistic regression

BINOMIAL COEFFICIENTS INVOLVING INFINITE POWERS OF PRIMES

EE243 Advanced Electromagnetic Theory Lec # 23 Scattering and Diffraction. Reading: Jackson Chapter , lite

ECE 2210 / 00 Phasor Examples

Discrete-Time Signal Processing

Transcription:

Numbring Systms Basic Building Blocks Scaling and Round-off Nois Numbr Rprsntation Viktor Öwall viktor.owall@it.lth.s Floating vs. Fixd point In floating point a valu is rprsntd by mantissa dtrmining th rsolution/prcision xponnt dtrmining th dynamic rang Binary numbrs, unsignd intgrs MSB = Most Significant Bit LSB = Last Significant Bit In fixd point w only hav a singl valu Floating point givs highr dynamic rang but th cost is high in nrgy ara calculation tim For nrgy fficint implmntations fixd point is prfrrd N bits N ord () () () () (4) (5) (6) (7)

Dynamic rang and Rsolution Nr. of Nr. of Rsolution Dynamic Rang bits lvls V fs =.5V V LSB =.5 4 6.5V.5V 8 56 mv 8V 496.mV 8V 6 65 56 7.6μV 4V How do w us th bits? Dpnds on th application! Unsignd Numbr Rprsntation Fixd radix (bas) systms Th digits a {,,,... r } in a radix r systm: l i r ai = i= k = rk a k l k r ak r a r a r a r + + + a l dscribd in a fixd point positional numbr systm: ai ai aa. a a l Fractional part Exampl: Unsignd Numbr l i ai = { a {,,,... 9} in radix } i= k = k a k l k ak a a a + + + a l Exampl: Unsignd Numbr l i ai = { a {,} in radix } i= k = k a k l k ai a a a + + + a l l i ai = { a {,} in radix } i= k = k a k l k ai a a a + + + a l. 4 i + i + i + i + i + i + i + i = 8+ + + 4 8

Signd Digit Numbr Rprsntation Th digits a { α,, r α } in a radix r systm: l i r ak i= k Exampl Radix : a { 4,,, 4,5} ( 5) = + 5 = + 5 = 95 (. 5) = + 5 =.+.5 =.95 Signd Numbr Rprsntation Sign Magnitud On s Complmnt Two s Complmnt Signd Magnitud Unsignd numbrs with a sign-bit On s Complmnt Signd numbrs by invrting (Complmnt) - - Signd Magnitud - - Two Zros + Low Powr? + Easy to convrt to Ngativ - On's Complmnt - - - Two Zros + Easy to convrt to Ngativ

- - Two s Complmnt Most widly usd fixd point numbring systm Two's Complmnt Complmnt + LSB + On Zro + Easy Addition - Not so asy to convrt to Ng. - - 4 Two s Complmnt Th digits a {, } in a radix systm: l k a i k + ai = i= k = k a k l k ak a a a + + + a l dscribd in a fixd point positional numbr systm: ak ak aa. a a l Sign Bit Fractional part Exampl: s complmnt Sign Extnsion in Two s Complmnt. 4 i + i + i + i + i + i + i + i = 8+ + + 4 8 k a k k + ak a + a = ka k k k a + k + ak a + a = k+ a k k k k + ak a k ak a a + + + Exampl: = = = = = = = = 4

h Th Wordlngth, i.. nr of bits D D D h h UMTS-filtr float h Evry xtra bit costs nrgy/powr dlay ara th wordlngth has to b rducd 7bits Th Wordlngth, i.. nr of bits h D D D h h Th output of addr output nds an xtra bit to b sur of no ovrflow,.g. dcimal: + = 4 binary: += h multiplir MxN bits M+N bits for full prcision Prcision has to b limitd Basic Building Blocks D D D h h h h Basic Building Blocks In th FIR filtr addrs multiplirs rgistrs in othr algrithms also: shift, minus, division,... lft shift is multiply by right shift is a divd by but is low complxity! 5

Comparing Basic Building Blocks High Complxity Dividr Multiplir Addr/Subtarct a b a b a b a a b a b a b a b a b a b a b a b a b a b a b b a b Scaling and Round-off Nois Shiftr a b a b a b a b p 6 p 5 p 4 p p p p Low a a b a b s b s a b s s Quantization Quantization Two Typs Cofficint Quantization Non-Idal Transfr Function Compar to analog componnt variations Signal Quantization Round-off Nois Limit Cycls Round-off Nois Affct th output as a random disturbanc Limit Cycl Oscillations Undsird priodic componnts Du to non-linar bhavior in th fdback (rounding or ovrflow) 6

Quantization Analysis Using ral rounding, truncation, and ovrflow Giv xact rsult Tricky - nd intgr rprsntation Using nois modls Floating point rprsntation can still b usd Suitabl for Matlab, C/C++... Rounding Truncation Rounding/Truncation is always thr! Espcially ncssary in rcursiv systms Q Without quantization - infinit wordlngth Multiplication n+m output bits Addition n+ output bits Truncation and Rounding Lvl X+ Lvl X+ Truncation Rounding Truncation Rounding No nrgy addd to th systm Oftn usd in rcursiv algorithms Truncation towards zro Lvl X Lvl X -4 - - - -4 - - - -4 - - - Truncation All valus approximatd in th sam dirction Max rror = LSB Avrundning Valus approximatd up or down Max rror = / LSB DC rror Roundd to vn Add LSB bfor truncation if ngativ 7

Scaling Exampl Whr Scaling is Ndd Adjust signal rang to fit th hardwar Unchangd transfr function (Scald cofficints might mov th pol-zros) -.5 un ( ) = ± 4 Trad-off Scal up to rduc roundoff nois Scal down to avoid ovrflow But you loos prcision! Ovrflow β f(n) f(n) Scaling β Saf scaling if = f ( i) i= Whr f(i) is th unit sampl rspons β /7 Exampl: Saf Scaling β = i= f(i) =. + 7. +.5=.5. -.7.5 7 xn ( ) and yn ( ) 7 giv saf scaling h(n) Incrasd roundoff nois Intrnal scaling might improv 7/ (Linar phas FIR. Not th strngth rduction) 8

β Exampl: Saf Scaling i = i= f(i) = i= ( 5. ) = 5 + 5 + 5 + = =. 5 (. ) (. ) (. ) Gomtric sris -.5 -.5 Scaling Saf scaling is pssimistic Altrnativ is scaling with β = i ( f ( i ) ) = In practic: Scaling with β = ±n Easy to do - a shift Incrasd intrnal wordlngth an altrnativ Original filtr with ovrflow.5 Pacmakr xampl Th Elctrocardiogram (EGM) - 5 5 5 5 4 45.5 -.5-5 5 5 5 4 45.5 -.5 5 5 5 5 4 45 tim [ms] 9

Th Intrfrd signal Filtring Prformanc.5 -.5-4 6 8 EGM + Intrfrnc from AC hand drill db SNR T().5 Output of th GLRT and thrshold 4 6 8 tim, [ms] EGM with addd intrfrnc Wavlt Filtrbank Bit-optimization Signals hav bn monitord to dtrmin th uppr bound of th wordlngth Comparison of worst-cas wordlngth and implmntd wordlngth at th wavlt output: F ( z) = + z + z + z G ( ) b z = + z y y y y 4 y 5 y 6 N wc N+6 N+7 N+ N+ N+4 N+5 N Imp N+ N+ N+ N+ N+ N+

Exampl: Intrnal Scaling VHDL bit-lvl simulation 4-point FFT Compard with Matlab floating-point simulation Optimizd intrnal scaling A 6-point Radix- FFT W W 4 W Basic Buttrfly unit W Data In Radix Radix Radix Radix Radix Data Out W 6 W 8 W W 4 Countr Stag 5 Stag 4 Stag Stag Stag W W W W W W 4 Clock W 4 W 5 W W Whit nois input Sourc: Frdrik Kristnsn W 6 W 7 W 4 W 6 W W 4 Data In Exampl: Intrnal Scaling VHDL bit-lvl simulation 4-point FFT Compard with Matlab floating-point simulation Optimizd intrnal scaling 8-bits -bits -bits 4-bits 4-bits -bits Radix Radix Radix Radix Radix Data Out Limit Cycls Countr Stag 5 Stag 4 Stag Stag Stag Clock Whit nois input Sourc: Frdrik Kristnsn

Limit Cycls Exampl: zro input oscillations in nd ordr IIR b Q Limit Cycls Zro Input Exampl: zro input oscillations Rounding aftr multiplication X(n) Q b Truncation aftr multiplication 489 5 b = =.9565; b = =.975 56 6 Sourc: Lars Wanhammar, DSP Intgratd circuits Limit Cycls.8 Pols clos to th unity circl Matlab: zplan(,[ -.9565.975]) Limit Cycls Changing th prcision mov th pols! Zro input oscillations Oftn not accptd in audio Vry difficult problm.6.4. -. -.4 -.6 -.8 - - -.5.5 Ral Part In gnral, no solutions for structurs > nd ordr Can b limitd by incrasd intrnal wordlngth Can in som nd ordr structurs b liminatd by pol positioning nd ordr Wav Digital Filtrs ar fr from parasitic oscillations Imaginary Part Imaginary Part.8.6.4. -. -.4 -.6 -.8 - Pols clos to th unity circl Matlab: zplan(,[ -.9565.975]) zplan(,[ -.975.975]) - -.5.5 Ral Part Imaginary Part.8.6.4. -. -.4 -.6 -.8 - - -.5.5 Ral Part

Ovrflow Oscillations Saturation Arithmtic C out-msb = NOF From Addr -bit two s complmnt sum Corrct sum Oscillations ar limitd by saturation -bit saturatd sum C out-msb C in-msb C in-msb = POF Signbit Saturatd Output Ovrflow chang th sign Corrct sum Ovrflow if C out-msb diffrs from C in-msb Limit Cycls du to ovrflow Zro Input Two s Complmnt Arithmtic Saturatd Arithmtic Amplitud 5-5 Limit cycls du to ovrflow Lab Exampl - 4 5 6 7 8 9 Tim Saturation input unquantizd output quantizd output Amplitud 5-5 Wrap around Lab Exampl input unquantizd output quantizd output Sourc: Lars Wanhammar, DSP Intgratd circuits - 4 5 6 7 8 9 Tim

Limit cycls du to ovrflow 5 Lab Exampl input unquantizd output quantizd output Wrap around Amplitud -5 5 Lab Exampl input unquantizd output quantizd output Simpl Nois Analysis - 4 5 6 7 8 9 Tim Saturation Amplitud -5-4 5 6 7 8 9 Tim Scaling and Whit Nois Input β = δ β = f (), i Saf scaling i = f (), i possibl ovrflow i = ( ) = unit sampl rspons, ( ) = Varianc whit nois input i= f i f i 5 bits Q 8 bits a 8 bits Rounding (n) Modl a Saf scaling but not guarantd δ sts th probability for an ovrflow Typically on ovrflow vry 6 sampl is accptd in audio [Wanhammar] 4

5 bits Q 8 bits a 8 bits Rounding ( ) ( ) u n (n) n ( ) = u n un ( ) Modl Modld with addd nois as an input rror a Roundoff Nois If th quantization rror probability is uniformly distributd in th intrval Δ Δ ( W ) n ( ) whr Δ = W is th numbr of bits aftr th rounding Δ P () ½LSB Δ Δ Roundoff Nois Man valu = E[( n)] = Δ / Varianc = E[ ( ) ] = ( ) P ( ) d = [ = ] Δ / Δ / W Δ /8 Δ /8 Δ = = = Δ Δ Δ/ Δ P () ½LSB Δ Δ Exampl: Roundoff Nois In th cas of rounding (man=) th varianc and th avrag powr ar th sam, i.. if a valu is roundd th quantization nois bcoms: σ = W If w scal down on bit: ( W ) W = = 4 σ 5

Signal to Nois Ratio (SNR) On xtra bit rducs quantization rror by a factor 4 Signal to Nois Ratio (SNR) Signal powr (varianc) SNR = log 4σ = 6. σ db SNR σ = log = log σ W x σ x Good to rmmbr: 6 db incras in SNR pr bit Roundoff rror powr (varianc) Signal to Nois Ratio (SNR) Exampl: Full scal sinus wav roundd to 8 bits A SNR = log = 5 db; - A 8 Roundoff Nois: Addition E[( ) + ] = E[ + + ] = = E[ ] + E[ ] + E[ ] = zro if u and u indpndnt u (n) u (n) (n) = E[ ] + E[ ] (n) 6

Exampl: Roundoff Nois First ordr IIR-filtr, th varianc is: σ f () i = σ ( ( ) ( ) ( ) ) i + a + a + a = σ = a a =..σ a a =.5.σ a =.998 5 σ Narrow band filtr (n) i= No fdback a =.998 Exampl: SNR Exampl: Full scal sinus, roundd to 8 bits in IIR σ f ( i) = σ a SNR 5 σ = 5dB SNR = db (n) a 7