Filtering
Signal Processing (SP) Module

## Classes

class | itpp::Filter< T1, T2, T3 >
| Virtual Filter Base Class. More...
class | itpp::MA_Filter< T1, T2, T3 >
| Moving Average Filter Base Class. More...
class | itpp::AR_Filter< T1, T2, T3 >
| Autoregressive (AR) Filter Base Class. More...
class | itpp::ARMA_Filter< T1, T2, T3 >
| Autoregressive Moving Average (ARMA) Filter Base Class. More...
class | itpp::Freq_Filt< Num_T >
| Freq_Filt Frequency domain filtering using the overlap-add technique. More...

## Functions

vec | itpp::fir1 (int N, double cutoff)
| Design a Nth order FIR filter with cut-off frequency `cutoff` using the window method.
void | itpp::filter_design_autocorrelation (const int N, const vec &f, const vec &m, vec &R)
| Calculate autocorrelation from the specified frequency-response (suitable for filter design)
void | itpp::modified_yule_walker (const int m, const int n, const int N, const vec &R, vec &a)
| Estimation of AR-part in an ARMA model given the autocorrelation.
void | itpp::arma_estimator (const int m, const int n, const vec &R, vec &b, vec &a)
| Estimation of ARMA model given the autocorrelation.
void | itpp::yulewalk (const int N, const vec &f, const vec &m, vec &b, vec &a)
| ARMA filter design using a least-squares fit to the specified frequency-response.
vec | itpp::filter (const vec &b, const vec &a, const vec &input)
| ARMA filter function.
cvec | itpp::filter (const vec &b, const vec &a, const cvec &input)
| ARMA filter function.
cvec | itpp::filter (const cvec &b, const cvec &a, const cvec &input)
| ARMA filter function.
cvec | itpp::filter (const cvec &b, const cvec &a, const vec &input)
| ARMA filter function.
vec | itpp::filter (const vec &b, const int one, const vec &input)
| ARMA filter function.
cvec | itpp::filter (const vec &b, const int one, const cvec &input)
| ARMA filter function.
cvec | itpp::filter (const cvec &b, const int one, const cvec &input)
| ARMA filter function.
cvec | itpp::filter (const cvec &b, const int one, const vec &input)
| ARMA filter function.
vec | itpp::filter (const int one, const vec &a, const vec &input)
| ARMA filter function.
cvec | itpp::filter (const int one, const vec &a, const cvec &input)
| ARMA filter function.
cvec | itpp::filter (const int one, const cvec &a, const cvec &input)
| ARMA filter function.
cvec | itpp::filter (const int one, const cvec &a, const vec &input)
| ARMA filter function.
vec | itpp::filter (const vec &b, const vec &a, const vec &input, const vec &state_in, vec &state_out)
| ARMA filter function.
cvec | itpp::filter (const vec &b, const vec &a, const cvec &input, const cvec &state_in, cvec &state_out)
| ARMA filter function.
cvec | itpp::filter (const cvec &b, const cvec &a, const cvec &input, const cvec &state_in, cvec &state_out)
| ARMA filter function.
cvec | itpp::filter (const cvec &b, const cvec &a, const vec &input, const cvec &state_in, cvec &state_out)
| ARMA filter function.
vec | itpp::filter (const vec &b, const int one, const vec &input, const vec &state_in, vec &state_out)
| ARMA filter function.
cvec | itpp::filter (const vec &b, const int one, const cvec &input, const cvec &state_in, cvec &state_out)
| ARMA filter function.
cvec | itpp::filter (const cvec &b, const int one, const cvec &input, const cvec &state_in, cvec &state_out)
| ARMA filter function.
cvec | itpp::filter (const cvec &b, const int one, const vec &input, const cvec &state_in, cvec &state_out)
| ARMA filter function.
vec | itpp::filter (const int one, const vec &a, const vec &input, const vec &state_in, vec &state_out)
| ARMA filter function.
cvec | itpp::filter (const int one, const vec &a, const cvec &input, const cvec &state_in, cvec &state_out)
| ARMA filter function.
cvec | itpp::filter (const int one, const cvec &a, const cvec &input, const cvec &state_in, cvec &state_out)
| ARMA filter function.
cvec | itpp::filter (const int one, const cvec &a, const vec &input, const cvec &state_in, cvec &state_out)
| ARMA filter function.
void | itpp::polystab (const vec &a, vec &out)
| Polynomial Stabilization.
void | itpp::polystab (const cvec &a, cvec &out)
| Polynomial Stabilization.
vec | itpp::polystab (const vec &a)
| Polynomial Stabilization.
cvec | itpp::polystab (const cvec &a)
| Polynomial Stabilization.
void | itpp::freqz (const cvec &b, const cvec &a, const int N, cvec &h, vec &w)
| Frequency response of filter.
cvec | itpp::freqz (const cvec &b, const cvec &a, const int N)
| Frequency response of filter.
cvec | itpp::freqz (const cvec &b, const cvec &a, const vec &w)
| Frequency response of filter.
void | itpp::freqz (const vec &b, const vec &a, const int N, cvec &h, vec &w)
| Frequency response of filter.
cvec | itpp::freqz (const vec &b, const vec &a, const int N)
| Frequency response of filter.
cvec | itpp::freqz (const vec &b, const vec &a, const vec &w)
| Frequency response of filter.

