# Sampling (signal processing)

Under scanning ( english sampling ) is in the signal processing the registration of measured values to discrete , mostly equidistant understood times. A time -discrete signal is thus obtained from a time-continuous signal .

In the case of multi-channel signals, each sample results in a "sample" made up of several samples. The number of samples per second is called the sampling rate . In digital telephony ( ISDN ), the sampling rate is 8 kHz, for example.

## Demarcation

The digitization of an analog signal in the time domain as an umbrella term includes, in addition to sampling, a further conversion, quantization , whereby the two conversions can be carried out in any order to obtain a digital signal :

• The sampling to convert a time-continuous signal into a time-discrete signal .
• The quantization to convert a continuous value signal into a discrete value signal.

## Sampling in the time domain

### Ideal sampling

For a simpler mathematical description, the ideal sample is defined. Here the signal is not accumulated over a certain period of time around the sampling time, but is evaluated exactly at the sampling time . ${\ displaystyle nT}$ Mathematically this can be represented by multiplying the signal with the Dirac comb , a sequence of Dirac collisions : ${\ displaystyle s (t)}$ The sampled signal is then ${\ displaystyle s _ {\ mathrm {a}}}$ ${\ displaystyle s _ {\ mathrm {a}} (t) = s (t) \ cdot \ sum _ {n = - \ infty} ^ {\ infty} \ delta (t-nT).}$ For the frequency spectrum , which represents the Fourier series of the signal , one obtains with the help of the inversion of the convolution theorem : ${\ displaystyle S _ {\ mathrm {a}}}$ ${\ displaystyle s _ {\ mathrm {a}}}$ ${\ displaystyle S _ {\ mathrm {a}} (f) = S (f) * \ left [{\ frac {1} {T}} \ sum _ {n = - \ infty} ^ {\ infty} \ delta \ left (f - {\ frac {n} {T}} \ right) \ right].}$ The spectrum is the spectrum of the input signal that is repeated periodically with the period - this expresses the convolution property of the Dirac pulse. It follows that the spectrum of maximum must be wide, so that the shifted spectra do not overlap. ${\ displaystyle s (t)}$ ${\ displaystyle {\ tfrac {1} {T}}}$ ${\ displaystyle s}$ ${\ displaystyle {\ tfrac {1} {2T}}}$ If the spectrum is narrower than , the original signal can be completely reconstructed from the time-discrete spectrum after ideal low-pass filtering. This fact is the basis of the Nyquist-Shannon sampling theorem . On the other hand, if the spectrum of the input signal is wider than , aliasing occurs and the original signal can not be recovered. ${\ displaystyle s}$ ${\ displaystyle {\ tfrac {1} {2T}}}$ ${\ displaystyle s (t)}$ ${\ displaystyle s (t)}$ ${\ displaystyle {\ tfrac {1} {2T}}}$ ${\ displaystyle s (t)}$ ${\ displaystyle s _ {\ mathrm {a}} (t)}$ ### Real sampling Exemplary signal curve, shown in red, obtained by a sample-and-hold with 0th order${\ displaystyle f _ {\ mathrm {a}} (t)}$ In reality, two conditions of ideal scanning cannot be met:

1. It is not possible to generate ideal Dirac collisions. Rather, the signal is obtained over a period of time around the actual sampling time. This is also called natural sensing . Alternatively, a sample-and-hold circuit is used.
2. The perfect recovery of the signal from its spectrum requires an ideal low-pass filter as a reconstruction filter , which is not causal , in order to avoid mirror spectra .

The real scanning is therefore carried out with the following modifications:

Regarding 1 .: The Dirac comb is replaced by a square function ( ) with square pulses of length . The sampling is implemented by a sample-and-hold circuit, which keeps the value of a sampling constant for the length of the rectangular pulse. Mathematically, this corresponds to a convolution with the rectangular function: ${\ displaystyle \ operatorname {rect}}$ ${\ displaystyle t_ {0}}$ ${\ displaystyle f _ {\ mathrm {a}} (t) = \ sum _ {n = - \ infty} ^ {\ infty} f (nT) \ cdot \ operatorname {rect} \ left ({\ frac {t- nT} {t_ {0}}} \ right) = \ operatorname {rect} \ left ({\ frac {t} {t_ {0}}} \ right) * \ sum _ {n = - \ infty} ^ { \ infty} f (t) \, \ delta (t-nT)}$ The spectrum obtained from this is

