dfs

Functions

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

dfs [ option ] [ infile ]

  • -a int+

    • denominator coefficients

  • -b int+

    • numerator coefficients

  • -p str

    • file containing denominator coefficients

  • -z str

    • file containing numerator coefficients

  • infile str

    • double-type filter input

  • stdout

    • double-type filter output

The below example applies a pre-emphasis filter to signals in data.d

dfs -a 1 -0.97 < data.d > data.d2

This is equivalent to the following procedure.

echo 1 -0.97 | x2x +ad > data.p
dfs -p data.p < data.d > data.d2
Parameters:
  • argc[in] Number of arguments.

  • argv[in] Argument vector.

Returns:

0 on success, 1 on failure.

See also

df2

class InfiniteImpulseResponseDigitalFilter

Apply infinite impulse response digital filter in time domain.

Input signal is filtered by

\[ H(z) = K \frac{\displaystyle\sum_{m=0}^M b(m) z^{-m}} {1 + \displaystyle\sum_{n=1}^N a(n) z^{-n}}, \]
where \(K\) is the gain.

Public Functions

InfiniteImpulseResponseDigitalFilter(const std::vector<double> &denominator_coefficients, const std::vector<double> &numerator_coefficients)
Parameters:
  • denominator_coefficients[in] Denominator coefficients, \(K\) and \(\{ a(n) \}_{n=1}^N\).

  • numerator_coefficients[in] Numerator coefficients, \(\{ b(m) \}_{m=0}^M\).

inline int GetNumDenominatorOrder() const
Returns:

Order of denominator coefficients.

inline int GetNumNumeratorOrder() const
Returns:

Order of numerator coefficients.

inline bool IsValid() const
Returns:

True if this object is valid.

bool Run(double input, double *output, InfiniteImpulseResponseDigitalFilter::Buffer *buffer) const
Parameters:
  • input[in] Filter input.

  • output[out] Filter output.

  • buffer[inout] Buffer.

Returns:

True on success, false on failure.

bool Run(double *input_and_output, InfiniteImpulseResponseDigitalFilter::Buffer *buffer) const
Parameters:
  • input_and_output[inout] Input/output signal.

  • buffer[inout] Buffer.

Returns:

True on success, false on failure.

class Buffer

Buffer for InfiniteImpulseResponseDigitalFilter class.