Professional Documents
Culture Documents
Bruno
REAL TIME
DIGITAL
SIGNAL
PROCESSING
UTN-FRBA
2011
www.electron.frba.utn.edu.ar/dplab
DSP fundamentals
Number representation and
word-length effects.
(b) Signed integer (2’s complement) (b) Signed fractional (4.4) format
0x7FFF
0x8000
0x1234
0xABCD
0x5566
0.5
1.55
–1
–2.0345
( ) = 20 ⋅ log
111 -1
110 -2 DRdB = 20 ⋅ log10 2b −1
1 10 ( 2b − 1 ) 101=-3
Q3 Format
1. 0 1 1 -0.62510 1. 0 1 1 -0.62510
+ +
0. 1 1 0 0.7510 1. 0 0 0 -110
1 0. 0 0 1 0.12510 1 0. 0 1 1 -1.62510
Overflow !
UTN-FRBA 2011 Eng. Julian S. Bruno
Sum in Two’s complement
Different Formats
3.0 1 0 1 1 . 0 -510 1.2 1 1 . 0 1 0 -0.7510
+ +
1.1 0 0 0 1 . 1 1.510 0.3 0 0 . 0 1 1 0.37510
3.1 1 1 0 0 . 1 -3.510 1.3 1 1 . 1 0 1 -0.37510
ein(n)
x(t) x(n)
ADC z-1 z-1 z-1
b1 b2 b3
b0 × × × ×
+ + + memory
y(n)
esat esat esat
eout(n)
DAC
y(t)
Possible quantization errors
ein(n)
x(t) x(n)
ADC z-1 z-1 z-1
b1 b2 b3
b0 × × × ×
+ + + memory
y(n)
esat esat esat
eout(n)
DAC
y(t)
Possible quantization errors
90
6-bit
8-bit
10-bit
12-bit
σ 2 signal
80
14-bit
SNR A / D = 10 ⋅ log10 2
16-bit
70
σ A / D noise 60
A/D
SNR
50
q2 Vp 2 2Vp
σ A / D noise =
2
= where q = b 40
12 3 ⋅ 2 2b 2 30
2 20
Vp
σ 2 signal = rms 2 = 10
-20 -18 -16 -14 -12
Loading factor (dB)
-10 -8 -6 -4
2
Vp 2 / 2
SNR A / D = 10 ⋅ log10 2
2b
= 10 ⋅ log 1 .5 ⋅(2 2b
)
Vp / 3 ⋅ 2
10
rms σ signal
Loading Factor : LF = = ; σ 2 signal = LF 2Vp 2 ⇒ SNR A / D = 4.77dB + 6.02dB ⋅ b + 20 ⋅ log10 ( LF )
Vp Vp
UTN-FRBA 2011 Eng. Julian S. Bruno
Oversampling Method
1 q2
PSDnoise = (q / 12) ⋅
2
=
fs 12 fs
fs fs
Prosessing Gain : PG = 10 log ; SNR A / D = 1.76dB + 6.02dB ⋅ b + 10 log
2 BW 2 BW
UTN-FRBA 2011 Eng. Julian S. Bruno
Oversampling Method
It’s ideally used in cases where the It’s ideally suited for applications
sampling frequency is low compared to requiring oversampling and higher
the sampling rate of the ADC sample rates
ein(n)
x(t) x(n)
ADC z-1 z-1 z-1
b1 b2 b3
b0 × × × ×
+ + + memory
y(n)
esat esat esat
eout(n)
DAC
y(t)
Possible quantization errors
0.9.β 0.8.β
System
Scale
Signal
1
G< 1/ 2 Scaling by square-root of the sum of
N −1
xmax ∑ hk2 squared magnitude of impulse response
k =0 (L2 norm).
1
G< Scaling by the maximum of the
xmax max[ H (ωk )]
frequency response (Chebyshev norm).
0.8
0.6
0.4
0.2
Imaginary Part
Avoiding overflow
0
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.5 0 0.5 1
Real Part
1
G<
Freq response
4
N −1 3
Scaling by sum of magnitude of
xmax ∑ hk
2
1
impulse response (L1 norm).
k =0 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.6
0.4
1
G<
0.2
k =0
2
1.5
1
(L2 norm).
0.5
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
0.8
1
G<
0.6
0.2
0
0
frequency response (Chebyshev norm).
0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
l1_norm = 4.8839
l2_norm = 1.5263
cheb_norm = 3.4926
6 6
4 4
2 2
0 0
-2 -2
-4 -4
-6 -6
-8 -8
-15 -10 -5 0 5 10 15 -15 -10 -5 0 5 10 15
ein(n)
x(t) x(n)
ADC z-1 z-1 z-1
b1 b2 b3
b0 × × × ×
+ + + memory
y(n)
esat esat esat
eout(n)
DAC
y(t)
Possible quantization errors
1.5 1.5
1 1
0.5 0.5
0 0
-0.5 -0.5
-1 -1
-1.5 -1.5
-2 -2
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
1.5 1.5
1 1
0.5 0.5
0 0
-0.5 -0.5
-1 -1
-1.5 -1.5
-2 -2
0 2 4 6 8 10 12 14 16 18 20 0 2 4 6 8 10 12 14 16 18 20
-1
z
b(1)=1
a(2)=0.98 Convert
a(3)=-0.76
-K -
s(1)=10e-3 a(2)
s(2)=0 -1
z
Input = 0 Convert
-K -
a(3)
-1
8 z
b(1)=1
6
a(2)=0.98 Convert
4
a(3)=-0.76
2
-K -
0
s(1)=10e-3 a(2)
-2
s(2)=0 -1
z
-4
Input = 0 Convert
-6
-K -
-8 a(3)
0 10 20 30 40 50 60 70 80 90 100
2
8
2
0
-2-1
-4
-2
-6
-8
0 10 20 30 40 50 60 70 80 90 100
0 10 20 30 40 50 60 70 80 90 100
ein(n)
x(t) x(n)
ADC z-1 z-1 z-1
b1 b2 b3
b0 × × × ×
+ + + memory
y(n)
esat esat esat
eout(n)
DAC
y(t)
Possible quantization errors
itself.
Imaginary Part
44
37
Though there is a grid of 0
-40 0.15
Magnitude (dB)
Magnitude (dB)
0.1
-60
0.05
-80
0
-100
-0.05
-120
-0.1
-140
-0.15
-160
-0.2
-180
0 2000 4000 6000 8000 10000 0 500 1000 1500 2000 2500 3000 3500 4000
Frequency (Hz) Frequency (Hz)
Bit 31 30 23 22 0
Positive zero 0 0 0 0 0 0 0 0
Negative zero 1 0 0 -0 1 0 0 -0
Positive
normalized
0 0 < e < 255 f 2e-127 (1,f) 0 0 < e < 2047 f 2e-1023 (1,f)
Negative
normalized
1 0 < e < 255 f -2e-127 (1,f) 1 0 < e <2047 f -2e-1023 (1,f)
Positive
denormalized
0 0 f≠0 2-126 (0,f) 0 0 f≠0 2-1022 (0,f)
Negative
denormalized
1 0 f≠0 -2-126 (0,f) 1 0 f≠0 -2-1022 (0,f)
Denormalized
numbers
( 0,f 2-126)
Gap = 1.4e-45
Min. Positive Denormalized
0 00000000 00000000000000000000001 (1 × 2 −23 ) × 2 −126 ≅ 2 −149
1.4012984643248170709e - 45
UTN-FRBA 2011 Eng. Julian S. Bruno
Multiply
MULTIPLY
No No Add Subtract
¿X = 0? ¿Y = 0?
exponents bias
Yes Yes Report
Yes Exponent
overflow? overflow
Z 0
No
RETURN Yes
Exponent Report
underflow? underflow
No
Multiply
significands
Normalize
Round RETURN
UTN-FRBA 2011 Eng. Julian S. Bruno
Division
DIVIDE
No No Subtract
¿X = 0? ¿Y = 0? Add bias
exponents
Yes Yes Exponent Yes Report
overflow? overflow
Z 0 Z ∞
No
No
Divide
significands
Normalize
Round RETURN
UTN-FRBA 2011 Eng. Julian S. Bruno
Fixed Point hardware or Floating
Point Hardware ?
There are both benefits and trade-offs to using Fix-PHw rather than
FL-PHw . Many applications require low-power and cost-effective
circuitry, which makes Fix-PHw a natural choice.
Fix-PHw tends to be simpler and smaller. As a result, these units
require less power and cost less to produce than floating-point circuitry.
FL-PHw is usually larger because it demands functionality and ease of
development. FL-PHw can accurately represent real-world numbers,
and its large dynamic range reduces the risk of overflow, quantization
errors, and the need for scaling. In contrast, the smaller dynamic range
of Fix-PHw that allows for low-power, inexpensive units brings the
possibility of these problems.
Therefore, fixed-point development must minimize the negative effects
of these factors, while exploiting the benefits of Fix-PHw ; cost- and
size-effective units, less power and memory usage, and fast real-time
processing.
.
NOTE: Many images used in this presentation were extracted from the recommended bibliography
UTN-FRBA 2011 Eng. Julian S. Bruno
Questions?
Thank you!