Information

Transformation:

LowPass

Transformation Group:

Filter

Description:

Low pass filter for discrete time series. This transformation calculates the following difference equation.

 y(t) = b0*x(t) + b1*x(t-1) + ... + bM*x(t-M) + a1*y(t-1) + ... + aN*y(t-N) 

Here x is the input, y is the output, t denotes time, b0 to bM are the feedforward coefficients and a1 to aN are the feedback coefficients. When this transformation runs, then it first retrieves the required previous output values from previous runs, if available.

Hydrological Information

Purpose and use of Transformation:

To smooth time series data.

Background and Exceptions:

This transformation filters out high frequency fluctuations in time series data.

Input

Input variable x(t). For each calculation of y(t) the input values x(t) to x(t-M) are required. If one of these input values is missing, then the output value y(t) will be a missing value.

CoefficientSets or CoefficientSetFunctions

The coefficientSet should contain the a and b coefficients for the filter (see the equation above). It is possible to choose the number of coefficients to use. The first defined a coefficient is a1, the second defined a coefficient is a2 and so on. The last defined a coefficient is aN. The first defined b coefficient is b0, the second defined b coefficient is b1 and so on. The last defined b coefficient is bM.

When using coefficient set functions (available since build 30246), the a and b coefficient elements can contain tags between "@" signs (e.g. "@NUMBER@") that refer to location attributes that are defined in the locationSets configuration file. The tags are replaced by actual values. These values can be different for different locations and time periods. See 22 Locations and attributes defined in CSV files, Shape-DBF files or external tables for more information.

  • One or more feedback coefficients (a1 to aN).
  • One or more feedforward coefficients (b0 to bM).

Output

Output variable y(t). For each calculation of y(t) the previous output values y(t-1) to y(t-N) are required. When this transformation runs, then it first retrieves the required previous output values from previous runs, if available. If one of these previous output values is missing, then that output value is ignored. Effectively this means that it behaves as if all previous missing output values would be 0.

Configuration Examples

<variable>
	<variableId>input</variableId>
	<timeSeriesSet>
		<moduleInstanceId>FilterLowPassTest</moduleInstanceId>
		<valueType>scalar</valueType>
		<parameterId>H.obs</parameterId>
		<locationId>location1</locationId>
		<timeSeriesType>external historical</timeSeriesType>
		<timeStep unit="day"/>
		<relativeViewPeriod unit="day" start="10" end="43"/>
		<readWriteMode>editing visible to all future task runs</readWriteMode>
	</timeSeriesSet>
</variable>
<variable>
	<variableId>output</variableId>
	<timeSeriesSet>
		<moduleInstanceId>FilterLowPassTest</moduleInstanceId>
		<valueType>scalar</valueType>
		<parameterId>H.m</parameterId>
		<locationId>location1</locationId>
		<timeSeriesType>external historical</timeSeriesType>
		<timeStep unit="day"/>
		<relativeViewPeriod unit="day" start="10" end="43"/>
		<readWriteMode>add originals</readWriteMode>
	</timeSeriesSet>
</variable>
<transformation id="filter low pass">
	<filter>
		<lowPass>
			<inputVariable>
				<variableId>input</variableId>
			</inputVariable>
			<coefficientSet>
				<a>0.4</a>
				<a>0.3</a>
				<b>0.2</b>
				<b>0.1</b>
			</coefficientSet>
			<outputVariable>
				<variableId>output</variableId>
			</outputVariable>
		</lowPass>
	</filter>
</transformation>

The example below uses coefficientSetFunctions (available since build 30246). Here the coefficients are defined in coefficientSetFunctions, where @a1@, @a2@, @b0@ and @b1@ refer to location number attributes that are defined in the locationSets configuration file.

<variable>
	<variableId>input</variableId>
	<timeSeriesSet>
		<moduleInstanceId>FilterLowPassWithCoefficientSetFunctionsTest</moduleInstanceId>
		<valueType>scalar</valueType>
		<parameterId>H.obs</parameterId>
		<locationId>locationWithAttributes5</locationId>
		<timeSeriesType>external historical</timeSeriesType>
		<timeStep unit="day"/>
		<relativeViewPeriod unit="day" start="10" end="43"/>
		<readWriteMode>editing visible to all future task runs</readWriteMode>
	</timeSeriesSet>
</variable>
<variable>
	<variableId>output</variableId>
	<timeSeriesSet>
		<moduleInstanceId>FilterLowPassWithCoefficientSetFunctionsTest</moduleInstanceId>
		<valueType>scalar</valueType>
		<parameterId>H.m</parameterId>
		<locationId>locationWithAttributes5</locationId>
		<timeSeriesType>external historical</timeSeriesType>
		<timeStep unit="day"/>
		<relativeViewPeriod unit="day" start="10" end="43"/>
		<readWriteMode>add originals</readWriteMode>
	</timeSeriesSet>
</variable>
<transformation id="filter low pass with coefficient set functions test">
	<filter>
		<lowPass>
			<inputVariable>
				<variableId>input</variableId>
			</inputVariable>
			<coefficientSetFunctions>
				<a>@a1@</a>
				<a>@a2@</a>
				<b>@b0@</b>
				<b>@b1@</b>
			</coefficientSetFunctions>
			<outputVariable>
				<variableId>output</variableId>
			</outputVariable>
		</lowPass>
	</filter>
</transformation>
  • No labels