160 likes | 514 Views
Quantization. Quantization. Signal x(t) is quantized in a finite number of levels Assume that x is in the dynamic range [-1,1[ and we quantize it with b+1 bits -> 2 b+1 levels Quantization introduces an error : e = Q[x] - x. Rounding versus truncation. Truncation: -2 -b < Q[x] – x <= 0
E N D
Quantization • Signal x(t) is quantized in a finite number of levels • Assume that x is in the dynamic range [-1,1[ and we quantize it with b+1 bits -> 2b+1 levels • Quantization introduces an error: e = Q[x] - x
Rounding versus truncation Truncation: -2-b < Q[x] – x <= 0 Example: 010111 -> 0101 Rounding: -2-b/2 < Q[x] – x <= 2-b/2 Example: 010111 ->0110
Statistical model • Additive error model: The quantized signal is the sum of the original signal and a quantization noise signal e(t)
Fixed point representation • Two’s complement fractional representation: • Dynamic range: • Advantage of fractional: Multiplier can not overflow(except for (-1).(-1))
Two’s complement fractional • Example b=3
Two’s complement arithmetic (1) • Addition: • Addition can lead to an overflow. Need to scale the input. • If no overflow x+y can be represented exactly with b+1 bits. Example • In a filter check the scaling (max/min signal values) at the output of each adder. • An adder does not inject quantization noise
Two’s complement arithmetic's (2) • Multiplication: • If coefficient is not –1, multiplier can not overflow • x,y represented with b+1 bits -> x.y is exactly represented with 2b+1 bits Example: • If the multiplier output is forced into a register of lenght < 2b+1 it introduces a quantization noise whose max amplitude is 1 lsb (truncation) or +- ½ lsb (rounding).
Multiplier model • If b3 <b1+b2-1 the truncation or rounding of the multiplier output is modeled as an additive noise e(n)
First-order IIR example • Feedback path -> register size at multiplier output can not be increased at each iteration! Problem with IIR filters • Noise e2(n) is amplified by the feedback loop (a is close to 1). We will choose b2 >b1 • Filter design: compute the PSD at the filter output due to each quantization noise. Statistics on e(n) needed
First order statistics (1) • e(n) is a random process = signal that can, for each time index n, be described as a random variable e • Probability Density Function pe(u) pe(u).De = probability that the random variable e be in the interval [u,u+Du] • Uniform PDF: pe(u) is constant over a range W and zero elsewhere. Recall that the total area underneath pe(u) must integrate to 1 Truncation Rounding
First order statistics (2) • The hypothesis that the quantization error is uniform does not hold if the input signal covers less than 1 lsb! It is assumed valid if the signals in all registers of the filter cover a significant portion of the register dynamic range. • Mean: DC component of the noise • Variance: total AC power of the noise
Second order statistics • Power Spectral Density of a random process e(n): See(ejω) d ω = power in the band d ω centered at ω In z domain, power spectral density PSD when there is only one noise input is defined as: PSD, when there are K noise inputs, is
Quantization noise • One noise source e(n) is fed into a linear filter and the output is f(n) • Mean: • Power Spectrum:
Quantization noise • Variance: • Special case if e(n) is white We will assume that the quantization noise e(n) is white