SAMPLING
Sampling is the acquisition of a continuous signal at discrete time intervals and is a fundamental concept in real-time signal processing.
The actual sampling operation can also be defined by the figure below and as can be seen is a MODULATION process. The carrier signal is a “train of impulses”.
The output of the modulator is xs(t) and is given by:
If we recall that convolution by a shifted impulse is the signal shifted by the same amount then
This relation describes the sampling process in the time-domain.
The sampling frequency Fs = 1.0/T must be selected large enough such that the sampling process will not result in any loss of spectral information (no-Aliasing).
We will investigate the sampling operation further by taking the Fourier Transform of .
The Fourier Transform of the impulse train:
where
here fs is the sampling frequency in Hz.
Also we recall that multiplication in time is convolution in frequency domain.
but we already know that
………………………… (1)
First let x(t) be band limited in frequency such that X(w) = 0 for w > |wM|.
This we can show as in the diagram below:
Next assume that the highest frequency in X(w) is less than one-half the sampling frequency:
From equation (1) we note that the effect of the impulse sampling of x(t) is to replicate the frequency spectrum of X(w) about the frequencies nws = ± 1, ± 2,± 3,…….as shown below:
Fig. 3.1
For this case we can recover the signal x(t) exactly from its samples x[n] using an ideal low-pass filter.
We call the recovery of a signal from its samples DATA RECONSTRUCTION.
Now assume the case when the highest frequency in x(t) is greater than . The new plot will be as shown below;
Fig. 3.2
For the case in Fig. 3.1 x(t) can be recovered exactly from xs(t) by means of a lowpass filter with gainT and a cutoff frequency greater than wM and less than (ws – wM).
Below is the block diagram showing the use of the lowpass filter:
If we assume that the spectrum of x(t) is as shown below
and assume that the sampling frequency ws > 2wM then the spectrum of the sampled signal will be as shown below:
Now if we select the cutoff frequency of the lowpass filter to be between wM and (ws – wM) the characteristic curve for the filter will be as shown below:
The spectrum of the reconstructed signal xr(t) will then be as follows:
Note that in Fig. 3.2 frequency components overlap in the sampled signal and x(t) can not be recovered by lowpass filtering. A requirement for sampling is the following:
Sampling frequency must be at least twice as great as the highest
frequency wM in the signal that is sampled.
Now let us consider practical sampling.
A physical signal cannot be bandlimited in frequency . However a physical signal does exist such that the amplitude of the frequency spectrum above a certain frequency is so small that it is negligible.
We see that an other requirement for sampling is that:
Frequency spectrum of the signal be insignificant above the frequency
where is the sampling frequency.
Frequency is called the NYQUIST frequency. This is also known as Shannon’s Sampling Theorem.
Sampling With a Zero Order Hold.
Sampling theorem was explained in terms of impulse-train sampling.
However in practice, narrow large-amplitude pulses which approximate impulses are relatively difficult to generate and transmit.
It is often more convenient to generate the sampled signal in a form known as a zero-order hold.
This system samples x(t) at a given time instant and holds that value until the next instant.
The reconstruction of x(t) from the output of a zero-order hold can be achieved by lowpass filtering. However the required filter no longer has constant gain in the passband.
Let us try to develop this filter characteristic curve.
We note that xo(t) can be generated by impulse train sampling followed by an LTI system with a rectangular impulse response as shown below:
To reconstruct x(t) from xo(t) we consider processing xo(t) with an LTI system with impulse response xr(t).
We need to specify Hr(jw) so that r(t) = x(t).
We note that this will only be true if the cascade combination of h0(t) and hr(t) is the ideal lowpass filter H(jw).
Or similarly
H(jw) = H0(jw).Hr(jw)
But we know that the spectrum of h0(t) is:
hence it is required that
(2)
for example with cutoff frequency of ws/2 the ideal magnitude and phase for the reconstruction filter following a zero-order hold is as below:
We note that the actual realization of equation (2) is not possible without an approximation. In fact in many situations the output of the zero-order hold is considered an adequate approximation to the original signal by itself.
Alternatively in some applications we may wish to perform a smoother interpolation between sample values.
Two important forms of data reconstruction exist:
- Interpolation (suitable for data transmission systems)
- extrapolation (suitable for feedback systems)
Extrapolation is interpolation extended to points outside the convex hull of a dataset.
Interpolation values at a point outside the convex hull of an input dataset is referred to as an extrapolated value.
Interpolation
Is the fitting of a continuous signal to a set of sample values.
One simple interpolation procedure is the zero order hold previously discussed.
An other useful form of interpolation is linear interpolation where adjacent points are connected by a straight line as seen below:
We have seen before that if the sampling instants are sufficiently close, then the signal is reconstructed exactly.
i.e. through the use of a lowpass filter exact interpolation can be carried out between the sample points.
Consider in the time-domain the effect of the lowpass filter
For the ideal lowpass filter H(jw), h(t) is as follows
Interpolation Using Matlab
YI = INTERP1( X,Y,XI)
This matlab command will find YI using values of the underlying function Y.
It carries out interpolation for the points in vector XI.
Vector X specifies the points at which the data Y is given
Interpolation is the same operation as “table lookup”. Described in table look up terms INTERP1 looks up the elements of XI in X and based upon their locations returns values YI interpolated within the elements of Y.
Usage:YI = INTERP1(X,Y,XI, ‘method’);
‘nearest’ :nearest neighbor interpolation
‘linear’:linear interpolation
‘spline’:cubic spline interpolation
‘cubic’:cubic interpolation
Example:
x = 0:10;
y= sin(x);
xi = 0:0.25:10;
yi = interp1(x,y,xi);
plot(x,y,’o’,xi,yi,’*’)
x =
0 1 2 3 4 5 6 7 8 9 10
> y
y =
Columns 1 through 10
0 0.8415 0.9093 0.1411 -0.7568 -0.9589 -0.2794 0.6570 0.9894 0.4121
Column 11
-0.5440
> xi
xi =
Columns 1 through 10
0 0.2500 0.5000 0.7500 1.0000 1.2500 1.5000 1.7500 2.0000 2.2500
Columns 11 through 20
2.5000 2.7500 3.0000 3.2500 3.5000 3.7500 4.0000 4.2500 4.5000 4.7500
Columns 21 through 30
5.0000 5.2500 5.5000 5.7500 6.0000 6.2500 6.5000 6.7500 7.0000 7.2500
Columns 31 through 40
7.5000 7.7500 8.0000 8.2500 8.5000 8.7500 9.0000 9.2500 9.5000 9.7500
Column 41
10.0000
> yi
yi =
Columns 1 through 10
0 0.2104 0.4207 0.6311 0.8415 0.8584 0.8754 0.8923 0.9093 0.7173
Columns 11 through 20
0.5252 0.3332 0.1411 -0.0834 -0.3078 -0.5323 -0.7568 -0.8073 -0.8579 -0.9084
Columns 21 through 30
-0.9589 -0.7890 -0.6192 -0.4493 -0.2794 -0.0453 0.1888 0.4229 0.6570 0.7401
Columns 31 through 40
0.8232 0.9063 0.9894 0.8450 0.7007 0.5564 0.4121 0.1731 -0.0660 -0.3050
Column 41
-0.5440