PEMP ESD2521
Session Objectives
To understand basics operation on signals To understand the Time-Domain Characterization of LTI system To understand the effects of under sampling and over sampling To understand the concept of convloution To review on Time domain and Frequency domain signals
PEMP ESD2521
Session Topics
Types of Signals Discrete time Systems Sampling Signal processing Aliasing
PEMP ESD2521
Basic Sequences
1, n 0 [ n] = 0, n < 0
n
4
PEMP ESD2521
Basic Sequences Real sinusoidal sequence x[n] = A cos(o n + ) where A is the amplitude, o is the angular frequency, and is the phase of x[n] Example = 0.1
o
2 1 Amplitude 0 -1 -2
10
20 Time index n
30
40
PEMP
Basic Sequences
n
ESD2521
, =e where A and are real or complex numbers If we write A = A e j , x[n] = then we can express xre [n] = A e
o n j ( o + jo ) n Ae e
( o + jo )
cos(o n + ),
PEMP ESD2521
Basic Sequences
1 0.5
xre [n]
Amplitude
0 -0.5 -1
and xim [n] of a complex exponential (o = 0) sequence are real sinusoidal sequences with(o > 0) constant (o < 0), growing and decaying Imaginary part amplitudes for n > 0 1
Real part 10
Amplitude
20 Time index n
30
40
0.5 0 -0.5 -1
10
20 Time index n
30
40
x[n] = exp( + j 6 )n
1 12
M.S. Ramaiah School of Advanced Studies, Bengaluru 7
PEMP ESD2521
Basic Sequences
Real exponential sequence where A and a are real numbers
x[ n] = A n ,
< n <
= 1.2 50 40
= 0.9 20 15
Amplitude
20 10 0 0 5 10 20 15 Time index n 25 30
Amplitude
30
10 5 0 0
10
15 20 Time index n
25
30
PEMP ESD2521
Basic Sequences
Sinusoidal sequence A cos(o n + ) and complex exponential sequence B exp( jo n) are periodic sequences of period N if o N = 2r where N and r are positive integers Smallest value of N satisfying o N = 2r is the fundamental period of the sequence To verify the above fact, consider
PEMP ESD2521
Basic Sequences
Now
sin o N = 0
o N = 2 r
2 = N o r
10
PEMP ESD2521
Basic Sequences
If 2 /o is a noninteger rational number, then the period will be a multiple of 2 /o Otherwise, the sequence is aperiodic Example - x[n] = sin( 3n + ) is an aperiodic sequence
11
PEMP
Basic Sequences
=0
0
ESD2521
2 1.5
Amplitude
1 0.5 0 0
o = 0
10
20 Time index n
30
40
Here
2 r N= =1 0
Hence period
for r = 0
12
PEMP
Basic Sequences
= 0.1
0
ESD2521
2 1
Amplitude
0 -1
o = 0.1
0.1
-2
10
20 Time index n
30
40
PEMP
Basic Sequences An arbitrary sequence can be represented in the time-domain as a weighted sum of some basic sequence and its delayed (advanced) versions
ESD2521
14
PEMP ESD2521
Discrete-Time Systems
A discrete-time system processes a given input sequence x[n] to generates an output sequence y[n] with more desirable properties In most applications, the discrete-time system is a single-input, single-output system:
Discrete time System
15
PEMP
ESD2521
2-input, 1-output discrete-time systems Modulator, adder 1-input, 1-output discrete-time systems Multiplier, unit delay, unit advance
16
PEMP ESD2521
Discrete-Time Systems
M-point moving-average system M 1 1 y[n] = x[n k ] M k =0
Used in smoothing random variations in data An application: Consider x[n] = s[n] + d[n], where s[n] is the signal corrupted by a noise d[n]
17
PEMP ESD2521
Discrete-Time Systems
s[n] = 2[n(0.9) n ], d[n] - random signal
8 6 Amplitude 4 2 0 -2 d[n] s[n] x[n]
10
20 30 Time index n
40
50
18
PEMP ESD2521
Discrete-Time Systems Linear interpolation - Employed to estimate sample values between pairs of adjacent sample values of a discrete-time sequence Factor-of-4 interpolation
y[n]
3 0 1 2
4 5 6 7 8 9 10 11 12
19
PEMP ESD2521
20
PEMP ESD2521
21
PEMP ESD2521
Impulse Response Example - The impulse response of the system is obtained by setting x[n] = [n] resulting in
y[n] = 1x[n] + 2 x[n 1] + 3 x[n 2] + 4 x[n 3]
h[n] = 1 [n] + 2 [n 1] + 3 [n 2] + 4 [n 3]
The impulse response is thus a finite-length sequence of length 4 given by {h[n]} = {1, 2 , 3 , 4}
PEMP
Impulse Response
ESD2521
y[n] =
x[]
[] = [n]
23
PEMP ESD2521
Impulse Response
Example - The impulse response {h[n]} of the factor-of-2 interpolator 1 y[n] = xu [n] + ( xu [n 1] + xu [n + 1])
2
The impulse response is thus a finite-length sequence of length 3: {h[n]} = {0.5, 1 0.5}
24
PEMP ESD2521
25
Time-Domain Characterization of LTI Discrete-Time System Let h[n] denote the impulse response of a LTI discrete-time system We compute its output y[n] for the input:
x[n] = 0.5[n + 2] + 1.5[n 1] [n 2] + 0.75[n 5]
PEMP ESD2521
As the system is linear, we can compute its outputs for each member of the input separately and add the individual outputs to determine y[n]
M.S. Ramaiah School of Advanced Studies, Bengaluru 26
PEMP ESD2521
is called the convolution sum of the sequences x[n] and h[n] and represented compactly as y[n] = x[n] * h[n]
27
PEMP ESD2521
Convolution Sum
Properties Commutative property: x[n] * h[n] = h[n] * x[n] Associative property : (x[n] * h[n])* y[n] = x[n] * (h[n] * y[n]) Distributive property : x[n] * (h[n] + y[n]) = x[n] * h[n] + x[n] * y[n]
M.S. Ramaiah School of Advanced Studies, Bengaluru 28
PEMP ESD2521
Convolution Sum
Interpretation 1) Time-reverse h[k] to form h[k ] 2) Shift h[-k] to the right by n sampling periods if n > 0 or shift to the left by n sampling periods if h[n k ] n < 0 to form 3) Form the product v[k ] = x[k ]h[n k ] 4) Sum all samples of v[k] to develop the n-th sample of y[n] of the convolution sum
29
PEMP ESD2521
Convolution Sum
Schematic Representation -
h[ k ]
h[n k ] v[k ] z
n
k
y[n]
The computation of an output sample using the convolution sum is simply a sum of products Involves fairly simple operations such as additions, multiplications, and delays
x[k ]
30
PEMP ESD2521
31
PEMP ESD2521
32
PEMP
Convolution Example Example - Develop the sequence y[n] generated by the convolution of the sequences x[n] and h[n] shown below
x[n]
3 1
0 1 2 3 4
ESD2521
h[n]
2 1
3 0 1 2
n
1
1 2
33
PEMP ESD2521
Convolution Example The sequence {y[n]} generated by the convolution sum is shown below
y[n]
5 3 1
2 3
0 2 1
1
4 5
1
7 6 8 9
2 3 4
34
PEMP ESD2521
35
PEMP ESD2521
Cascade Connection
h1[n] h2[n]
h2[n]
h1[n]
h1[n] * hh [n ] = h 2 [n ] [ n ]
h1[n]
h 2[n]
Impulse response h[n] of the cascade of two LTI discrete-time systems with impulse responses and is given by
36
PEMP
Cascade Connection
ESD2521
The ordering of the systems in the cascade has no effect on the overall impulse response because of the commutative property of convolution A cascade connection of two stable systems is stable A cascade connection of two passive (lossless) systems is passive (lossless)
37
PEMP
Cascade Connection
An application is in the development of an inverse system If the cascade connection satisfies the relation
h1 [ n] h 2[n ] = [ n ]
ESD2521
h1[n]
h 2[n]
38
PEMP ESD2521
Parallel Connection
h1[n] h2[n]
h1[n] + hh [n ] = h 2 [n ] [ n ]
1
Impulse response h[n] of the parallel connection of two h1[n] h2[n] LTI discrete-time systems with impulse responses and is given by
PEMP ESD2521
Simple Interconnection Schemes Consider the discrete-time system where h1[n] = [n] + 0.5[n 1],
+ +
h2[n]
h3[n]
h4[n]
M.S. Ramaiah School of Advanced Studies, Bengaluru 40
PEMP ESD2521
h1[n] h2[n]
h3[ n ] + h 4[ n ]
h1[n]
h 2[ n ] * ( h3[ n ]+ h 4[ n ])
41
PEMP ESD2521
= [n] 1 [n 1]
2
Finally
1 [ n 1] [ n] = [ n] h[n] = [n] + 1 [ n 1 ] + [ n ] 2 2
M.S. Ramaiah School of Advanced Studies, Bengaluru 42
PEMP
ESD2521
y[n] =
N2
k = N1
h[k ]x[n k ]
43
PEMP
ESD2521
44
PEMP
ESD2521
45
PEMP
Classification of LTI Discrete-Time Systems Example - The discrete-time accumulator defined by y[n] = y[n 1] + x[n] is an IIR system
ESD2521
46
PEMP
ESD2521
47
PEMP
ESD2521
48
PEMP ESD2521
Correlation of Signals
Definitions A measure of similarity between a pair of energy signals, x[n] and y[n], is given by the cross-correlation sequence rxy [] defined by
rxy [] =
n =
The parameter called lag, indicates the time-shift between the pair of signals
49
PEMP ESD2521
Correlation of Signals
There are applications where it is necessary to compare one reference signal with one or more signals to determine the similarity between the pair and to determine additional information based on the similarity For example, in digital communications, a set of data symbols are represented by a set of unique discrete-time sequences If one of these sequences has been transmitted, the receiver has to determine which particular sequence has been received by comparing the received signal with every member of possible sequences from the set Similarly, in radar and sonar applications, the received signal reflected from the target is a delayed version of the transmitted signal and by measuring the delay, one can determine the location of the target The detection problem gets more complicated in practice, as often the received signal is corrupted by additive ransom noise
50
PEMP
Correlation of Signals
ESD2521
y[n] is said to be shifted by samples to the right with respect to the reference sequence x[n] for positive values of , and shifted by samples to the left for negative values of The ordering of the subscripts xy in the definition of rxy [] specifies that x[n] is the reference sequence which remains fixed in time while y[n] is being shifted with respect to x[n]
51
PEMP
Correlation of Signals
If y[n] is made the reference signal and shift x[n] with respect to y[n], then the corresponding cross-correlation sequence is given by ryx [] = n = y[n]x[n ]
ESD2521
52
PEMP ESD2521
Interelaver
Modulator
Demodulator
Equalizer
Rx filter
SDRAM controller
Digital filters Equalizer
...
Viterbi decoder
Hardwired
signal processing / channel coding Digital Circuit
DMA controller
53
PEMP ESD2521
Filtering Example Signals are usually a mix of useful information and noise How do we extract the useful information? Filtering is one way
54
PEMP ESD2521
Filtering Example
55
PEMP ESD2521
Filtering Equations
Let x[n] denote current input value (ECG + noise) x[n-1] is previous input value, x[n-k] is k-th previous input Let y[n] be the current filtered output value y[n-1] is previous output value , y[n-k] is k-th previous output Filtering operations carried out for this example: y[n] = 2.4*y[n-1] -2.6*y[n-2] + 1.5 y[n-3] 0.4*y[n-4] + 0.6*x[n] 1.9*x[n-1] + 2.8*x[n-2] -1.9*x[n-3] + 0.6*x[n-4]
56
PEMP ESD2521
Transform Example
ki
Can you say which is 1 / # by looking at them? If not, go to frequency domain Another way to look at signals Done using transforms
M.S. Ramaiah School of Advanced Studies, Bengaluru 57
PEMP ESD2521
Transform Example
58
PEMP ESD2521
Transform Equations Discrete Fourier Transform x Time domain signal X Frequency domain representation of x
59
PEMP ESD2521
Correlation Equation Correlation x Transmitted signal y Received signal rxy- Correlation coefficients
60
PEMP
ESD2521
The voltage from a signal sensor is very small in magnitude. A microphone may produce voltages of the order of 10 -6 volts. Similarly for ECG sensors, vibration sensors etc. Prior to recording the signal or reproducing with an actuator an amplifier should signal condition by linearly amplifying the signal by an appropriate factor.
61
PEMP
Amplifier Distortion
ESD2521
An amplifier which introduces unwanted artifacts, is said to be nonlinear and is, of course, very undesirable as it may mask signal components of interest.
The above amplifier is non-linear and actually outputs the input signal plus a 3rd order harmonic:
Unlike noise it is essentially impossible to remove the effects of distortion. Therefore we try to minimize the possibility of distortion by using suitable components.
M.S. Ramaiah School of Advanced Studies, Bengaluru 62
PEMP
ESD2521
Most acquired signals are corrupted by some level of noise which can cause information to be lost. Signal processing techniques are often used in an attempt to remove or attenuate noise. Most noise can be considered as additive (linear superposition) which can be address by linear filtering techniques.
63
PEMP
ESD2521
DSP must minimize the amount of noise/distortion input to the chain, and where possible attenuate other sources.
M.S. Ramaiah School of Advanced Studies, Bengaluru 64
PEMP
ESD2521
Taking the logarithm of the linear signal power to noise power ratio (SNR) and multiplying by 10 gives the measure of decibels or dBs.
PEMP
ESD2521
66
PEMP
ESD2521
A single input, single output DSP system has the following components:
67
PEMP
ESD2521
A simple example is a telephone. The acoustic signal is converted to a voltage which is then directly transmitted over a twisted pair of wires to be received at a remote location.
M.S. Ramaiah School of Advanced Studies, Bengaluru 68
PEMP
ESD2521
Modern communications systems require that digital information is transmitted and received.
69
PEMP
ESD2521
An ADC is a device that can convert a voltage to a binary number, according to its specific input-output characteristic.
The number of digital samples converted per second is defined by the sampling rate of the converter, fs Hz.
M.S. Ramaiah School of Advanced Studies, Bengaluru 70
PEMP
ESD2521
A DAC is a device that can convert binary numbers to voltages, according to its specific input-output characteristic.
71
PEMP
Signal Conditioning
ESD2521
Note that prior to a signal being input to an ADC, an amplifier will be required to ensure that the full voltage range of the ADC is used this is referred to as signal conditioning. For the above ADC with a maximum input and output of 2 volts we would require that the input signal to the ADC has a similar range:
Depending on the output actuator, an amplifier, or at least a buffer amplifier will be required.
M.S. Ramaiah School of Advanced Studies, Bengaluru 72
PEMP
Sampling
ESD2521
The speed at which an ADC generates binary numbers is called the sampling rate or sampling frequency fs The time between samples is called the sampling period, ts:
Sampling frequency is quoted in samples per second, or simply as Hertz (Hz). The actual sampling rate will depend on parameters of the application. This may vary from: 10s of Hz for control systems, 100s of Hz for biomedical, 1000s of Hz for audio applications, 1,000,000s of Hz for digital radio front ends.
M.S. Ramaiah School of Advanced Studies, Bengaluru 73
PEMP
ESD2521
After signal conditioning the ADC can produce binary number equivalents of the input voltage. If the ADC has finite precision due to a limited no. of discrete levels then there may be a small error associated with each sample.
The quantization step size is 0.0625 volts. If an 5 bit ADC is used, then the max/min voltage input is approx 0.0625 x 16 = 1 volt.
M.S. Ramaiah School of Advanced Studies, Bengaluru 74
PEMP
ESD2521
Note that the output is a little steppy caused by the zero order hold (step reconstruction); ....this artifact can however be removed with a reconstruction filter.
M.S. Ramaiah School of Advanced Studies, Bengaluru 75
PEMP
ESD2521
A first order apparently produces a more accurate reproduction of the analogue signal. However implementation of a circuit to perform interpolation is not trivial and turns out not to be necessary.
M.S. Ramaiah School of Advanced Studies, Bengaluru 76
PEMP
ESD2521
Note that data input from an ADC, or output to a DAC will always be fixed point, although the internal DSP computation may be floating point.
77
PEMP
ESD2521
To intuitively derive the sampling theorem, consider first a pure sine wave of frequency 100Hz:
In order to ensure that we retain all of the information in the signal what sampling rate should be used?
78
PEMP
ESD2521
Appears to be a reasonable sampling rate. Sampling at fs = 3000Hz, i.e. 30 samples per period:
PEMP ESD2521
PEMP
ESD2521
From inspection of the above 100Hz digital waveforms at the four different sample rates: fs = 800Hz seems a reasonable sampling rate; fs = 3000Hz is perhaps higher than necessary; fs = 100Hz is too low and fails to correctly sample the waveform, and loses the signal parameter information; fs = 80Hz is too low and fails completely From mathematical theory the minimum sampling rate to retain all information is: greater than 2 x fmax where fmax is the maximum frequency component of a baseband, bandlimited signal.
M.S. Ramaiah School of Advanced Studies, Bengaluru 81
PEMP ESD2521
fb = Bandwidth
Bandlimited: For all frequencies in the signal fh < f < fl fl = lowest freq fh = highest freq fb = fh fl
M.S. Ramaiah School of Advanced Studies, Bengaluru 82
PEMP
ESD2521
If a baseband, band limited signal is composed of sine waves up to a frequency Hz, then
Nyquist frequency fn = 2fb
In we require to sample this signal and retain all information, then the sampling rate, must be chosen as: Fs > fn i.e. Fs > 2fb
This frequency is often referred to as the Nyquist sampling rate, (distinct from the Nyquist frequency).
M.S. Ramaiah School of Advanced Studies, Bengaluru 83
PEMP
Aliasing
ESD2521
When a (baseband) signal is sampled at a frequency below the Nyquist rate, then we lose the signal frequency information and aliasing is said to have occured. Aliasing can be illustrated by sampling a sine wave at below the Nyquist rate and then reconstructing. We note that it appears as a sine wave of a lower frequency (aliasing - cf. impersonating). Consider again sampling the 100Hz sine wave at 80Hz:
PEMP ESD2521
Aliasing Example Consider the output from the following three systems:
85
PEMP ESD2521
Aliased Spectra
86
PEMP
ESD2521
Prior to the analogue to digital converter (ADC) all frequencies above fs/2 must be blocked or they will be interpreted as lower frequencies, i.e aliasing.
The anti-alias filter is analogue (ideally a brick wall filter), cutting off just before fs/2 Hz.
M.S. Ramaiah School of Advanced Studies, Bengaluru 87
PEMP
Reconstruction Filter
ESD2521
The analogue reconstruction filter at the output of a DAC removes the baseband image high frequencies present in the signal (in the form of the steps between the discrete levels).
88
PEMP ESD2521
PEMP
ESD2521
Anti-alias and reconstructions filters are analogue, i.e. made from resistors, capacitors, amplifiers, even inductors. Ideally they are both very sharp cut off filters at frequency fs/2. In practice the roll off will be between 6dB/octave (a simple resistor and capacitor) to 96dB/octave (a 16th order filter).
Steeper roll-off is more expensive, but clearly for many applications, good analogue filters are essential. In a DSP system the accurately trimmed analogue filters could actually be more costly than the other DSP components: i.e. DSP processor, ADC, DAC, memory etc.
M.S. Ramaiah School of Advanced Studies, Bengaluru 90
PEMP
ESD2521
The Nyquist sampling theorem states that a (baseband) signal should sampled at greater than twice the maximum frequency component present in the signal: fs > 2 * fmax The sampled signal can then be perfectly reconstructed to the original analogue signal with no added noise or distortion.
91
PEMP
ESD2521
Perfect signal reconstruction assumes that sampled data values are exact (i.e. infinite precision real numbers). In practice they are not, as an ADC will have a number of discrete levels. The ADC samples at the Nyquist rate, and the sampled data value is the closest (discrete) ADC level to the actual value:
PEMP
ESD2521
93
PEMP
Quantization Error
If the smallest step size of a linear ADC is q volts, then the error of any one sample is at worst q/2 volts.
ESD2521
94
PEMP
Quantization Error
The quantization error is straightforward to calculate from: q = Vmax / 2N 1 where N is the number of bits in the converter. The dynamic range of an bit converter is often quoted in dBs: Dynamic Range=20log102N=20Nlog102=6.02N Therefore an 8 bit converter has a range of
ESD2521
Binary 10000000 to 01111111, or in decimal -128 to 127 has a dynamic range of approximately 48 dB.
95
PEMP
ADC Representation
The actual ADC can be represented by a sampler and a quantizer:
ESD2521
The quantization error of each sample is in the range and we can model the quantizer as a linear additive noise source.
96
PEMP
ESD2521
Note that when a signal is sampled there may be some jitter on the sampling clock which will cause additional sample error.
With jitter each sampling instant may be slightly offset, and therefore the sample value obtained and sent to the DSP will be in error.
M.S. Ramaiah School of Advanced Studies, Bengaluru 97
PEMP ESD2521
Hardware-efficient algorithms
Arithmetic-strength reduction
Digit-level (bit-level) optimization Saving within processing units
Structure regularity
98
PEMP ESD2521
e( n ) = d ( n ) y ( n )
wk (n + 1) = wk (n) + 2
+ log 2 (e ( n ) )
PEMP ESD2521
latch
enable
pulse stream Ts : sampling period waveform analog LPF Amplitude mapper digital data
reg
100
PEMP ESD2521
Quantization
10 9 8 7 6 5 4 3 2 1 -1 -4Ts-3Ts -2Ts -2 -3 -4 -5
101
PEMP ESD2521
Session Summary
Functional Architecture Hardware Architecture System-level algorithms vs Hardware computationefficient algorithms Trade-off and System performance and Hardware complexity (cost) Signal processing is focused on efficient implementation of integrated circuit. Signals can be classified as continuous-time and discrete time signals. A system is BIBO stable if its impulse response is absolutely summable. A response of an LTI system is the convolution of its impulse response and input
M.S. Ramaiah School of Advanced Studies, Bengaluru 102