Digital Signal Processing Lecture 9 Discrete-Time Processing of Continuous-Time Signals Alp Ertürk alp.erturk@kocaeli.edu.tr
Analog to Digital Conversion Most real life signals are analog signals These analog signals are converted into digital signals for processing This conversion process consists of sampling, quantization and coding steps. Sampling is the the process of taking periodic samples from the continuous-time analog signal
Analog to Digital Conversion Sampling converts a continuous-time signal into a discretetime signal, but not into a digital signal This is because discrete-time signal can have an infinite number of amplitude values Quantization is the process of converting each amplitude value to the nearest of the predetermined amplitude values After representing each amplitude level by a code, the digital signal is obtained
Analog to Digital Conversion It is desired that the analog to digital conversion results in no loss of information from the signal For this, the number of samples has to be large enough However, a larger number of samples also means an increase in computation time Therefore, the smallest number of samples that do not cause an information loss is preferred. The sampling frequency that corresponds to this number is called the minimum sampling frequency
Analog to Digital Conversion The sampling process is defined as follows: x n = x a (nt s ), < n <, n integer T s is the sampling period f s = 1/T s is the sampling frequency
Ideal Impulse Sampling In an ideal sampling process, the analog signal is multiplied by an impulse train to take the instantaneous signal values x a (t) x s (t) i t = n= δ(t nt s )
Ideal Impulse Sampling Therefore the sampled signal is: x s t = x a t i t t = n= x a t δ(t nt s ) = n= x a nt s δ(t nt s )
Ideal Impulse Sampling
Ideal Impulse Sampling To determine the minimum sampling frequency, the frequency spectrum should be examined to observe whether there is a loss in the signal or not Note that multiplying two signals in time domain results in a convolution in the frequency domain Let s remember continuous-time Fourier transform
Ideal Impulse Sampling p t = e jω 0t CTFT 2πδ ω ω0 p t = k= a k e jkω 0t CTFT k= 2πa k δ ω kω 0 k= a k e jω0t is the Fourier series expansion for a periodic signal p(t). The coefficient are obtained as: a k = 1 T 0 T0 p(t) e jkω 0t dt
Ideal Impulse Sampling For the impulse train, these coefficients are: T s /2 a k = 1 T s Ts/2 n= δ(t nt s ) e jkω st dt T s /2 = 1 T s Ts/2 δ(t)e jkω st dt = 1 T s
Ideal Impulse Sampling The Fourier transform of an impulse train is also an impulse train defined in the integer multipliers of the sampling frequency δ(t nt s ) CTFT 2π n= T s n= δ(ω nω s ) In the frequency domain, sampling results in: X s ω = 1 2π X a ω 2π T s n= δ(ω nω s )
Ideal Impulse Sampling X s ω = 1 2π X a ω 2π T s n= δ(ω nω s ) = 1 T s n= X a (ω nω s ) The sampled signal s frequency spectrum is the frequency spectrum of the analog signal repeated at integer multipliers of the sampling frequency
Ideal Impulse Sampling Bandlimited signal 1 Xc j b 0 b 2 s s 0 P j s 2π/Ts X j s 2 s
Ideal Impulse Sampling ω s = 2ω m 1/Ts Xs j ω s < 2ω m 2 s s 1/Ts 0 X s j s 2 s Aliasing! ω s > 2ω m 2 s s 1/Ts 0 X s s j 2 s 2 s s 0 s 2 s
Ideal Impulse Sampling If the sampling frequency is exactly two times the maximum frequency component of the analog signal, then there is no overlap between the frequency components of the sampled signal, and no empty spaces between the frequency bands If the sampling frequency is larger than two times the maximum frequency component of the analog signal, then there is no overlap between the frequency components of the sampled signal, and there are empty spaces between the frequency bands
Ideal Impulse Sampling If the sampling frequency is smaller than two times the maximum frequency component of the analog signal, then the frequency components of the sampled signal overlap. In this case, there will be distortion in the time domain. This is caused when the number of samples is not enough to represent the signal accurately This is called aliasing
Ideal Impulse Sampling The condition that the sampling frequency is two times or larger than the maximum frequency component of the analog signal is named the Nyquist criterion The analog signal can be reconstructed from the sampled signal by a low-pass filter if it has been sampled according to the Nyquist criterion Hr j T s Xs j s 2 b 1/Ts 2 s s c 0 c s 2 s
CT to DT Conversion Continuous-time to discrete-time conversion can be considered as a multiplication by an impulse train, followed by a dicrete series converter for the impulse train The signal resulting from multiplying by an impulse train is: x s t = x c nt s δ(t nt s ) n=
CT to DT Conversion In frequency domain: X s ω = x s (t)e jωt dt = x c nt s δ(t nt s ) e jωt dt n= = n= x c nt s δ(t nt s )e jωt dt = n= x c nt s e jωnt s
CT to DT Conversion Note that: X s ω = n= x c nt s e jωnt s X e jω = n= x[n]e jωn = n= x c nt s e jωn In other words: X e jω = X s ω ω=ω/ts
CT to DT Conversion This can also be represented as: X e jω = X s ω ω=ω/ts = 1 T s k= X c (ω kω s ) ω=ω/ts = 1 T s k= X c Ω T s k 2π T s
CT to DT Conversion Ideal impulse sampled signal spectrum: j ω s > 2ω m 1/Ts Xs 2 s s 0 b s 2 s Discrete-time signal spectrum: ω s > 2ω m X e jω 1/Ts 4 2 T 0 2 4 b s
CT to DT Conversion
DT to CT Conversion x[n] Convert from sequence to impulse train x s (t) Ideal reconstruction filter H r (jω) x(t) Hr j T s Xs j s 2 b 1/Ts 2 s s c 0 c s 2 s
DT to CT Conversion h r t sin t/ T t/ T s s
DT to CT Conversion A sampled continuous-time signal obtained from the discrete-time values is obtained as: x s t = n= x[n]δ(t nt s ) The continuous-time signal is obtained as: x c t = x s t h R (t) = x s (τ)h R (t τ)dτ
DT to CT Conversion A sampled continuous-time signal obtained from the discrete-time values is obtained as: x s t = n= x[n]δ(t nt s ) The continuous-time signal is obtained as: x c t = x s t h R (t) = x s (τ)h R (t τ)dτ
DT to CT Conversion x c t = x s (τ)h R (t τ)dτ = n= x[n]δ(τ nt s ) h R (t τ)dτ = n= x[n] δ(τ nt s )h R (t τ)dτ = n= x[n]h R (t nt s )
DT to CT Conversion An ideal reconstruction filter will have the impulse response: h R t = T s sin ω c t πt Then, x c t = n= x[n]h R (t nt s ) = n= x[n] sin π t nt s /T s π t nt s /T s = n= x n sinc t nt s /T s
DT to CT Conversion x c t = n= x n sinc t nt s /T s
Practical Limitations in Sampling There are three main practical limitations in this scheme 1) An ideal impulse train cannot be obtained in practice. Instead of an impulse train, a pulse train is commonly used. In other words, natural sampling or sample-and-hold sampling is used in practice instead of impulse sampling 2) An ideal filter cannot be obtained in practice. Because of this, the cut-off frequency of the filter is not sufficient to prevent aliasing when ω s = 2ω m as shown in the figure in the next slide
Practical Limitations in Sampling Because of this, in practice, the sampling should be conducted at a higher sampling frequency than the Nyquist rate.
Practical Limitations in Sampling 3) The signals used in practice are commonly time-limited and therefore cannot be band-limited. Signals that are not band limited result in aliasing in the frequency spectrum when sampled. To overcome this limitation, an anti-aliasing filter is used prior to sampling, in order to make the signal band-limited.
DT Processing of CT Signals Discrete-time processing of continuous-time signals enables the continuous-time signals to benefit from the advantages of discrete-time systems For this purpose, continuous-time signals are first converted to discrete-time, then processed in discrete-time systems, and finally the resulting signal is converted back into continuous-time
DT Processing of CT Signals As an example, let s consider a band-limited continuoustime signal, x(t), and apply this signal to a discrete-time ideal low-pass filter Let s consider a frequency spectrum such as the one below for x(t) ω m 0 ω m
DT Processing of CT Signals Then, if we sample this signal with a sampling frequency larger than the Nyquist rate, i.e. ω s > 2ω m, the sampled signal x s (t) s frequency spectrum becomes: ω s ω m 0 ω m ω s In discrete-time, x s [n] s frequency spectrum: X(e jω ) -2π 0 ω m T s π 2π 4π
DT Processing of CT Signals After that, let us consider the frequency response of the ideal low-pass filter with the cut-off frequency of Ω c 1 j H e c 0 The filtered signal y[n] s frequency spectrum then becomes: c
DT Processing of CT Signals If the discrete-time signal y s [n] is converted back into a continuous-time signal, the frequency spectrum becomes: T s Y s (ω) 1/ Ts 4 T s 2 T s T s T s c 0 T s c T s 2 4 T s T s
DT Processing of CT Signals When this signal is passed through a continuous-time reconstruction filter with a cut-off frequency ω c = π/t s, the following frequency spectrum is obtained: 1 Y(ω) T s c 0 c T s
DT Processing of CT Signals Example: An analog tv signal has a bandwidth of 5MHz. This signal is converted to discrete-time in 11 MHz sampling frequency, and processed through a discrete-time lowpass filter. If it is desired to cut off frequency components of the signal with higher frequencies than 3 MHz, what should be the cut-off frequency of the filter? f m = 5MHz f c = 3MHz ω m = 10π 10 6 rad/s ω c = 6π 10 6 rad/s ω c = Ω c T s Ω c = ω c T s = ω c f s = 6π 106 11 10 6 = 6π 11
DT Processing of CT Signals Example: The ideal continuous-time differentiator system is defined by y c t = d dt x c(t) The corresponding frequency response is: H c jω = jω For processing band-limited signals, let us limit this to: H eff jω = jω, ω < π/t 0, ω π/t
DT Processing of CT Signals Example (continued): The corresponding discrete-time has the frequency : H c jω = jω T, Ω < π Suppose that this differentiator has the input x c t = cos ω 0 t with ω 0 < π/t The sampled input will be x n = cos Ω 0 n, Ω 0 = ω 0 T < π
DT Processing of CT Signals Example (continued): CTFT of x c t : X e jωt = 1 T k= πδ ω ω 0 kω s + πδ ω + ω 0 kω s Bandlimiting, we get: X e jωt = π T δ ω ω 0 + δ ω + ω 0, ω < π T
DT Processing of CT Signals Example (continued): X e jωt = π T δ ω ω 0 + δ ω + ω 0, ω < π T DTFT of x[n]: X e jω = π δ Ω Ω 0 + δ Ω + Ω 0, Ω < π The output: Y e jω = H e jω X e jω
DT Processing of CT Signals Example (continued): Y e jω = H e jω X e jω = jω T π δ Ω Ω 0 + δ Ω + Ω 0 = jω 0π T δ Ω Ω 0 jω 0π T δ Ω + Ω 0, Ω < π
DT Processing of CT Signals Example (continued): In continuous-time: Y r e jω = H r jω Y e jωt = TY e jωt = T jω 0π T δ ΩT Ω 0T jω 0π T δ ΩT + Ω 0T = jω 0 πδ ω ω 0 jω 0 πδ ω + ω 0 y r t = jω 0 1 2 ejω 0t jω 0 1 2 e jω 0t = ω 0 sin ω 0 t
Impulse Invariance x(t) H(e jω ) y(t) x(t) H s (ω) y(t)
Impulse Invariance At the output of the LTI discrete-time system, we have: Y e jω = X e jω H e jω At the output of the D/C converter, we have: Y ω = H R e jω Y e jω Ω=ωTs = H R e jω X e jω H e jω Ω=ωTs x[n] and x(t) are related in frequency as: X e jω = 1 T s k= X(ω kω s ) Ω=ωTs
Impulse Invariance The spectrum of the continuous-time y(t) is: Y ω = H R e jω 1 X(ω kω T s ) H e jω Ω=ωTs s k= The ideal reconstruction filter will have a cut-off frequency at ω c = π/t s, therefore only the frequency component at k=0 will pass: Y ω = H ejω Ω=ωTs X(ω) ω < π/t s 0 ω π/t s
Impulse Invariance Y ω = H ejω Ω=ωTs X(ω) ω < π/t s 0 ω π/t s Therefore, the continuous-time system has the frequency response: H s ω = H ejω Ω=ωTs ω < π/t s 0 ω π/t s
Impulse Invariance The discrete-time signal x n = x s (nt s ) is related to x s (t) in frequency as: X e jω = 1 X(ω kω T s ) s k= ω=ω/ts x s (t) is related to x n in frequency as: X s ω = T sx e jω Ω=ωTs ω < π/t s 0 ω π/t s The impulse responses are related by: h n = T s h s (nt s )
Changing Sampling Rate with DT Processing In order to change the sampling rate of a discrete-time signal, 1) The discrete-time signal can be converted into a continuous-time signal, which is then sampled at a different rate to convert into discrete-time 2) A discrete-time system can be directly used to change the sampling rate. This option is often preferred in practice
Changing Sampling Rate with DT Processing Decreasing the sampling rate in integer multipliers: x a n = x Mn = x MnT s The signal will be sampled by MT s period, instead of T s Down-sampling May result in information loss!
Changing Sampling Rate with DT Processing
Changing Sampling Rate with DT Processing The frequency spectrums will be: X e jω = 1 T s k= X(ω kω s ) ω=ω/ts X a e jω = 1 MT s k= X(ω kω s ) ω=ω/mts MΩ m should be smaller than or equal to π to prevent aliasing while down-sampling
Changing Sampling Rate with DT Processing X e jω Without aliasing: X a e jω With aliasing:
Changing Sampling Rate with DT Processing To prevent aliasing, a lowpass filter with a cut-off frequency of ω c = π/m is often used prior to down-sampling
Changing Sampling Rate with DT Processing x[n] Lowpass filter Ω c = π/m x f n M x a n = x f [nm]
Changing Sampling Rate with DT Processing Increasing the sampling rate in integer multipliers: x y n = x n/l, n = 0, ±L, ±2L, However, we need signal values at other n values also! First, let s consider the signal obtained as: x g n = x n/l n = 0, ±L, ±2L, 0 otherwise = k= x k δ[n kl]
Changing Sampling Rate with DT Processing The frequency spectrums will be related by: X g e jω = X e jωl
Changing Sampling Rate with DT Processing Then, we can use a lowpass filter with a gain of L and a cut-off frequency of ω c = π/l in order to obtain:
Changing Sampling Rate with DT Processing X e jω = 1 T s k= X(ω kω s ) ω=ω/ts X a e jω = L T s k= X(ω kω s ) ω=ωl/ts This process results in interpolation in the time-domain
Changing Sampling Rate with DT Processing x[n] L x g n Lowpass filter Gain = L Ω c = π/l x y n
Changing Sampling Rate with DT Processing Changing the sampling rate in a non-integer multiplier: This process can be considered as upsampling by L, and then downsampling by M, where L/M gives us the non-integer multiplier The process can be represented as: x[n] L x g n x y n Lowpass filter Gain = L Ω c = π/l Lowpass filter Ω c = π/m x f n M x a n
Changing Sampling Rate with DT Processing x[n] L x g n x y n Lowpass filter Gain = L Ω c = π/l Lowpass filter Ω c = π/m x f n M x a n Which can also be represented as: L Lowpass filter Gain = L Ω c = min( π L, π M) M
DT Processing of CT Signals Example: A music file has been sampled at f s = 32KHz. We want to list to this music file with a speech card operating at the frequency 12KHz. Assuming ideal filters, design the discrete-time system which makes the necessary sampling rate variation. f s f s = 12 32 = 3 8 Lowpass filter 3 Gain = 3 8 Ω c = π 8