${\ displaystyle F _ {\ mathrm {a}} (f) = t_ {0} \ cdot \ operatorname {si} (\ pi ft_ {0}) \ cdot \ left [F (f) * {\ frac {1} {T}} \ sum _ {n = - \ infty} ^ {\ infty} \ delta (f-nf _ {\ mathrm {a}}) \ right].}$ This is the spectrum of the ideal sampling, weighted with a factor which includes the si function (sinc function). This represents a distortion of the signal, which can be eliminated by an additional distortion in the reconstruction filter when the original signal is recovered. This distortion does not occur with natural scanning.

Regarding 2 .: In order to recover the continuous signal from the spectrum with the smallest possible error even with a non-ideal reconstruction filter, the sampling frequency can be increased. As a result of the oversampling , the individual spectra clearly move further apart, as a result of which the low-pass filter for reconstruction has higher attenuation values ​​in the area of ​​the mirror spectra.

## Sampling in the spectral range

Conversely, due to the symmetry properties of the Fourier transformation, a frequency function in the spectral range can also be formed , with ideal sampling, from a sequence with discrete-frequency values: ${\ displaystyle S (f)}$ ${\ displaystyle S _ {\ mathrm {p}} (f)}$ ${\ displaystyle S _ {\ mathrm {p}} (f) = \ sum _ {n = - \ infty} ^ {\ infty} S (nF) \ cdot \ delta (f-nF)}$ The spectral sequence consists of weighted Dirac pulses, which describe individual, discrete frequencies. Such a discrete spectrum is also called a line spectrum . ${\ displaystyle S _ {\ mathrm {p}} (f)}$ With the inverse Fourier transformation , the associated periodic form of the time function can be formed: ${\ displaystyle s _ {\ mathrm {p}} (t)}$ ${\ displaystyle s _ {\ mathrm {p}} (t) = {\ frac {1} {T}} \ sum _ {n = - \ infty} ^ {\ infty} s \ left (t - {\ frac { n} {F}} \ right)}$ When sampling in the spectral range, the sampling theorem also applies in the “reverse” form: If the duration of a signal is less than , then the periodic components of do not overlap . The task of the reconstruction filter in the time domain is taken over by a gate circuit, in the simplest case a switch which switches through for the duration and blocks the rest of the time. If, on the other hand, the signal is longer than , there will be temporal overlaps and the original signal shape can no longer be reconstructed. ${\ displaystyle s (t)}$ ${\ displaystyle {\ tfrac {1} {F}}}$ ${\ displaystyle s _ {\ mathrm {p}} (t)}$ ${\ displaystyle {\ tfrac {1} {F}}}$ ${\ displaystyle s (t)}$ ${\ displaystyle {\ tfrac {1} {F}}}$ In real scanning in the spectral range, instead of a sequence of Dirac pulses, a sequence of spectral square-wave pulses occurs, each of which covers a band-limited section of the spectrum. Bandpass filters can take over this function in the technical context .

## General mathematical representation

When storing a piece of music on a CD, the scanned signal is used to transmit and store the analog output signal. In this case, the method used for scanning depends on the method used for analog reconstruction. This view is also advantageous for the mathematical treatment.

The combination of scanning and playback in the opposite direction occurs z. B. in message transmission when a binary coded message is converted into an analog radio signal. The original binary character sequence is then reconstructed through a scanning process.

### Conversion of discrete data into an analog signal

In the simplest case, a sequence of real numbers, i.e. a time-discrete signal, is converted using a single core function. In other words, the interpolating function in the broadest sense becomes a sequence using a function and a time step${\ displaystyle (c_ {n}) _ {n \ in \ mathbb {Z}}}$ ${\ displaystyle h}$ ${\ displaystyle T}$ ${\ displaystyle a (t): = T \ cdot \ sum _ {n \ in \ mathbb {Z}} c_ {n} \ cdot h (t-nT)}$ educated. Whose Fourier transform is

{\ displaystyle {\ begin {aligned} A (f) &: = {\ mathcal {F}} _ {\ mathrm {Hz}} (a) (f) \\ & = T \ sum _ {n \ in \ mathbb {Z}} c_ {n} \ int _ {\ mathbb {R}} h (t-nT) \ cdot e ^ {- i (2 \ pi f) t} dt \\ & = T \ sum _ { n \ in \ mathbb {Z}} c_ {n} e ^ {- i (2 \ pi f) nT} H (f), \ end {aligned}}} where is the Fourier transform of . ${\ displaystyle H (f)}$ ${\ displaystyle h (t)}$ ### Conversion of an analog signal into discrete data

