Please enable JavaScript to view this site.

Digital low-pass filter function with specific external storage, so it can be used in multiple calls.

Syntax

real filter_lp_st (real val, real omega, real valQ, real storage[2], real period, i32 flagInit)

val

This is the value (or a generic mathematical expression) to be filtered out

omega

Value of the cut filter omega in radians per second (omega = 2 * K_PI * cut frequency (Hz)). It can be a generic mathematical expression

valQ

Value of the filter coefficient Q (Q must be >= 0.75). It can be a generic mathematical expression

storage

Storage variable for mathematical processing of the filter function

period

Sampling interval, if <= 0 si is assumed

flagInit

Variable for filter initialization request; imposing a value different than 0 will reset the filter and the flagInit variable will be written to 0. The first time the function is called this variable must have a value different than 0

Result

Returns the filtered value

Validity

Rule

Note

Automatic omega limitation: (omega_max = 0.15 / si * 2 * K_PI) -> i.e. no more than 15% of the omega value corresponding to the rule sampling time.

(e.g. if Freq = 200Hz -> filter cut frequency <= 30 Hz)

The parameters are as for filter_lp(), but in addition it allows you to specify a storage variable used for mathematical processing of the filter function.

In this way, filters can also be used with multiple calls (e.g., within for loops).

 

  

Keyboard Navigation

F7 for caret browsing
Hold ALT and press letter

This Info: ALT+q
Page Header: ALT+h
Topic Header: ALT+t
Topic Body: ALT+b
Contents: ALT+c
Search: ALT+s
Exit Menu/Up: ESC