butterworth (bwfilt)

Filters data forward and backward using a second order Butterworth algorithm.

Syntax

butterworth(vector1, vector2, scalar1, scalar2, [on|off])

Arguments

vector1
Time vector of data to analyze (seconds).
vector2
The dependent vector of data to analyze.
scalar 1
The filter cutoff frequency (Hz).
scalar 2 (optional)
  • 0 – use NHTSA algorithm.
  • 1 – compensate for ringing at both ends of vector1.
  • 2 - compensate for ringing at the beginning of vector1.
  • 3 - compensate for ringing at the end of vector1.
0|1
Flag to turn on debug mode and print to the message log (optional).
  • 0=off (default)
  • 1=on

Example

x = c1.X
y = butterworth(c1.x, c1.y, 60)

Comments

butterworth filters data forward and backward using a second order Butterworth algorithm, producing zero phase shift and -3dB attenuation at the specified cutoff frequency.

When scalar 2 = 1, 2 or 3, the compensation is performed with a reflection method combined with filter initial condition estimates.