A more realistic model of measuring a time-varying process is to take a weighted average over a period of time. This can be realized mathematically by folding with a weight function. Let the signal to be measured and the measured value be at the point in time (which is assigned to the center of gravity of the weight function, for example), then applies ${\ displaystyle w}$ ${\ displaystyle x (t)}$ ${\ displaystyle v (t)}$ ${\ displaystyle t}$ ${\ displaystyle v (t) = (w * x) (t) = \ int _ {\ mathbb {R}} w (s) \ cdot x (ts) \, ds}$ .

Under the Fourier transformation, the convolution changes into the multiplication. Let and be the Fourier transforms of and , then holds . ${\ displaystyle W, \ V}$ ${\ displaystyle X}$ ${\ displaystyle w, \ v}$ ${\ displaystyle x}$ ${\ displaystyle V (f) = W (f) X (f)}$ ### The process signal-data-signal

If you now determine a sequence of measured values ​​with a time step in order to use them in the interpolation rule, we get a reconstructed analog signal ${\ displaystyle T, \ c_ {n} = v (nT)}$ ${\ displaystyle a (t) = \ sum _ {n \ in \ mathbb {Z}} v (nT) \, h (t-nT) = \ sum _ {n \ in \ mathbb {Z}} (x * w) (nT) \, h (t-nT).}$ In order to assess the error of the entire process of discretization and reproduction, this process can be applied to simple frequency-limited test signals. This can be abbreviated in the model by determining the Fourier transform. However, the Fourier series is also used

${\ displaystyle T \ sum _ {n \ in \ mathbb {Z}} v (nT) \, e ^ {- i (2 \ pi f) nT}}$ to determine more precisely. According to Poisson's empirical formula , this periodic function is identical to the periodization of . Let be the sampling frequency, then ${\ displaystyle V (f)}$ ${\ displaystyle f _ {\ mathrm {s}} = {\ tfrac {1} {T}}}$ ${\ displaystyle T \ sum _ {n \ in \ mathbb {Z}} v (nT) \, e ^ {- i (2 \ pi f) nT} = \ sum _ {k \ in \ mathbb {Z}} V (f + k \ cdot f _ {\ mathrm {s}}) = \ sum _ {k \ in \ mathbb {Z}} X (f + k \ cdot f _ {\ mathrm {s}}) \ cdot W ( f + k \ cdot f _ {\ mathrm {s}}).}$ In summary, then

