norm0

Functions

int main(int argc, char *argv[])

norm0 [ option ] [ infile ]

  • -m int

    • order of coefficients \((0 \le M)\)

  • infile str

    • double-type digital filter coefficients

  • stdout

    • double-type converted digital filter coefficients

The below example computes a LPC residual signal by inverse filtering.

frame < data.d | window | lpc -m 20 | norm0 -m 20 > data.b
zerodf -m 20 data.b < data.d > data.e
Parameters:
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

poledf zerodf

class AllPoleToAllZeroDigitalFilterCoefficients

Convert all-pole to all-zero digital filter coefficents vice versa.

The input is the \(M\)-th order filter coefficients:

\[ \begin{array}{cccc} K, & a(1), & \ldots, & a(M), \end{array} \]
and the output is
\[ \begin{array}{cccc} b(0), & b(1), & \ldots, & b(M), \end{array} \]
where
\[\begin{split} b(m) = \left\{ \begin{array}{ll} 1/K, & m = 0 \\ a(m)/K. & 1 \le m \le M \end{array} \right. \end{split}\]

The transfer function of an all-pole digital filter is

\[ H(z) = \frac{K}{1 + \displaystyle\sum_{m=1}^M a(m) z^{-m}}. \]
The inverse filter can be written as
\[\begin{split}\begin{eqnarray} \frac{1}{H(z)} &=& \frac{1 + \displaystyle\sum_{m=1}^M a(m) z^{-m}}{K} \\ &=& \frac{1}{K} + \sum_{m=1}^M \frac{a(m)}{K} z^{-m} \\ &=& \sum_{m=0}^M b(m) z^{-m}. \end{eqnarray}\end{split}\]
The conversion is symmetric.

Public Functions

explicit AllPoleToAllZeroDigitalFilterCoefficients(int num_order)
Parameters:

num_order[in] Order of coefficients, \(M\).

inline int GetNumOrder() const
Returns:

Order of coefficients.

inline bool IsValid() const
Returns:

True if this object is valid.

bool Run(const std::vector<double> &input_filter_coefficients, std::vector<double> *output_filter_coefficients) const
Parameters:
  • input_filter_coefficients[in] \(M\)-th order filter coefficients.

  • output_filter_coefficients[out] Converted \(M\)-th order filter coefficients.

Returns:

True on success, false on failure.

bool Run(std::vector<double> *input_and_output) const
Parameters:

input_and_output[inout] \(M\)-th order filter coefficients.

Returns:

True on success, false on failure.