Signal Processing Toolbox |
Decimation -- decrease sampling rate
Syntax
Description
Decimation reduces the original sampling rate for a sequence to a lower rate, the opposite of interpolation. The decimation process filters the input data with a lowpass filter and then resamples the resulting smoothed signal at a lower rate.
y = decimate(x,r)
reduces the sample rate of x
by a factor r
. The decimated vector y
is r
times shorter in length than the input vector x
. By default, decimate
employs an eighth-order lowpass Chebyshev Type I filter with a cutoff frequency of 0.8*(Fs/2)/r
. It filters the input sequence in both the forward and reverse directions to remove all phase distortion, effectively doubling the filter order.
y = decimate(x,r,n)
uses an order n
Chebyshev filter. Orders above 13 are not recommended because of numerical instability. MATLAB displays a warning in this case.
Note
For better results when r is greater than 13, you should break r into its factors and call decimate several times.
|
y = decimate(x,r,'
uses an order 30 FIR filter, instead of the Chebyshev IIR filter. Here fir
')
decimate
filters the input sequence in only one direction. This technique conserves memory and is useful for working with long sequences.
y = decimate(x,r,n,'
uses an order fir
')
n
FIR filter.
Examples
Decimate a signal by a factor of four:
View the original and decimated signals:
stem(x(1:120)), axis([0 120 -2 2]) % Original signal title('Original Signal') figure stem(y(1:30)) % Decimated signal title('Decimated Signal')
Algorithm
decimate
uses decimation algorithms 8.2 and 8.3 from [1]:
decimate
uses a Chebyshev Type I filter with normalized cutoff frequency 0.8/r
and 0.05 dB of passband ripple. For the fir
option, decimate
designs a lowpass FIR filter with cutoff frequency 1/r
using fir1
.
decimate
applies the filter to the input vector in one direction. In the IIR case, decimate
applies the filter in forward and reverse directions with filtfilt
.
decimate
resamples the filtered data by selecting every r
th point.
Diagnostics
If r
is not an integer, decimate
gives the following error message:
If n
specifies an IIR filter with order greater than 13, decimate
gives the following warning:
See Also
cheby1
, downsample
, filtfilt
, fir1
, mfilt
, interp
, resample
References
[1] IEEE. Programs for Digital Signal Processing. IEEE Press. New York: John Wiley & Sons, 1979. Chapter 8.
dct | deconv |
© 1994-2005 The MathWorks, Inc.