saefilt95

SAE J211/1 revision MAR95 compliant filter.

Syntax

saefilt95(vector1, vector2, scalar1, scalar2, scalar3, scalar4)

Arguments

vector1
The time vector (seconds).
vector2
Response vector to filter (any units).
scalar1
Filter Frequency (Hz).
scalar2
Padding type flag:
  • = 0, No Padding
  • = N, Mirror Padding with N samples on each end
  • = -N, Zero Padding with N samples on each end
Note: Padded samples are discarded before returning results. N cannot exceed the length of vector2. SAE J211/1 recommends a minimum value of N corresponding to 10ms of samples.
scalar3
Direction:
  • = 1, Forward
  • = 2, Backward
  • = 3, Forward then Backward
  • = 4, Backward then Forward
scalar4
Flag to turn on the debug mode (prints to the Message Log); optional (default = off).

Example

Define the following curve:
Figure 1.


Filter it forward, and then backward with no padding.
Figure 2.




The signal is the blue curve, and the filtered output is the dotted red line.

Now, filter the signal with 100 pads using the mirror method.
Figure 3.




Comments

The filtered data has reduced amplitude because of the filter attenuation. Without padding, the filtered data does not track the signal at the beginning of the curve well. This is the result of the filter lag. There is also lag at the end of the curve if filtering in both directions. The purpose of padding is to attempt to minimize the lag by creating an assumed signal history and future beyond the data collection window. This can often allow the filter to acquire a more meaningful initial state than the default when the collected data enters the filter.