EE 5345 Biomedical Instrumentation Lecture 1: slides 4-6 Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University slides can be viewed at: http:// www.seas.smu.edu/~cd/ee5345.html EE 7345/5345, SMU Electrical Engineering Department, 000 4
Assumptions for Quantizer SNR: SNR Quantization error is stationary, white noise: = x N 3 X max σ σ E[ e[ n] e[ n m] ] e, m = 0 + = 0, m 0 Quantization error is uncorrelated with the input signal: [ [ ] [ ]] E x n e n + m = 0, m Quantization error is uniformly distributed on, EE 5345, SMU Electrical Engineering Department, 1996 43
Derivation of Quantizer SNR Quantizer input range is X max, step height is: = X max N Since e[n] is uniformly distributed: σ e Xmax N = = 1 3 EE 5345, SMU Electrical Engineering Department, 1996 44
Derivation of Quantizer SNR (cont.) substituting into SNR = σ gives: σ e σ e x If Xmax = 4σ SNR = x then: x N 3 X max σ SNR( db) = 6N 7. EE 5345, SMU Electrical Engineering Department, 1996 45
Differential Quantization Coder x[ n] + d[ n] + Q[ ] _ $[ ] d n encoder c[ n] ~ [ ] x n P(z) φ[ n] + EE 5345, SMU Electrical Engineering Department, 1996 46
Analysis of Differential Quantization P(z) is a prediction filter, tries to predict the present value of x[n] based on previous values of φ[n] prediction error: quantizer output: d[ n] = x[ n] x~ [ n ] d$[ n] = d[ n] + e[ n] (1) () predictor input: quantization error φ[ n] = ~ x [ n ] + d$[ n] (3) EE 5345, SMU Electrical Engineering Department, 1996 47
Analysis of Differential Quantization (cont.) subst. (1) and () in (3) gives: φ[ n] = x[ n] + e[ n] x$[ n] φ[n] is a quantized version of x[n] but the quantization error e[n] corresponds to quantizing the prediction error, d[n], which is typically small if the prediction is good, so e[n] is small! EE 5345, SMU Electrical Engineering Department, 1996 48
Differential Quantization SNR SNR = σ x σ e SNR x d d e σ σ = = σ σ G SNR P Q SNR of quantizer: SNR Q d = σ σ e SNR gain due to DQ: G P x = σ σ d (typically 4-11 db) EE 5345, SMU Electrical Engineering Department, 1996 49
Prediction Filter P( z) = p α k= 1 k z k (length p FIR filter) prediction filter difference equation: p ~ x[ n] = α x$[ n k] k= 1 k If the x[n] are highly correlated, then the prediction can be very good, keeping the prediction error and quantization error small. EE 5345, SMU Electrical Engineering Department, 1996 50
Differential Quantization Decoder c[ n] decoder d$[ n ] x$[ n] + ~ [ ] x n P(z) EE 5345, SMU Electrical Engineering Department, 1996 51
Delta Modulation (DM) Coder x[ n] + d[ n] + Q[ ] _ $[ ] d n encoder c[ n] ~ [ ] x n αz 1 x$[ n] + EE 5345, SMU Electrical Engineering Department, 1996 5
Delta Modulation Decoder c[ n] decoder d$[ n ] x$[ n] + ~ [ ] x n αz 1 EE 5345, SMU Electrical Engineering Department, 1996 53
Delta Modulation Uses a 1-Bit Quantizer $[ ] d n c[ n] = 1 d[ n] c[ n] = 0 EE 5345, SMU Electrical Engineering Department, 1996 54
DM Encoder and Decoder $[ ] d n c[n] 1-0 c[n] d$[ n] 1 0 - encoder decoder EE 5345, SMU Electrical Engineering Department, 1996 55
Delta Modulation (cont.) Need only store 1 bit per sample. If a 1-bit quantizer is used, to get good performance, prediction error must be very small. To get small prediction error, must sample ECG at a high rate. Typically many times the Nyquist rate. EE 5345, SMU Electrical Engineering Department, 1996 56
Selection of Decoder difference equation: x$[ n] = α x$[ n 1] + d$[ n] If α 1 then decoder approximates an integrator that accumulates positive or negative increments of magnitude. quantizer input: d[ n] = x[ n] x$[ n 1] = x[ n] x[ n 1] e[ n 1] resembles a discrete-time differentiation. EE 5345, SMU Electrical Engineering Department, 1996 57
Selection of (cont.) Therefore in order for the integrator to be able to track x[n]: T dx( t) max dt T = sampling interval otherwise, get slope overload distortion. EE 5345, SMU Electrical Engineering Department, 1996 58
Slope Overload Distortion x(t) x$[ n] 0 T T 3T 4T 5T 6T 7T 8T 9T 10T t c[n]: 1 1 1 1 1 1 1 0 1 0 1 EE 5345, SMU Electrical Engineering Department, 1996 59
Differential Pulse Code Modulation (DPCM) Predictor filter (p = 4 or 5): P( z) = p α k= 1 k z k Quantizer generally has more than one level. Prediction filter coefficients can be chosen to minimize the mean squared prediction error: [ ] [ [ ] = ( [ ] ~ [ ] ) E d n E x n x n EE 5345, SMU Electrical Engineering Department, 1996 60
Linear Prediction Prediction error: d[ n] = x[ n] α x$[ n k] k= 1 We can ignore the quantization error if it is small, prediction error becomes: d[ n] = x[ n] α x[ n k] p p k= 1 k k EE 5345, SMU Electrical Engineering Department, 1996 61
Least Squares Linear Prediction Assume the following M data samples are available: x[0], x[ 1], x[], K, x[ M 1] Least squares normal equations: Xα = x α = [ α α α ] T 1 L p EE 5345, SMU Electrical Engineering Department, 1996 6