${\ displaystyle A (f) = \ left (\ sum _ {k \ in \ mathbb {Z}} X (f + k \ cdot f _ {\ mathrm {s}}) \ cdot W (f + k \ cdot f_ {\ mathrm {s}}) \ right) \ cdot H (f).}$ A frequency component around the frequency thus suffers a distortion with the factor and an aliasing of the strength around the frequency with . ${\ displaystyle f}$ ${\ displaystyle W (f) \ cdot H (f)}$ ${\ displaystyle W (f) \ cdot H (f + kf _ {\ mathrm {s}})}$ ${\ displaystyle f + kf _ {\ mathrm {s}}}$ ${\ displaystyle k \ neq 0}$ In order to approximate baseband signals as well as possible, it is necessary that in a neighborhood of and for the same and for all apply. Within the framework of a mathematically exact theory, these requirements are met and all operations are well-defined, if ${\ displaystyle W (f) \ cdot H (f) \ approx 1}$ ${\ displaystyle f = 0}$ ${\ displaystyle H (f + kf _ {\ mathrm {s}}) \ approx 0}$ ${\ displaystyle f}$ ${\ displaystyle k \ neq 0}$ • ${\ displaystyle \ sum _ {k \ in \ mathbb {Z}} | W (f + kf _ {\ mathrm {s}}) | ^ {2} and with one applies to all and${\ displaystyle \ sum _ {k \ in \ mathbb {Z}} | H (f + kf _ {\ mathrm {s}}) | ^ {2} ${\ displaystyle B> 0}$ ${\ displaystyle f}$ • ${\ displaystyle E (f): = \ sum _ {k \ in \ mathbb {Z}} | W (f) H (f + kf _ {\ mathrm {s}}) - \ delta _ {0, k} | ^ {2}}$ (with the Kronecker delta ) in is continuous and has a zero there.${\ displaystyle f = 0}$ An estimate of the relative error is then obtained in the absolute square norm of the function space L² for a baseband function with the highest frequency according to the Parseval identity, i.e. H. of the signal-to-noise ratio , as ${\ displaystyle x (t)}$ ${\ displaystyle f_ {H}}$ ${\ displaystyle \ | ax \ | _ {2} ^ {2} = \ | AX \ | _ {2} ^ {2} \ leq \ sup _ {f \ in [-f_ {H}, f_ {H} ]} E (f) \, \ | x \ | _ {2} ^ {2}}$ Examples: If and rectangular functions with width centered around 0, then is ${\ displaystyle w}$ ${\ displaystyle h}$ ${\ displaystyle T}$ ${\ displaystyle W (f) = H (f) = \ operatorname {sinc} (Tf) = {\ frac {\ sin (\ pi Tf)} {\ pi Tf}}}$ and it applies . ${\ displaystyle E (f) = 1- \ operatorname {sinc} (Tf) ^ {2}}$ If the reverse and the cardinal sine functions are reversed , then their Fourier transforms are the corresponding rectangular functions , and the resulting reconstruction formula is the cardinal series of the Whittaker-Kotelnikow- Nyquist-Shannon sampling theorem . ${\ displaystyle w}$ ${\ displaystyle h}$ ${\ displaystyle \ operatorname {sinc} (Tf)}$ ${\ displaystyle \ operatorname {rect} {\ big (} {\ tfrac {T} {2f}} {\ big)}}$ In any case, functions with frequency components above lead to aliasing errors in the frequency domain , so the frequency limit of the sampling theorem is necessary, but by no means sufficient for a low-error reconstruction. ${\ displaystyle {\ tfrac {1} {2}} f _ {\ mathrm {s}}}$ ${\ displaystyle \ left [- {\ tfrac {1} {2}} f _ {\ mathrm {s}}, {\ tfrac {1} {2}} f _ {\ mathrm {s}} \ right]}$ ### The process data-signal-data

The "interpolating" function is scanned in this direction . So it turns out ${\ displaystyle a (t)}$ ${\ displaystyle d_ {n}: = v (nT) = (w * a) (nt) = T \ sum _ {k \ in \ mathbb {Z}} c_ {k} \ int _ {\ mathbb {R} } w (s) \, h (nT-kT-s) \, ds = T \ sum _ {k \ in \ mathbb {Z}} c_ {k} (w * h) (nT-kT).}$ This gives us for the Fourier series

${\ displaystyle \ sum _ {n \ in \ mathbb {Z}} d_ {n} e ^ {- i (2 \ pi n) Tf} = T \ sum _ {k \ in \ mathbb {Z}} c_ { k} e ^ {- i (2 \ pi k) Tf} \ cdot \ sum _ {n \ in \ mathbb {Z}} (w * h) (nT) e ^ {- i (2 \ pi n) Tf }}$ According to Poisson's empirical formula, the following applies in this case

${\ displaystyle T \ sum _ {k \ in \ mathbb {Z}} (w * h) (nT) e ^ {- i (2 \ pi n) Tf} = \ sum _ {n \ in \ mathbb {Z }} W (f-nf _ {\ mathrm {s}}) \ cdot H (f-nf _ {\ mathrm {s}}).}$ If the Fourier series of the sequence and thus the sequence are to be retained, this sum must have the value 1 everywhere . In this case too, the maximum deviation therefrom provides a limit for the relative error in the data transmission. ${\ displaystyle c}$ ${\ displaystyle E (f) = \ left | \ sum _ {n \ in \ mathbb {Z}} W (f-nf _ {\ mathrm {s}}) \ cdot H (f-nf _ {\ mathrm {s}) }) - 1 \ right |}$ and ${\ displaystyle \ | dc \ | \ leq \ sup E (f) \, \ | c \ |.}$ From a mathematical point of view, the functions and again must adhere to the above-mentioned limit on the periodization of the absolute value square. ${\ displaystyle W}$ ${\ displaystyle H}$ ## Other types of scanning

Traditionally, equidistant (periodic) sampling is the most widely used because it has been extensively researched and implemented in many applications. In the last few decades other types of sampling have also been investigated, which dispense with equal time intervals between samples, which promises some advantages such as effective utilization of the communication channel. These include send-on-delta sampling .

## Literature sources

• Hans Dieter Lüke: Signal transmission . 11th edition. Springer Verlag, 2010, ISBN 978-3-642-10199-1 .
• Hans Dieter Lüke: Signal transmission (online version) . 11th edition. Springer Verlag, 2010, ISBN 978-3-642-10200-4 .