sosfilt

Syntax

Description

y = sosfilt(sos,x) applies
the second-order section digital filter sos to
the vector x. The output, y,
is the same length as x.

Note:
If either input to sosfilt is single precision,
filtering is implemented using single-precision arithmetic. The output, y,
is single precision.

sos represents the second-order section digital
filter H(z)

H(z)=∏k=1LHk(z)=∏k=1Lb0k+b1kz−1+b2kz−21+a1kz−1+a2kz−2

by an L-by-6 matrix containing the coefficients
of each second-order section in its rows.

sos=[b01b11b211a11a21b02b12b221a12a22⋮⋮⋮⋮⋮⋮b0Lb1Lb2L1a1La2L]

If x is a matrix, sosfilt applies
the filter to each column of x independently. The
output y is a matrix of the same size, containing
the filtered data corresponding to each column of x.

If x is a multidimensional array, sosfilt filters
along the first nonsingleton dimension. The output y is
a multidimensional array of the same size as x,
containing the filtered data corresponding to each row and column
of x.

The second order sections matrix, sos, the
input signal, x, or both can be double or single
precision. If at least one input is single precision, filtering is
done with single precision arithmetic.

Examples

Second-Order Section Filtering

Load chirp.mat. The file contains a signal, y, that has most of its power above Fs/4, or half the Nyquist frequency. The sample rate is 8192 Hz.

load chirp
t = (0:length(y)-1)/Fs;

Design a 7th-order Butterworth highpass filter to attenuate the components of the signal below Fs/4. Use a normalized cutoff frequency of 0.48π rad/sample. Express the filter coefficients in terms of second-order sections.