saefilt95

Filters a signal with an SAE class filter.

Syntax

y=saefilt95(x,fs,cfc)

y=saefilt95(x,fs,cfc,pad,dir)

Inputs

x
The signal to be filtered. If x is a matrix, each column is filtered.
Type: double
Dimension: vector | matrix
fs
The sampling frequency.
Type: double
Dimension: scalar
class
The channel frequency class of the filter (typically 60 or 180).
Type: double
Dimension: vector
pad
The padding method.
The available options are as follows:
  • 0: no padding.
  • -N: pad N zeros to each end of a signal vector.
  • N: pad N mirrored values to each end of a signal vector.
Type: integer
Dimension: scalar
dir
The direction in which to filter.
The available options are as follows:
  • 1: forward only.
  • 2: backward only.
  • 3: forward, then backward.
  • 4: backward, then forward.
Type: integer
Dimension: scalar

Outputs

y
The filtered signal.

Example

Filter a 100 Hz signal bi-directionally with no padding, sampled at 10,000 Hz, with a class 60 filter.
t = [0:0.0001:0.02];
input = sin(2*pi*100*t);
plot(t,input);
hold on;
output = saefilt95(input, 10000, 60, 0, 3);
plot(t,output);
legend('input','output');
Figure 1. filter figure 1


Example

Filter a 100 Hz signal bi-directionally with 100 pads, sampled at 10,000 Hz, with a class 60 filter.
t = [0:0.0001:0.02];
input = sin(2*pi*100*t);
plot(t,input);
hold on;
output = saefilt95(input, 10000, 60, 100, 3);
plot(t,output);
legend('input','output');
Figure 2. filter figure 1


Comments

saefilt95 is based on the SAE J211-1 (1995) standard. It uses a second order low pass Butterworth filter. The cfc is approximately 60% of the 3dB cutoff frequency when used bi-directionally.

fs should be at least 10 times cfc.