Signal Processing Toolbox | Help Desk |
decimate
Decrease the sampling rate for a sequence (decimation).
y = decimate(x,r) y = decimate(x,r,n) y = decimate(x,r,'fir') y = decimate(x,r,n,'fir')Decimation reduces the original sampling rate for a sequence to a lower rate. It is 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. 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.
y = decimate(x,r,'fir')
uses a 30-point FIR filter, instead of the Chebyshev IIR filter. Here 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,'fir')
uses a length n
FIR filter.
Decimate a signal by a factor of four:
t = 0:.00025:1; % time vector x = sin(2View the original and decimated signals:*
pi*
30*
t) + sin(2*
pi*
60*
t); y = decimate(x,4);
stem(x(1:120)), axis([0 120 -2 2]) % original signal stem(y(1:30)) % decimated signal
![]()
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.
r
is not an integer, decimate
gives the following error message:
Resampling rate R must be an integer.If
n
specifies an IIR filter with order greater than 13, decimate
gives the following warning:
Warning: IIR filters above order 13 may be unreliable.
Increase sampling rate by an integer factor (interpolation). |
|