% Discrete-time variable % Diego Trapero
Signals
\vspace{30mm}
Sampling Sampling is the reduction of a continuous time signal to a discrete time signal by taking values at different instants of time.
Sampling at a constant rate: for functions that vary with time, let
- Sampling period,
$T_s$ is the time interval between samples. - Sampling frequency
$f_s$ is the is the number of samples per time unit, or the sampling rate. It is the reciprocal of the period,$f_s = 1/T_s$
\vspace{50mm}
Aliasing Aliasing is the effect that occurs when sampling a continuous signal, whereby frequency components higher than half the sampling frecuency are transformed into lower frequency components. These components, or aliases, (which where a valid part of a signal, or noise) may appear in the band of the signal that we are interested in, thus making the reconstruction of the original signal impossible. From the time-domain point of view, aliasing occurs when we sample a continuous signal at a too low sample rate. The resulting sequence is an alias of the original signal, with lower frequency components.
- From the time domain point of view, aliasing occurs when trying to reconstruct a high frequency signal from the samples taken in a not high enough frequency. In this case, there are few low frequency values that can be used to reconstruct many different high frequency signals (all of them would output the same sequence when sampled), aliases of one another.
\vspace{30mm}
- From the frequency domain point of view, sampling a signal at sampling frequency
$f_s$ "folds" any frecuency higher than$f_s/2$ back into the frequency range$0 - f_s/2$ . In other words, signal components with frequencies higher than$f_s/2$ will produce the same samples as a signal with some frequency in the range$0, f_s/2$ .$f_s/2$ is known as Nyquist frequency or folding frequency. This effect is expressed in the form of the Nyquist theorem.
\vspace{30mm}
Nyquist theorem If s(t) is a continuous signal with finite bandwith, that contains no frequencies higher than
-
$f_{max}$ is the maximum frequency of the signal -
$f_s$ is the sampling frequency -
$f_s/2 = f_{N}$ is the Nyquist frecuency
Shannon's enunciation: If a function x(t) contains no frequencies higher than B hertz, it is completely determined by giving its ordinates at a series of points spaced 1/(2B) seconds apart.
Aliased frequency of a real world frequency To obtain the aliased frecuency of a high frequency component of a signal, substract
\vspace{50mm}
Choosing the sampling frequency If we hace a signal with a known upper frequency of interest, we can double that frequency to get the Nyquist rate; that is, the sampling rate above wich you must sample in order to avoid aliasing.
- If the maximum frequency of the signal,
$f_{max}$ is known,$f_s > 2f_{max}$ - If the maximum frecuency is not known, but an histogram of the signal is available, we can determine the sampling frecuency from the maximum slope point of the signal. This method gives very conservative results, often well above the minimum necessary
$f_s$ for the signal.
\vspace{30mm}
Antialiasing filters To avoid the problem of aliasing, a low-pass filter called antialising filter can be used before sampling to attenuate any frecuencies that may cause aliasing.
\vspace{30mm}
The filters represented in the figure are
- An ideal (infinite order) filter, that only let frecuencies in the range
$[0, f_M]$ pass (the useful part of the signal). - A filter that let pass frecuencies, that let frecuencies between
$[0, f_N]$ pass (the complete alias-free zone). 3, A filter that let pass frecuencies between$0$ and$f_s - f_M$ . This filter let pass all the frecuencies before the aliases zones, where aliases may be mapped to the$[0, f_M]$ range (the useful components of the signal). This is the most used filter because it is completely functional while having the minimum order.
Designing a Antialising Filter for sampling with a ADC
\vspace{30mm}
-
The gain in the
$[0, f_M]$ would ideally be 0dB (no gain/attenuation), to let the useful part of the signal pass unaltered. Other constant gain may be considered when increasing or decreasing the amplitude of the signal before the ADC is necessary. -
All components after the
$f_s - f_M$ frecuency must be attenuated before the resolution of the ADC, so they cannot be registered. This will prevent any aliases mapping to the$[0, f_M]$ band.
In the worst case, a signal with amplitude
Example For a analog signal with
\vspace{80mm}
#Signal reconstruction
#Sample and hold
Ideal S/H model
$$ % Ideal S/H Circuit \begin{circuitikz}[scale = 1] \draw (0,2) nodeocirc{} (0,2) toopening switch (2,2) toshort, -o (2,2) toC (2,0) nodeground{} ; \end{circuitikz} $$
Real S/H model
$$ % Real model S/H Circuit \begin{circuitikz}[scale = 1] \draw (0,2) nodeocirc{} (0,2) toR (1,2) toopening switch (2,2) toshort, -o (2,2) toC (2,0) nodeground{} (3,2) toR (3,0) nodeground{} ; \end{circuitikz} $$
Ideal S/H operation
\vspace{50mm}
Real S/H operation
Sample phase
$$ \begin{circuitikz}[scale = 1] \draw (0,2) nodeocirc{} (0,2) toR, -o (1,2) toopen (2,2) toshort, -o (2,2) toC (2,0) nodeground{} (3,2) toR (3,0) nodeground{} ; \end{circuitikz} $$
\vspace{50mm}
Hold phase
$$ \begin{circuitikz}[scale = 1] \draw (0,2) nodeocirc{} (0,2) toopen (2,2) toshort, -o (2,2) toC (2,0) nodeground{} (3,2) toR (3,0) nodeground{} ; \end{circuitikz} $$
\vspace{50mm}
Transition between S/H
\vspace{50mm}
S/H complete cycle
\vspace{50mm}
S/H circuits
\vspace{100mm}
#AD Converters
\vspace{100mm}
The flash converter employs several comparators with fixed reference voltages (obtained with a large voltage divisor) to obtain a thermometric code from the input signal. An encoder can next convert to binary code.
\vspace{80mm}
Flash converter is fast but uses many components (growing exponentially with the number of bits). For avoiding this problem, the half-flash converts
\vspace{80mm}
Half-Flash vs Flash components comparation For 8 bits:
- Flash
-
$2^8-1 = 255$ comparators -
$2^8 = 256$ resistors
-
- Half-Flash
-
$2 \cdot (2^4-1) = 30$ comparators -
$2 \cdot (2^4) = 32$ resistors
-
The succesive approximation ADC is an ADC that can convert an analog signal in a digital code of
The control circuit starts generating the code for 1 MSB and all zeros, and outputing it to the DAC. The output of the DAC is then compared with the analog signal. If the analog signal is greater than the DAC output, the control circuit recives a "greater" signal from the comparator, and knows that the first digit is 1. In the other case, the digit is a 0. The converter then tries to get the next digit from the (holded) analog signal until it is completedly converter.
\vspace{80mm}
\vspace{80mm}
Concurrent times
Sequential times
AD Conversion times An ADC needs its input analog signal to be constant during its convertion time. The minimum time is the following, that determines the sample frecuency:
$$T_{min} = (t_{adquisition} + t_{setling}+ t_{ap.delay}){SH} + t{conv}$$
Times
-
$t_{MUX}$ , MUX conmutation time -
$t_{sample}$ , delay in sampling (until output constant is constant)$$t_{sample} = t_{switch closes} + t_{sampling settling}$$ -
$t_{hold}$ , delay in holding.$$t_{hold} = t_{switch opens} + t_{hold settling}$$ -
$t_{PGA}$ , programmable amplifier settling time. -
$t_{conv}$ , ADC conversion time
\vspace{100mm}
\vspace{100mm}
\vspace{100mm}
#Z transform
#Digital filters
Difference equation $$ y(n) = b_0(n) + b_1 x(n-1) + ... + b_z (n-z) - a_1 y(n-1) - a_2 y(n-2) - ... - a_p y(n-p)$$
##IIR filters
##FIR filters
- "Digital Signal Processing and the Microcontroller", Dale Grover, John Deller
- "Instrumentación Electrónica", Miguel A. Pérez, Juan C. Álvarez, Juan C. Campo, Fco. Javier Ferrero, Gustavo J. Grillo. Editorial Thomson
- Wikipedia
- Sampling (signal processing), Wikipedia
- Butterworth filter, Wikipedia
#More
Butterworth filter. Maximum flatness filter. The normalized Butterworth polynomials can be used to determine the transfer function for any low-pass filter cut-off frequency
To four decimal places, Butterworth polynomials are (expressed in quadratic factors)
Order | Polynomial |
---|---|
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 |