Signal Acquisition - Sampling, Conditioning and Filtering
In questa pagina 6
Measurements and signals
Many current measurement instruments can be seen as particular data acquisition systems. They have a dedicated input section that transduces the quantity of interest into a signal , generally a voltage. Knowing the behaviour of the transducer, one goes back from to the input quantity of the measurement system, i.e. the actual measurand.
The measurement is generally the result of processing a numerical sequence , obtained through an analog-to-digital conversion of (see Analog-to-Digital ConversionAnalog-to-digital conversion consists of sampling (sample-and-hold), uniform quantization with step Delta and error uniformly distributed in plus or minus Delta over 2, and binary coding; flash, successive-approximation and integrating converters trade speed against resolution.Analog-to-Digital Conversion →). Before being digitized the signal must be "prepared" by signal conditioning.
The acquisition chain is:
sensor -> signal conditioning -> [ sampling -> quantization ] -> processing -> MEASURE
(analog to digital conversion)
^ REFERENCE ^ SAMPLEThe steps treated in this lecture are: conditioning, sampling, quantization, signal reconstruction. The blocks "sampling" and "quantization" together form the analog-to-digital conversion; the sampling block has a REFERENCE input and the quantization block a SAMPLE input in the slide diagram.
Sampling
- Sampling is the process of observing the measurand at a discrete set of time instants , with .
- In most cases uniform sampling is used: the instants are integer multiples of a constant interval , the sampling interval, so .
- Since is constant and known, it is useless to store the time of each sample. The data are stored in an acquisition memory as a vector of amplitude values having the integer as index.
- Because sampling changes the appearance of the signal , the samples must be sufficiently "dense" to represent faithfully the original shape.
The slides compare the same continuous-time signal (a waveform made of repeating lobes of different amplitude) sampled "densely", with approximately 40 samples per period, and "sparsely", with approximately 10 samples per period: in the dense case the shape of the waveform is still evident from the dots, in the sparse case it is no longer recognisable.
Sampling in the frequency domain
Any signal can be represented in the time domain or in the frequency domain. The Fourier transform of a continuous-time signal is
A sampled signal (sampling interval ) is defined as
Through the properties of the Fourier transform one obtains the transform of the sampled signal:
is a sum of repetitions of , each translated in frequency by with respect to the previous one. The function is periodic in with period , which, being the reciprocal of the sampling interval, is called the sampling frequency. In the slide figure the spectrum of the original signal appears once, while the sampled spectrum shows copies centred at , , and so on.
Aliasing
Reconstructing a signal from its samples requires that sampling does not significantly alter its information content. This holds if there is no overlap between adjacent replicas of : then knowing any period of gives back .
This amounts to assuming a band-limited signal, i.e. its Fourier transform satisfies
The frequency range where is the signal band. Its width is also the lower bound of the sampling frequency, called the Nyquist frequency . The condition is therefore (see Sampling and the Sampling TheoremSampling multiplies a continuous-time signal by a pulse train, which replicates its spectrum every omega_s; if the signal is band-limited with maximum angular frequency omega_M and omega_s exceeds 2 omega_M, an ideal low-pass filter recovers it exactly (Shannon theorem and sinc interpolation formula).Sampling and the Sampling Theorem →).
When the repetitions of overlap, at least partially, and irreversibly modify the information on , which can no longer be reconstructed from its samples: this effect is called aliasing (see Aliasing and Anti-Aliasing FiltersAliasing is the overlap of spectral replicas that occurs when the band-limited or Nyquist assumptions of the sampling theorem fail; an anti-aliasing low-pass filter with cut-off omega_s/2 applied before sampling removes it at the price of losing the high frequencies; two worked exercises.Aliasing and Anti-Aliasing Filters →). In the slide figure, the left-bottom spectrum (replicas just touching at ) has no overlap, the right-bottom one (replicas overlapping around ) has aliasing.
Example: two sinusoids, same samples
Both cases use and a sinusoid of amplitude shown over 1 ms:
| case | what the samples show | ||
|---|---|---|---|
| left | a sine with period 0.4 ms (40 samples per period), starting upward | ||
| right | the same-looking sine at , but with opposite sign (it starts falling) |
In the first plot the sinusoid shows 2.5 kHz behaviour (peaks at 0.1, 0.5, 0.9 ms, i.e. period 0.4 ms). In the second the samples draw a sinusoid with the same period but opposite phase (minima at 0.1, 0.5, 0.9 ms): the tone is indistinguishable from a one, because .
The spectra on the slide show the lines of a real sinusoid at replicated around : for kHz the replicas fall at far from the baseband; for kHz the replica at falls near the origin, next to and (labels , , , ).
In principle aliasing should be totally avoided, but in practice it is difficult to eliminate completely (unless very high sampling frequencies are used). It is therefore preferable to intervene through filtering operations or sampling techniques.
Signal conditioning
In a measurement system the information is obtained by processing signals acquired with probes or sensors. In most cases the analog signals taken from the physical system cannot be directly converted into digital form. A preliminary processing, called signal conditioning, is therefore needed. Conditioning devices transform the electrical signal supplied by a generic source into a voltage signal with characteristics suitable for the measurement system.
Source and load
The signal source, seen from the input of the measurement system, is described as an equivalent voltage or current generator with an output impedance (Thevenin: voltage source in series with ; Norton: current source in parallel with ). accounts for the output characteristics and is to be considered not modifiable when designing an instrument or an acquisition system. The subsequent acquisition stage is represented by an input impedance, which is the load impedance of the source.
The conditions in which a conditioning element must operate are:
- signal generator with given characteristics: signal amplitude and output impedance are not design parameters;
- load with given characteristics, often with constraints on the trend of the output signal, depending on the device that follows the conditioning in the chain;
- possible presence of a noise component superimposed on the useful signal.
Minimum required functions
- adaptation of the signal level to the limits imposed on the output (may require both attenuation and amplification);
- minimization of the load effect on the signal source: a circuit with an appropriate input impedance;
- creation of a suitable output impedance;
- optimization of the signal/noise ratio.
The conditioning block can be considered a linear network: all these functions can be realised as linear time-invariant transformations.
Loading effect
To minimize the loading effect, if the source is seen as a voltage generator the input impedance of the conditioning block must satisfy
The transfer function is given by the voltage gain ; to reduce the loading effect also at the output we must set
( output impedance of the conditioning block, load impedance.) The slide circuit is: source with series , input resistance across which the voltage appears, then a controlled voltage source with series feeding the load .
Non-distortion conditions
Conditioning must not alter the essential features of the signal; the measurand should remain substantially unchanged. The amplitude is often varied by amplification or attenuation; the optimal situation is the multiplication by a constant . Propagation through any physical system takes a finite time, so the output is delayed by a constant time .
Ideal filters
Time-domain measurements
For measurements in the time domain (e.g. analysis with an oscilloscope, see The OscilloscopeThe oscilloscope displays the joint trend of two or more quantities; its functional blocks are input channels, trigger and synchronization, time base and acquisition and display, and its input impedance, bandwidth, rise time, coupling, hold-off and probe compensation determine how faithfully a signal is shown.The Oscilloscope →) the optimal criterion for a linear filter is to reproduce the trend of the signal as faithfully as possible. The most critical condition is the measurement of a step, displayed as the step response of the conditioning section. The optimal features are:
- the shortest rise time possible;
- the absence of overshoots.
These allow following all variations of the signal while avoiding artefacts (here, more or less damped oscillations). The slide shows a clock signal (amplitude about 0 to 1 V, time in ns) with labelled period, rise time, fall time, positive overshoot (peak about 1.2 V), positive undershoot and negative overshoot (about V).
Frequency-domain measurements
If the primary target is to analyse the frequency composition in detail, the conditioning section must approximate an ideal low-pass filter:
(normalized response, gain 1, neglecting the delay term ). The corresponding impulse response is
which is symmetric but of infinite duration and gives an oscillatory step response. Achieving optimal characteristics in one domain implies significant limitations in the other.
Anti-aliasing filters
The condition for is generally very difficult to satisfy. It is more realistic to identify a band of "meaningful" frequencies , while components with are of no interest for measurement. This does not mean the out-of-band components have negligible amplitude (the slide spectrum has total width with the meaningful part inside it). Their replicas after sampling would fold into the band of interest (replicas around , in the figure).
To avoid this, a filter is put before the sampler to add, for , an attenuation large enough to make the out-of-band components negligible. Features of an anti-aliasing filter :
- Pass band, delimited by , where the filter does not alter the signal: for .
- Attenuated band (dark band), delimited at the bottom by , with strong attenuation: for .
- Transition band , where signal components, although outside the pass band, still have non-negligible amplitude.
When choosing the sampling frequency one must refer to :
The oversampling factor is now and depends on the frequency response of the filter.
The parameters that determine the complexity and cost of a filter are the flatness of the pass band, the dark band attenuation and the width of the transition band. For measurement, flatness directly influences accuracy, since it contributes to the uncertainty with which the amplitude is reproduced. The width is one of the most significant parameters: a very narrow transition requires high-order transfer functions, more difficult and expensive to realize.
Signal reconstruction
Reconstructing a time-continuous signal from its samples is called interpolation (mathematically, determining a function given its values in a set of points). In instrumentation it is needed in two cases:
- graphic representation of a sampled waveform: a discrete interpolation shows the waveform on a denser time grid;
- correct reproduction of the desired signal at the output of a digital synthesis generator: a real interpolator filter is used, since the generator output is necessarily analogue.
Versione ripasso
- Acquisition chain: sensor, signal conditioning, sampling and quantization (together the analog-to-digital conversion, Analog-to-Digital ConversionAnalog-to-digital conversion consists of sampling (sample-and-hold), uniform quantization with step Delta and error uniformly distributed in plus or minus Delta over 2, and binary coding; flash, successive-approximation and integrating converters trade speed against resolution.Analog-to-Digital Conversion →), processing, measure. Sampling has a REFERENCE (time) input and quantization a SAMPLE (amplitude) input.
- Uniform sampling: instants . Since is known, the memory stores only the vector of amplitudes, indexed by .
- Fourier transform of a continuous signal: .
- Sampled signal (interval ):
- Spectrum of the sampled signal: replicas of shifted by :
The function is periodic with period , the sampling frequency.
- No overlap of the replicas needs a band-limited signal, for , and
- Aliasing: if the replicas overlap and the information is lost irreversibly; see Aliasing and Anti-Aliasing FiltersAliasing is the overlap of spectral replicas that occurs when the band-limited or Nyquist assumptions of the sampling theorem fail; an anti-aliasing low-pass filter with cut-off omega_s/2 applied before sampling removes it at the price of losing the high frequencies; two worked exercises.Aliasing and Anti-Aliasing Filters →.
- Example: kHz. A 2.5 kHz sine gives 40 samples per period; a 97.5 kHz sine gives samples that look like a 2.5 kHz sine with opposite sign, because kHz.
- Aliasing is hard to remove completely; it is handled with filtering or sampling techniques.
- Dense vs sparse sampling: about 40 samples per period keeps the shape; about 10 samples per period does not.
- Signal conditioning: converts the source signal into a voltage with characteristics suitable for the measurement system. The source is a Thevenin voltage in series with , or a Norton current in parallel with ; the next stage is the load.
- Required functions: adapt the level (attenuate or amplify), minimize the loading effect, create a suitable output impedance, optimize the signal-to-noise ratio. The conditioning block is a linear network.
- Loading conditions: input impedance ; output impedance .
- Non-distortion: the optimal conditioning multiplies the signal by a constant and delays it by a constant :
- Time-domain measurements (oscilloscope, The OscilloscopeThe oscilloscope displays the joint trend of two or more quantities; its functional blocks are input channels, trigger and synchronization, time base and acquisition and display, and its input impedance, bandwidth, rise time, coupling, hold-off and probe compensation determine how faithfully a signal is shown.The Oscilloscope →): the filter must reproduce the trend faithfully, judged on the step response. Wanted: shortest rise time and no overshoot, so that no damped oscillation artefacts appear.
- Frequency-domain measurements: the ideal low-pass filter has for and for , with impulse response . It has infinite duration and gives an oscillatory step response. Optimal behaviour in one domain costs the other.
- Anti-aliasing filter (before the sampler): the condition above is unrealistic, so a band of meaningful frequencies is defined, and the filter attenuates everything above it.
- pass band up to : ;
- transition band ;
- dark band : .
- Choose the sampling rate from the dark band edge:
- oversampling factor .
- Cost: flatness of the pass band (affects amplitude accuracy), attenuation in the dark band, and the width of the transition band. A narrow transition needs high-order, costly filters.
- Reconstruction = interpolation. Used for plots (a discrete interpolation on a denser grid) and for the output of a digital synthesis generator, where a real interpolation filter gives the analog signal.
- Typical errors:
- sampling at the raw signal without filtering out-of-band components;
- using instead of to choose ;
- assuming a filter is optimal in both time and frequency domains.