Downsampling
|
|
This article needs additional citations for verification. (February 2010) |
In signal processing, downsampling (or "subsampling") is the process of reducing the sampling rate of a signal. This is usually done to reduce the data rate or the size of the data.
The downsampling factor (commonly denoted by M) is usually an integer or a rational fraction greater than unity. This factor multiplies the sampling time or, equivalently, divides the sampling rate. For example, if compact disc audio at 44,100 Hz is downsampled to 22,050 Hz before broadcasting over FM radio, the bit rate is reduced in half, from 1,411,200 bit/s to 705,600 bit/s, assuming that each sample retains its bit depth of 16 bits. The audio was therefore downsampled by a factor of 2.
Contents |
[edit] Maintaining the sampling theorem criterion
Since downsampling reduces the sampling rate, we must be careful to make sure the Shannon-Nyquist sampling theorem criterion is maintained. If the sampling theorem is not satisfied then the resulting digital signal will have aliasing. To ensure that the sampling theorem is satisfied, a low-pass filter is used as an anti-aliasing filter to reduce the bandwidth of the signal before the signal is downsampled; the overall process (low-pass filter, then downsample) is called decimation. Note that if the original signal had been bandwidth limited, and then first sampled at a rate higher than the Nyquist minimum, then the downsampled signal may already be Nyquist compliant, so the downsampling can be done directly without any additional filtering. Downsampling only changes the sample rate not the bandwidth of the signal. The only reason to filter the bandwidth is to avoid the case where the new sample rate would become lower than the Nyquist requirement and then cause the aliasing by being below the Nyquist minimum.
Thus, in the current context of downsampling, the anti-aliasing filter must be a low-pass filter. However, in the case of sampling a continuous signal, the anti-aliasing filter can be either a low-pass filter or a band-pass filter.
A bandpass signal, i.e. a band-limited signal whose minimum frequency is different from zero, can be downsampled avoiding superposition of the spectra if certain conditions are satisfied, see e.g. [1].
[edit] Downsampling process
Consider a discrete signal
on a radian frequency digital frequency range.
[edit] Downsampling by integer factor
Let M denote the downsampling factor.
- Filter the signal to ensure that the sampling theorem is satisfied. This filter should, theoretically, be the sinc filter with frequency cutoff at
. Let the filtered signal be denoted
. - Reduce the data by picking out every
sample:
. Data rate reduction occurs in this step.
The first step calls for the use of a perfect low-pass filter, which is not implementable for real-time signals. When choosing a realizable low-pass filter this will have to be considered along with the aliasing effects it will have. Realizable low-pass filters have a "skirt", where the response diminishes from near unity to near zero. So in practice the cutoff frequency is placed far enough below the theoretical cutoff that the filter's skirt is contained below the theoretical cutoff.
[edit] Downsampling by rational fraction
Let M/L denote the downsampling factor.
- Downsample by a factor of M
- Upsample by a factor of L
Note that a proper upsampling design requires an interpolation filter after increasing the data rate and that a proper downsampling design requires a filter before eliminating some samples. These two low-pass filters can be combined into a single filter.
Also note that these two steps are generally not reversible. Downsampling results in a loss of data and, if performed first, could result in data loss if there is any data filtered out by the downsampler's low-pass filter. Since both interpolation and anti-aliasing filters are low-pass filters, the filter with the smallest bandwidth is more restrictive and can therefore be used in place of both filters. When the rational fraction M/L is greater than unity then
and the single low-pass filter should have cutoff at
.
NOTE: Upsampling first is necessary in all cases where the rate is not an even multiple. Eg: if a sample rate of 2x is changed to a rate of 1x by averaging every pair of samples this would be equivalent to a low pass filtering operation. But taking every other sample would be equivalent to up then down sampling in this special case where the multiple was 2 to 1, so there is no need to do an upsample first.
[edit] Effect on Z Transform of Signal
[edit] Decimation by factor of 1
From the definition of the z transform,
of the signal
we have
![H(z) = \sum_{k=0}^{\infty} h[k] z^{-k} = \sum_{k=0}^{\infty} g[2k] z^{-k} = \sum_{k=0,2,4,6,...} g[k] z^{-k/2} = \sum_{k=0}^{\infty} g[k] z^{-k/2} q[k]](http://upload.wikimedia.org/math/f/b/1/fb1cf1d43530d8e84a9bb076bb972f48.png)
Where ![q[k] = 1, 0, 1, 0, 1, ...](http://upload.wikimedia.org/math/1/5/4/1543195b9b0c277b1b74fd58fd5c5b47.png)
It can be shown that
satisfies this condition. By substituting, we obtain
![= \tfrac{1}{2}(\sum_{k=0}^{\infty} g[k] (-z^{1/2})^{-k} + \sum_{k=0}^{\infty} g[k] (z^{1/2})^{-k})
= \tfrac{1}{2}(G(-z^{1/2}) + G(z^{1/2}))](http://upload.wikimedia.org/math/0/c/c/0ccef38f72f5a4b5edfd7e05fc317f97.png)
Where
is the z transform of the original, unmodified signal ![g[k]](http://upload.wikimedia.org/math/0/4/3/043dfaa1800d098813cade0609190830.png)
[edit] Decimation by factor of 2
This amounts to keeping every third sample, so we have
.
We can use the same technique as used for decimation by factor 1, resulting in
![H(z) = \sum_{k=0}^{\infty} g[k] z^{-k/3} q[k]](http://upload.wikimedia.org/math/6/6/c/66c06cdfb9e1f17e4eb3a61bdf4e55c2.png)
and choosing a ![q[k] = 1, 0, 0, 1, 0, 0, 1, 0, 0, ...](http://upload.wikimedia.org/math/d/b/e/dbe67a46b2d938b785eaaa6f8ed40899.png)
The formula that satisfies this requirement is ![q[k] = \tfrac{2}{3}(\cos(\tfrac{2\pi k}{3}) + \tfrac{1}{2}) = \tfrac{1}{3}(\exp(\tfrac{i 2\pi k}{3}) + \exp(\tfrac{-i 2\pi k}{3}) + 1)](http://upload.wikimedia.org/math/3/1/b/31b9d9f25444d1de083818d29be4fa66.png)
By a similar process of reasoning, as used in the decimation by 1 case, we obtain

[edit] Decimation by other factors
The following formulae are useful to derive the Z transform relation for other factors:
If x>3 is odd, we have ![q[k]=\tfrac{2}{x}(\tfrac{1}{2}+\sum_{n=1}^{\tfrac{1}{2}(x-1)} \cos(\tfrac{2\pi nk}{x})) = \left \{ \begin{matrix} 1 & \mbox{if } \frac{k}{x} \mbox{ is an integer} \\ 0 & \mbox{otherwise} \end{matrix} \right.](http://upload.wikimedia.org/math/7/9/a/79ade36e6945dcefaf9ae2a19407bf3e.png)
If x=4, we have ![q[k]=\tfrac{1}{4}(1 + (-1)^k + 2\cos(\tfrac{2\pi k}{4})) = \left \{ \begin{matrix} 1 & \mbox{if } \frac{k}{x} \mbox{ is an integer} \\ 0 & \mbox{otherwise} \end{matrix} \right.](http://upload.wikimedia.org/math/2/f/6/2f63bdbc0401ffbbe40c1b99a520af89.png)
If x=6, we have ![q[k]=\tfrac{2}{x}(\tfrac{1}{2}+\cos(\tfrac{4\pi k}{x}))(1 + (-1)^k) = \left \{ \begin{matrix} 1 & \mbox{if } \frac{k}{x} \mbox{ is an integer} \\ 0 & \mbox{otherwise} \end{matrix} \right.](http://upload.wikimedia.org/math/2/2/4/224f2028573b56ffb15bb63c2ce10eb2.png)
[edit] See also
|
||||||||||||||
. Let the filtered signal be denoted
.
sample:
. Data rate reduction occurs in this step.