Sie sind auf Seite 1von 17

Digital Signal Processing

BITS Pilani
Pilani|Dubai|Goa|Hyderabad

Date : 02/09/2013

BITS Pilani
Pilani|Dubai|Goa|Hyderabad

Previous class:
Numeric Representation used in DSP Fixed point

BITS Pilani
Pilani|Dubai|Goa|Hyderabad

Today class
Numeric Representation used in DSP Fixed point Floating point

Numeric Representation used in DSP

Fixed-point
16-bit 20-bit 24-bit
Narrow dynamic range but costs low. Faster than FLPDSP

Floating-point
32-bit 64-bit 80-bit 128-bit
Wider dynamic range but complex hardware. Slower than FIPDSP

Fixed-Point Notation
A 16-bit fixed-point number can be interpreted as either: Integer (i.e., 20645) Fractional number (i.e., 0.75)

Integer:
Unsigned integer (from 0 to 216 i.e. 65,536) Signed integer (from 32,768 to 32,767) N-bit fixed point, 2s complement integer representation X = -bN-1 2N-1 + bN-2 2N-2 + + b020

What will be the value of 1 0 10 1 1 0 0 ?

Represent 3 using 3-bit twos complement representation. What is the maximum and minimum number you can represent using 3-bit twos complement representation?

So the dynamic range is from -4 to 3.

Let us do multiplication using 3-bit twos complement representation. 1. Multiply 2 with (-1)

Take twos complement and remove two extended sign bits.

Is the result correct ? 2. Multiply 2 with (-3)

2. Multiply 2 with (-3)

Now removing the two extended sign bits to have size of 3 we get:

Is the result correct? No. Overflow occurs as the result (-6) is out of dynamic range (-4).

Let use find the fractional representation of 3 in twos complement form? =?

011

001

So the overflow error is avoided. As multiplication of fractional number can not exceed dynamic range no overflow will be there.

Multiply 2 with (-3)

If we truncate the two LSB bits:

What is the error?

So the overflow error is avoided. As multiplication of fractional number can not exceed dynamic range no overflow will be there.

Some parameters to define representation accuracy Precision Smallest step (difference) between two consecutive N-bit numbers. Dynamic Range Ratio between the largest number and the smallest (positive) number. It can be expressed in dB (decibels) as follows: Dynamic Range (dB) =

20 log10 ( Max / Min)


Quantization error is the numeric error introduced when a longer numeric format is converted to a shorter one, e.g., when we round 1.325 to 1.33, we introduced a quantization error of 0.005.

In integer representation the precision is how much? In DSP much more precision is needed. So fractional number representation is used.

Fractional Fixed-Point Representation Called as Q-format (Quantity of fractional bits)


General Fractional Fixed-Point Representation

Q m.n notation m bits for integer portion n bits for fractional portion Total number of bits N = m + n + 1, for signed numbers Example: 16-bit number (N=16) and Q2.13 format 2 bits for integer portion 13 bits for fractional portion 1 signed bit (MSB) Special cases: 16-bit integer number (N=16) => Q15.0 format 16-bit fractional number (N = 16) => Q0.15 format; also known as Q.15 or Q15

S Integer (15 bits)


Q15.0

S Fraction (15 bits)


. .
Q.15 or Q15 Used in DSP

Binary pt position .
Q1.14

Upper 2 bits

Remaining 14 bits

Q15 used in 16-bit DSP chip, resolution of the fraction will be 215 or 30.518e6 Q15 means scaling by 1/215 Q15 means shifting to the right by 15 Example: how to represent 0.2625 in memory: Method 1 (Truncation): INT[0.2625*215]= INT[8601.6] = 8601 = 0010000110011001 Method 2 (Rounding): INT[0.2625*215+0.5]= INT[8602.1] = 8602 = 0010000110011010 By this method of rounding or truncation we introduce quantization error

Represent 0.95624 in Q4 format. Use truncation and rounding. 15.2999984 01111 Find the quantization error. Ans: 0.01874

Das könnte Ihnen auch gefallen