Digital Signal Processing Moslem Amiri, Václav Přenosil Masaryk University Understanding Digital Signal Processing, Third Edition, Richard Lyons (0-13-261480-4) © Pearson Education, 2011. Periodic Sampling 2 Periodic Sampling  Periodic sampling  Process of representing a continuous signal with a sequence of discrete data values  In practice, sampling is performed by applying a continuous signal to an analog-to-digital (A/D) converter  Primary concern is how fast a given continuous signal must be sampled to preserve its information content 3 Aliasing  Example: given following sequence of values  They represent values of a time-domain sinewave taken at periodic intervals  Draw that sinewave 0=x(6)0.866,-=x(5)0.866,-=x(4)0,=x(3)0.866,=x(2)0.866,=x(1)0,=x(0) 4 Aliasing 5 Aliasing  Frequency ambiguity  If data sequence represents periodic samples of a sinewave, we cannot unambiguously determine frequency of sinewave from those sample values alone 6 Aliasing  Mathematical origin of frequency ambiguity  When sampling at a rate of fs samples/second, if k is any positive or negative integer, we cannot distinguish between sampled values of a sinewave of fo Hz and a sinewave of (fo+kfs) Hz ))(2sin()2sin()( ))(2sin()( ))(2sin()22sin()2sin()( )2sin()( /1 if ssoso tf s s o knm s s ososo o ntkffntfnx nt t k fnx nt nt m fmntfntfnx tftx ss             7 Aliasing  Frequency ambiguity (aliasing) effects  Spectrum of any discrete series of sampled values contains periodic replications of original continuous spectrum  Period between these replicated spectra in frequency domain is always fs  Spectral replications repeat all the way in both directions of frequency spectrum 8 Aliasing fo = 7 kHz, fs = 6 kHz k = −1  fo+kfs = [7+(−1·6)] = 1 kHz No processing scheme can determine if sequence of sampled values came from a 7 kHz or a 1 kHz sinusoid 1 kHz is an alias of 7 kHz fo = 4 kHz, fs = 6 kHz k = −1  fo+kfs = [4+(−1·6)] = −2 kHz fs/2 is an important quantity, referred to by critical Nyquist, half Nyquist, or folding frequency we’re interested in signal components that are aliased into frequency band between −fs/2 and +fs/2 9 Aliasing 10 Sampling Lowpass Signals 11 Sampling Lowpass Signals  Fig. 2-4(a)  Spectrum of a continuous real-valued lowpass x(t) signal  Spectrum is symmetrical around zero Hz  Signal is band-limited  Its spectral amplitude is zero above +B Hz and below −B Hz  x(t) time signal is called a lowpass signal because its spectral energy is low in frequency  Spectrum of a continuous signal cannot be represented in a digital machine in its current band-limited form  replicated form of (b) 12 Sampling Lowpass Signals  Nyquist criterion  fs ≥ 2B, to separate spectral replications at folding frequencies of ±fs/2  Fig. 2-4(c)  Sampling frequency is lowered to fs = 1.5B Hz  Lower edge and upper edge of spectral replications centered at +fs and −fs now lie in band of interest  Equivalent to original spectrum folding to left at +fs/2 and folding to right at −fs/2  Spectral information in bands of −B to −B/2 and B/2 to B Hz is corrupted (aliasing errors) 13 Sampling Lowpass Signals  A key property of band ±fs/2 Hz  Entire spectral content (any signal energy located above +B Hz and below −B Hz) of original continuous spectrum always ends up in band of interest between −fs/2 and +fs/2 after sampling, regardless of sample rate  For this reason, continuous (analog) lowpass filters are necessary in practice 14 Sampling Lowpass Signals 15 Sampling Lowpass Signals 16 Sampling Bandpass Signals  Bandpass sampling  A technique to sample a continuous bandpass signal that is centered about some frequency other than zero Hz  Reduces speed requirement of A/D converters below that necessary with traditional lowpass sampling  Reduces amount of digital memory necessary to capture a given time interval of a continuous signal  We’re more concerned with a signal’s bandwidth than its highest-frequency component 17 Sampling Bandpass Signals negative frequency portion of signal is mirror image of positive frequency portion (real signal) highest-frequency = 22.5 MHz Nyquist criterion  sampling frequency must be a minimum of 45 MHz if fs = 17.5 MHz, spectral replications are located exactly at baseband sampling at 45 MHz was unnecessary to avoid aliasing— instead we’ve used spectral replicating effects to our advantage 18 Sampling Bandpass Signals  Sampling translation  Bandpass sampling performs digitization and frequency translation in a single process  We can sample at some still lower rate and avoid aliasing 19 Sampling Bandpass Signals 20 Sampling Bandpass Signals  Fig. 2-8(a)  Continuous input bandpass signal of bandwidth B  Carrier frequency (signal is centered at) = fc Hz  Sample rate = fs′ Hz  spectral replications of positive and negative bands, Q and P, butt up against each other at zero Hz  m = an arbitrary number of replications in the range of 2fc − B  m can be any positive integer so long as fs′ is never less than 2B m Bf fBfmf c scs   2 or2 '' 21 Sampling Bandpass Signals  Fig. 2-8  If fs′ is increased, original spectra (bold) do not shift, but all replications will shift  At zero Hz, P band shifts to right, and Q band shifts to left  These replications will overlap and aliasing occurs  Thus, for an arbitrary m, there is a frequency that sample rate must not exceed m Bf f c s   2 ' 22 Sampling Bandpass Signals  Fig. 2-8(b) and (c)  If we reduce sample rate below fs′ shown in (a), spacing between replications will decrease in direction of arrows in (b)  Original spectra do not shift  At some sample rate fs″ (fs″ < fs′), replication P′ will butt up against positive original spectrum at fc as shown in (c)  fs″ decreased  aliasing occurs 1 2 or2)1( ''''    m Bf fBffm c scs 1 2 ''    m Bf f c s 23 Sampling Bandpass Signals  To avoid aliasing, fs may be chosen anywhere in the range (1)  m is an arbitrary, positive integer ensuring fs ≥ 2B 1 22     m Bf f m Bf c s c 24 Sampling Bandpass Signals  Example (Fig. 2-7(a))  fc = 20 MHz, B = 5 MHz  Sample rates below 11.25 MHz unacceptable  Will not satisfy Eq. (1) as well as fs ≥ 2B  Optimum sampling frequency is the frequency where spectral replications butt up against each other at zero Hz m (2fc-B) / m (2fc+B) / (m+1) Optimum sampling rate 1 35.0 MHz 22.5 MHz 22.5 MHz 2 17.5 MHz 15.0 MHz 17.5 MHz 3 11.66 MHz 11.25 MHz 11.25 MHz 4 8.75 MHz 9.0 MHz --- 5 7.0 MHz 7.5 MHz --- 25 Sampling Bandpass Signals 26 Practical Aspects of Bandpass Sampling  Spectral Inversion in Bandpass Sampling  Some of permissible fs values from Eq. (1) provide a sampled baseband spectrum (located near zero Hz) that is inverted from original analog signal’s positive and negative spectral shapes  Happens when m, in Eq. (1), is an odd integer  We can invert spectrum back to its original orientation  Discrete spectrum of any digital signal can be inverted by multiplying signal’s discrete-time samples by (−1)n  Center of flipping is fs/4 Hz (and −fs/4 Hz)  When original positive spectral bandpass components are symmetrical about fc frequency, spectral inversion presents no problem 27 Practical Aspects of Bandpass Sampling 28 Practical Aspects of Bandpass Sampling  Positioning sampled spectra at fs/4  In many signal processing applications it is useful to use an fs bandpass sampling rate that forces sampled spectra to be centered exactly at ±fs/4  To ensure that sampled spectra reside at ±fs/4, select fs using ,...3,2,1where, 12 4    k k f f c s 29 Practical Aspects of Bandpass Sampling  Noise in bandpass-sampled signals  Signal-to-noise ratio (SNR) is ratio of power of a signal over total background noise power  Negative aspect of bandpass sampling  SNR of digitized signal is degraded  All of background spectral noise (Fig. 2-11(b)) resides in range of −fs/2 to fs/2 (Fig. 2-11(c))  Bandpass-sampled background noise power increases by a factor of m + 1 (denominator of right-side ratio in Eq. (1)) while signal power P remains unchanged  Bandpass-sampled signal’s SNR is reduced by below SNR of original analog signal dBmDSNR )1(log10 10  30 Practical Aspects of Bandpass Sampling