Function rc_filter_butterworth_lowpass#

Function Documentation#

int rc_filter_butterworth_lowpass(rc_filter_t *f, int order, double dt, double wc)#

Creates a Butterworth low pass filter of specified order and cutoff frequency.

Any existing memory allocated for f is freed safely to avoid memory leaks and new memory is allocated for the new filter.

Parameters:
  • f[out] Pointer to user’s rc_filter_t struct

  • order[in] The order (>=1)

  • dt[in] desired timestep of discrete filter in seconds

  • wc[in] Cuttoff freqauency in rad/s

Returns:

Returns 0 on success or -1 on failure.