ELEN E4810: Digital Signal Processing Topic 11: Continuous Signals 1. Sampling and Reconstruction 2. Quantization 1
1. Sampling & Reconstruction DSP must interact with an analog world: A to D D to A x(t) x[n] y[n] y(t) ADC DSP DAC Antialias filter Sample and hold Reconstruction filter Sensor WORLD Actuator 2
Sampling: Frequency Domain Sampling: CT signal DT signal by recording values at sampling instants : Discrete What is the relationship of the spectra? i.e. relate and g n [ ] = g a ( nt) G a Continuous Sampling period T samp.freq. T = 2π/T rad/sec ( j) = g a ( t)e jt dt G(e jω ) = in rad/second 3 g[ n]e jωn ω in rad/sample CTFT DTFT
CT delta fn Sampling DT signals have same content as CT signals gated by an impulse train: g a (t) p(t) = δ t nt n= t ( ) T 3T g p (t) = g a (t) p(t) is a CT signal with the same information as DT sequence g[n] t g p (t) sampled signal: still continuous - but discrete values t 4
Spectra of sampled signals Given CT Spectrum G p g p t ( j) = F g p t Compare to DTFT ( ) = g a ( nt) δ( t nt) n= n { ( )} = g a nt n G p ( j) = g a ( nt)e jnt ( )F δ t nt { ( )} by linearity ( ) = g n G e jω n [ ]e jωn i.e. G( e jω ) = G p ( j) T =ω π /Τ = T /2 π ω 5
Spectra of sampled signals Also, note that But so p t ( ) = 1 T p t n ( ) = δ( t nt) is periodic, thus has Fourier Series: e j 2π Qc ( T )kt k = 1 T /2 T T /2 k= F e j 0 t x t ( ) G p = 1 T { } = X j 0 j k p( t)e j2πkt /T dt ( ( )) shift in ( ) ( ) = T 1 G a j( k T ) frequency - scaled sum of shifted replicas of G a (j) by multiples of sampling frequency T 6
So: g a t p t = CT and DT Spectra or ( ) = G p j k G( e jt ) = T 1 G a j k T G e jω DTFT ( ) G a ( j) ( ) P( j) g p t g n ( ) G p ( j) ( ) [ ] G e jω ( ) T =ω = 1 T G a j ω T k 2π k M Μ 2 Τ Τ M/T 4π 2π T 7 ( ( )) ( ( )) Μ T CTFT g a (t) is bandlimited @ Μ Τ 2 Τ shifted/scaled copies @ = T = 2π ω = = 2π T 2π 4π ω
Aliasing Sampled analog signal has spectrum: G p (j) G a (j) Τ Μ Μ Τ + Μ Τ Μ g a (t) is bandlimited to ± M rad/sec When sampling frequency T is large... no overlap between aliases can recover g a (t) from g p (t) by low-pass filtering alias of baseband signal 8 Τ
The Nyquist Limit If bandlimit M is too large, or sampling rate T is too small, aliases will overlap: G p (j) Τ Spectral effect cannot be filtered out cannot recover g a (t) Avoid by: Μ Τ Μ Μ Τ Sampling theorum T M M T 2 M i.e. bandlimit g a (t) at T 2 Nyquist frequency 9
Anti-Alias Filter To understand speech, need ~ 3.4 khz 8 khz sampling rate (i.e. up to 4 khz) Limit of hearing ~20 khz 44.1 khz sampling rate for CDs Must remove energy above Nyquist with LPF before sampling: Anti-alias filter A to D Anti-alias filter Sample & hold ADC 10 space for filter rolloff M
Sampling Bandpass Signals Signal is not always in baseband around = 0... may be some higher : M Η L L H Bandwidth Δ = H L If aliases from sampling don t overlap, no aliasing distortion, can still recover M/T T T /2 Basic limit: T /2 bandwidth Δ T 2 T 11
Reconstruction To turn g[n] back to g^ a (t): make a continuous impulse train g^ p (t) lowpass filter to extract baseband g^ a (t) g[n] n g^ p (t) t g^ a (t) t G a (e jω ) π G p (j) G a (j) Ideal reconstruction filter is brickwall Τ /2 i.e. sinc - not realizable (especially analog!) use something with finite transition band... ^ ^ ω 12
2. Quantization Course so far has been about discrete-time i.e. quantization of time Computer representation of signals also quantizes level (e.g. 16 bit integer word) Level quantization introduces an error between ideal & actual signal noise Resolution (# bits) affects data size quantization critical for compression smallest data coarsest quantization 13
Quantization Quantization is performed in A-to-D: Quantization has simple transfer curve: Quantized signal { } x ˆ = Q x Quantization error e = x x ˆ 14
Quantization noise Can usually model quantization as additive white noise: i.e. uncorrelated with self or signal x x[n] + - e[n] x[n] ^ bits cut off by quantization; hard amplitude limit 15
Quantization SNR Common measure of noise is Signal-to-Noise ratio (SNR) in db: 2 σ SNR =10 log x 10 σ db 2 e signal power noise power When x >> 1 LSB, quantization noise has ~ uniform distribution: σ e 2 = ε2 12 (quantizer step = ε) 16
Quantization SNR Now, σ 2 x is limited by dynamic range of converter (to avoid clipping) e.g. b+1 bit resolution (including sign) output levels vary -2 b ε.. (2 b -1)ε = R FS where full-scale range 2.. R FS 2 ε R FS = 2 b+1 ε 2 σ SNR =10log x 10 2 R FS 2 2b 4 12 = 6b +16.8 20log 10 R FS σ x 2 i.e. ~ 6 db SNR per bit 17 depends on signal ( )
Coefficient Quantization Quantization affects not just signal but filter constants too.. depending on implementation.. may have different resolution Some coefficients are very sensitive to small changes e.g. poles near unit circle high-q pole becomes unstable 18