decimate
Page in progress. |
Decimation is a decrease in the sampling rate by an integer number of times.
Library |
|
Syntax
Function call
-
y = decimate(x::AbstractVecOrMat, r::Real, mode::String)
— reduces the sampling rate of the input signalx
inr
times. Signal output signaly
is shortened tor
times: `length(y) = ceil(length(x)/r)'. Uses an FIR filter with a finite impulse response, designed with the usage of a Hamming window. The filter has an order of `30'.
-
y = decimate(x::AbstractVecOrMat, r::Real)
— the 'decimate` function uses the IIR Chebyshev filter of the 8th order.
-
y = decimate(x::AbstractVecOrMat, r::Real, n::Real, mode::String)
— uses a FIR filter designed with the usage of a Hamming window. The filter has the ordern
.
-
y = decimate(x::AbstractVecOrMat, r::Real, n::Real)
— uses a Chebyshev filter of the ordern
.
Arguments
Input arguments
#
x —
Input signal
AbstractVecOrMat
Details
The input signal is in the form of a vector.
Data types |
|
#
n —
filtering order
Real number
Details
The filtering order specified as a positive integer. For an IIR filter, it is not recommended to use a filtering order higher than 13
due to numerical instability. In such cases, the function displays a warning.
Data types |
|
Output arguments
# y — a signal with a reduced sampling rate
Details
A signal with a reduced sampling rate.
Data types |
|
Algorithms
Decimation reduces the initial sampling rate of the sequence to a lower one. This is the opposite of interpolation. The decimate
function applies low-pass filtering to the input signal to protect against spectrum aliasing and decimates the result. The function uses the thinning algorithms 8.2 and 8.3 from [1].
-
decimate
creates a low-pass filter. The Chebyshev I BIH filter is used By default. This filter has a normalized cutoff frequency equal to0.8/r
and a bandwidth ripple equal to0.05' dB. Sometimes the specified filtering order leads to bandwidth distortion due to rounding errors accumulated as a result of convolutions necessary to create a transfer function. The 'decimate
function automatically reduces the filtering order when distortion causes the amplitude response at the cutoff frequency to differ from ripples by more than10-6
.When selecting the
fir
option, thedecimate
function uses thefir1
function to design a low-pass FIR filter with a cutoff frequency of1/r
. -
When using the FIR filter, the
decimate
function filters the input sequence in only one direction. This saves memory and is useful for working with long sequences. In the case of an IIR filter, the 'decimate` function applies the filter in the forward and reverse directions, usingfiltfilt
to eliminate phase distortion. In essence, this process doubles the filtering order. In both cases, the function minimizes transient effects at both ends of the signal by matching the conditions of the endpoint. -
And finally, the 'decimate` function resamples the data by selecting all
r
points inside the filtered signal. In the resampling sequence (y),y(end)
matches 'x(end)` when using the FIR filter, andy(1)
corresponds tox(1)
when using the FIR filter.