## Detailed Description

## Function Documentation

## filter() [1/24]

ITPP_EXPORT vec itpp::filter | ( | const vec & | b,
|  | const vec & | a,
|  | const vec & | input
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 39 of file filter.cpp.

Referenced by itpp::arma_estimator(), and itpp::Filter< T1, T2, T3 >::operator()().

## fir1()

ITPP_EXPORT vec itpp::fir1 | ( | int | N,
|  | double | cutoff
| ) |  |

Design a Nth order FIR filter with cut-off frequency `cutoff` using the window method.

Definition at line 243 of file filter.cpp.

References itpp::hamming(), itpp::length(), itpp::sinc(), and itpp::sum().

## polystab() [1/4]

ITPP_EXPORT void itpp::polystab | ( | const vec & | a,
|  | vec & | out
| ) |  |

Polynomial Stabilization.

Author
  Tony Ottosson

Stabilizes the polynomial transfer function by replacing all roots outside the unit cirlce with their reflection inside the unit circle.

Definition at line 45 of file filter_design.cpp.

References itpp::abs(), itpp::conj(), itpp::poly(), itpp::real(), itpp::roots(), and itpp::Array< T >::size().

Referenced by itpp::modified_yule_walker(), itpp::polystab(), and itpp::polystab().

## freqz() [1/6]

ITPP_EXPORT void itpp::freqz | ( | const cvec & | b,
|  | const cvec & | a,
|  | const int | N,
|  | cvec & | h,
|  | vec & | w
| ) |  |

Frequency response of filter.

Author
  Tony Ottosson

Calculates the N-point frequency response of the supplied digital filter over the frequencies w. If w is not given the response is evaluated over the range 0 to with N values. The default value of N is 512.

If `w` is supplied polyval() is used. Otherwise the calculation is based on the fft.

Definition at line 71 of file filter_design.cpp.

References itpp::elem_div(), itpp::fft(), itpp::linspace(), and itpp::pi.

Referenced by itpp::freqz(), and itpp::freqz().

## filter_design_autocorrelation()

ITPP_EXPORT void itpp::filter_design_autocorrelation | ( | const int | N,
|  | const vec & | f,
|  | const vec & | m,
|  | vec & | R
| ) |  |

Calculate autocorrelation from the specified frequency-response (suitable for filter design)

Author
  Tony Ottosson

Calculates the autocorrelation function of size `N` corresponding to the specified frequency response. Useful as a first step in designing filters.

The vectors `f` and `m` is the frequency response. The frequencies should be between 0 and 1.0 (equal to half the sample rate) in increasing order. Both 0.0 and 1.0 must be included. The frequency response is upsampled to 512 points and the autocorrelation is ifft of the power magnitude response of the upsampled frequency response.

Definition at line 153 of file filter_design.cpp.

References itpp::concat(), itpp::floor_i(), itpp::ifft_real(), it_assert, itpp::reverse(), itpp::Array< T >::size(), itpp::sqr(), and itpp::to_cvec().

Referenced by itpp::yulewalk().

## modified_yule_walker()

ITPP_EXPORT void itpp::modified_yule_walker | ( | const int | m,
|  | const int | n,
|  | const int | N,
|  | const vec & | R,
|  | vec & | a
| ) |  |

Estimation of AR-part in an ARMA model given the autocorrelation.

Author
  Tony Ottosson

Estimates the AR-part of an ARMA model from the given autocorrelation. The AR part is of order `n`. The overdetermined modified Yule-Walker equations are used.

If then the system is overdetermined and a least squares solution is used. As a rule of thumb use

The parameter `m` is the order of the MA-part such that .

The supplied autocorrelation should at least be of size `N`.

References: Stoica and Moses, Introduction to spectral analysis, Prentice Hall, 1997.

Definition at line 197 of file filter_design.cpp.

References itpp::backslash(), itpp::concat(), it_assert, itpp::polystab(), itpp::reverse(), itpp::Array< T >::size(), and itpp::toeplitz().

Referenced by itpp::arma_estimator().

## arma_estimator()

ITPP_EXPORT void itpp::arma_estimator | ( | const int | m,
|  | const int | n,
|  | const vec & | R,
|  | vec & | b,
|  | vec & | a
| ) |  |

Estimation of ARMA model given the autocorrelation.

Author
  Tony Ottosson

Estimates an ARMA model from the given autocorrelation. The AR part is of order `n` and the MA part is of order `m`.

The AR part (the denominator) is calcuated using the modified Yule-Walker equations. The the MA part (the nominator) is calculated by calculating the inverse magnitude spectrum using FFTs of size 512 which is an AR-system. This AR-system is then solved using the Levinson-Durbin algorithm.

The supplied autocorrelation is windowed using a Hamming window of size and hence should at least be of that size.

References: [1] Stoica and Moses, Introduction to spectral analysis, Prentice Hall, 1997. [2] B. Friedlander and B. Porat, The modified Yule-Walker method of ARMA spectral estimation, IEEE Trans. Aerospace and Electronic Systems, Vol. AES-20, No. 2, pp. 158–173, March 1984.

Definition at line 228 of file filter_design.cpp.

References itpp::backslash(), itpp::concat(), itpp::cos(), itpp::elem_div(), itpp::elem_mult(), itpp::exp(), itpp::fft(), itpp::fft_real(), itpp::filter(), itpp::ifft(), it_assert, itpp::linspace(), itpp::log(), itpp::modified_yule_walker(), itpp::pi, itpp::real(), itpp::to_cmat(), itpp::to_cvec(), itpp::toeplitz(), itpp::zeros(), and itpp::zeros_c().

Referenced by itpp::yulewalk().

## yulewalk()

ITPP_EXPORT void itpp::yulewalk | ( | const int | N,
|  | const vec & | f,
|  | const vec & | m,
|  | vec & | b,
|  | vec & | a
| ) |  |

ARMA filter design using a least-squares fit to the specified frequency-response.

Author
  Tony Ottosson

The arma_estimator() function is used to calculate the a and b coefficients.

The vectors `f` and `m` is the frequency response. The frequencies should be between 0 and 1.0 (equal to half the sample rate) in increasing order. Both 0.0 and 1.0 must be included. The filter_design_autocorrelation() fucnction is used to interpolate the frequency response and calculate the corresponding autocorrelation.

Observe: this function will not always give exactly the same result as the matlab yulewalk function.

Definition at line 269 of file filter_design.cpp.

References itpp::arma_estimator(), itpp::filter_design_autocorrelation(), it_assert, and itpp::Array< T >::size().

## filter() [2/24]

ITPP_EXPORT cvec itpp::filter | ( | const vec & | b,
|  | const vec & | a,
|  | const cvec & | input
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 45 of file filter.cpp.

## filter() [3/24]

ITPP_EXPORT cvec itpp::filter | ( | const cvec & | b,
|  | const cvec & | a,
|  | const cvec & | input
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 51 of file filter.cpp.

## filter() [4/24]

ITPP_EXPORT cvec itpp::filter | ( | const cvec & | b,
|  | const cvec & | a,
|  | const vec & | input
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 57 of file filter.cpp.

## filter() [5/24]

ITPP_EXPORT vec itpp::filter | ( | const vec & | b,
|  | const int | one,
|  | const vec & | input
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 64 of file filter.cpp.

References it_assert.

## filter() [6/24]

ITPP_EXPORT cvec itpp::filter | ( | const vec & | b,
|  | const int | one,
|  | const cvec & | input
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 71 of file filter.cpp.

References it_assert.

## filter() [7/24]

ITPP_EXPORT cvec itpp::filter | ( | const cvec & | b,
|  | const int | one,
|  | const cvec & | input
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 78 of file filter.cpp.

References it_assert.

## filter() [8/24]

ITPP_EXPORT cvec itpp::filter | ( | const cvec & | b,
|  | const int | one,
|  | const vec & | input
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 85 of file filter.cpp.

References it_assert.

## filter() [9/24]

ITPP_EXPORT vec itpp::filter | ( | const int | one,
|  | const vec & | a,
|  | const vec & | input
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 93 of file filter.cpp.

References it_assert.

## filter() [10/24]

ITPP_EXPORT cvec itpp::filter | ( | const int | one,
|  | const vec & | a,
|  | const cvec & | input
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 100 of file filter.cpp.

References it_assert.

## filter() [11/24]

ITPP_EXPORT cvec itpp::filter | ( | const int | one,
|  | const cvec & | a,
|  | const cvec & | input
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 107 of file filter.cpp.

References it_assert.

## filter() [12/24]

ITPP_EXPORT cvec itpp::filter | ( | const int | one,
|  | const cvec & | a,
|  | const vec & | input
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 114 of file filter.cpp.

References it_assert.

## filter() [13/24]

ITPP_EXPORT vec itpp::filter | ( | const vec & | b,
|  | const vec & | a,
|  | const vec & | input,
|  | const vec & | state_in,
|  | vec & | state_out
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 125 of file filter.cpp.

## filter() [14/24]

ITPP_EXPORT cvec itpp::filter | ( | const vec & | b,
|  | const vec & | a,
|  | const cvec & | input,
|  | const cvec & | state_in,
|  | cvec & | state_out
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 134 of file filter.cpp.

## filter() [15/24]

ITPP_EXPORT cvec itpp::filter | ( | const cvec & | b,
|  | const cvec & | a,
|  | const cvec & | input,
|  | const cvec & | state_in,
|  | cvec & | state_out
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 143 of file filter.cpp.

## filter() [16/24]

ITPP_EXPORT cvec itpp::filter | ( | const cvec & | b,
|  | const cvec & | a,
|  | const vec & | input,
|  | const cvec & | state_in,
|  | cvec & | state_out
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 152 of file filter.cpp.

## filter() [17/24]

ITPP_EXPORT vec itpp::filter | ( | const vec & | b,
|  | const int | one,
|  | const vec & | input,
|  | const vec & | state_in,
|  | vec & | state_out
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 162 of file filter.cpp.

References it_assert.

## filter() [18/24]

ITPP_EXPORT cvec itpp::filter | ( | const vec & | b,
|  | const int | one,
|  | const cvec & | input,
|  | const cvec & | state_in,
|  | cvec & | state_out
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 172 of file filter.cpp.

References it_assert.

## filter() [19/24]

ITPP_EXPORT cvec itpp::filter | ( | const cvec & | b,
|  | const int | one,
|  | const cvec & | input,
|  | const cvec & | state_in,
|  | cvec & | state_out
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 182 of file filter.cpp.

References it_assert.

## filter() [20/24]

ITPP_EXPORT cvec itpp::filter | ( | const cvec & | b,
|  | const int | one,
|  | const vec & | input,
|  | const cvec & | state_in,
|  | cvec & | state_out
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 192 of file filter.cpp.

References it_assert.

## filter() [21/24]

ITPP_EXPORT vec itpp::filter | ( | const int | one,
|  | const vec & | a,
|  | const vec & | input,
|  | const vec & | state_in,
|  | vec & | state_out
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 203 of file filter.cpp.

References it_assert.

## filter() [22/24]

ITPP_EXPORT cvec itpp::filter | ( | const int | one,
|  | const vec & | a,
|  | const cvec & | input,
|  | const cvec & | state_in,
|  | cvec & | state_out
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 213 of file filter.cpp.

References it_assert.

## filter() [23/24]

ITPP_EXPORT cvec itpp::filter | ( | const int | one,
|  | const cvec & | a,
|  | const cvec & | input,
|  | const cvec & | state_in,
|  | cvec & | state_out
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 223 of file filter.cpp.

References it_assert.

## filter() [24/24]

ITPP_EXPORT cvec itpp::filter | ( | const int | one,
|  | const cvec & | a,
|  | const vec & | input,
|  | const cvec & | state_in,
|  | cvec & | state_out
| ) |  |

ARMA filter function.

These functions implements a autoregressive moving average (ARMA) filter according to

where a and b are the filter coefficients, x is the input and y is the output.

Setting a=1 gives a MA filter and b=1 gives a AR filter. The length of the output vector equals the length of the input vector. The state vectors state_in and state_out is of length .

If no start state state_in is given it is set to zero.

Definition at line 233 of file filter.cpp.

References it_assert.

## polystab() [2/4]

ITPP_EXPORT void itpp::polystab | ( | const cvec & | a,
|  | cvec & | out
| ) |  |

Polynomial Stabilization.

Author
  Tony Ottosson

Stabilizes the polynomial transfer function by replacing all roots outside the unit cirlce with their reflection inside the unit circle.

Definition at line 57 of file filter_design.cpp.

References itpp::abs(), itpp::conj(), itpp::poly(), itpp::roots(), and itpp::Array< T >::size().

## freqz() [2/6]

ITPP_EXPORT cvec itpp::freqz | ( | const cvec & | b,
|  | const cvec & | a,
|  | const int | N
| ) |  |

Frequency response of filter.

Author
  Tony Ottosson

Calculates the N-point frequency response of the supplied digital filter over the frequencies w. If w is not given the response is evaluated over the range 0 to with N values. The default value of N is 512.

If `w` is supplied polyval() is used. Otherwise the calculation is based on the fft.

Definition at line 85 of file filter_design.cpp.

References itpp::freqz().

## freqz() [3/6]

ITPP_EXPORT cvec itpp::freqz | ( | const cvec & | b,
|  | const cvec & | a,
|  | const vec & | w
| ) |  |

Frequency response of filter.

Author
  Tony Ottosson

Calculates the N-point frequency response of the supplied digital filter over the frequencies w. If w is not given the response is evaluated over the range 0 to with N values. The default value of N is 512.

If `w` is supplied polyval() is used. Otherwise the calculation is based on the fft.

Definition at line 96 of file filter_design.cpp.

References itpp::cos(), itpp::elem_div(), itpp::polyval(), itpp::sin(), itpp::Array< T >::size(), itpp::to_cvec(), and itpp::zero_pad().

## freqz() [4/6]

ITPP_EXPORT void itpp::freqz | ( | const vec & | b,
|  | const vec & | a,
|  | const int | N,
|  | cvec & | h,
|  | vec & | w
| ) |  |

Frequency response of filter.

Author
  Tony Ottosson

Calculates the N-point frequency response of the supplied digital filter over the frequencies w. If w is not given the response is evaluated over the range 0 to with N values. The default value of N is 512.

If `w` is supplied polyval() is used. Otherwise the calculation is based on the fft.

Definition at line 111 of file filter_design.cpp.

References itpp::elem_div(), itpp::fft_real(), itpp::linspace(), and itpp::pi.

## freqz() [5/6]

ITPP_EXPORT cvec itpp::freqz | ( | const vec & | b,
|  | const vec & | a,
|  | const int | N
| ) |  |

Frequency response of filter.

Author
  Tony Ottosson

Calculates the N-point frequency response of the supplied digital filter over the frequencies w. If w is not given the response is evaluated over the range 0 to with N values. The default value of N is 512.

If `w` is supplied polyval() is used. Otherwise the calculation is based on the fft.

Definition at line 125 of file filter_design.cpp.

References itpp::freqz().

## freqz() [6/6]

ITPP_EXPORT cvec itpp::freqz | ( | const vec & | b,
|  | const vec & | a,
|  | const vec & | w
| ) |  |

Frequency response of filter.

Author
  Tony Ottosson

Calculates the N-point frequency response of the supplied digital filter over the frequencies w. If w is not given the response is evaluated over the range 0 to with N values. The default value of N is 512.

If `w` is supplied polyval() is used. Otherwise the calculation is based on the fft.

Definition at line 136 of file filter_design.cpp.

References itpp::cos(), itpp::elem_div(), itpp::polyval(), itpp::sin(), itpp::Array< T >::size(), itpp::to_cvec(), and itpp::zero_pad().

## polystab() [3/4]

vec itpp::polystab | ( | const vec & | a | ) |

inline

Polynomial Stabilization.

Author
  Tony Ottosson

Stabilizes the polynomial transfer function by replacing all roots outside the unit cirlce with their reflection inside the unit circle.

Definition at line 56 of file filter_design.h.

References itpp::polystab().

## polystab() [4/4]

cvec itpp::polystab | ( | const cvec & | a | ) |

inline

Polynomial Stabilization.

Author
  Tony Ottosson

Stabilizes the polynomial transfer function by replacing all roots outside the unit cirlce with their reflection inside the unit circle.

Definition at line 58 of file filter_design.h.

References itpp::polystab().

Generated on Mon Jun 10 2024 11:49:31 for IT++ by Doxygen 1.9.8