filter Function

public pure function filter(b, a, x, delays) result(rst)

Applies the specified filter to a signal.

The description of the filter in the Z-transform domain is a rational transfer function of the form:

, which handles both IIR and FIR filters. The above form assumes a normalization of a(1) = 1; however, the routine will appropriately handle the situation where a(1) is not set to one.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in) :: b(:)

The numerator coefficients of the rational transfer function.

real(kind=real64), intent(in) :: a(:)

The denominator coefficients of the ration transfer function. In the case of an FIR filter, this parameter should be set to a one-element array with a value of one. Regardless, the value of a(1) must be non-zero.

real(kind=real64), intent(in) :: x(:)

An N-element array containing the signal to filter.

real(kind=real64), intent(in), optional, target :: delays(:)

An optional array of length MAX(size(a), size(b)) - 1 that provides the initial conditions for filter delays, and on ouput, the final conditions for filter delays.

Return Value real(kind=real64), allocatable, (:)

An N-element array containing the filtered signal.