Modify frequency content of
tsout = filter(tsin,b,a)
tsout = filter(tsin,b,a,ind)
This example applies the following transfer function to a set of data:
timeseries object from the matrix
load count.dat tsin = timeseries(count(:,1),[1:24]);
Enter the coefficients for the denominator and numerator of the transfer function. Order the coefficients in ascending powers of to represent and .
a = [1 0.2]; b = [2 3];
Apply the transfer function using
filter, and compare the original data to the filtered data.
tsout = filter(tsin,b,a); plot(tsin) hold on plot(tsout) legend('Original Data','Filtered Data','Location','NorthWest')
timeseries, specified as a scalar.
tsin must be uniformly sampled.
b— Numerator coefficients
Numerator coefficients of the transfer function, specified as a scalar or vector.
a— Denominator coefficients
Denominator coefficients of the transfer function, specified as a scalar or vector.
ind— Row or column indices
Row or column indices, specified as a positive integer numeric scalar or
ind represents column indices for column-oriented
represents row indices for row-oriented data
The input-output description of the
operation on a vector in the Z-transform domain is a rational transfer function. A
rational transfer function is of the form,
You also can express the rational transfer function as the following difference equation,
Furthermore, you can represent the rational transfer function using its direct
form II transposed implementation, as in the following diagram. Due to
a(1) = 1.
The operation of
filter at sample m is
given by the time domain difference equations