misc

namespace sptk

Functions

bool ComputePercentagePointOfStandardNormalDistribution(double probability, double *percentage_point)

Compute the percentage point of the standard normal distribution using the formula for the approximation by Toda and Ono.

[1] H. Toda and H. Ono, “The minimax approximation for percentage points of the standard normal distribution,” Japanese journal of applied statistics, vol. 22, no. 1, pp. 13-21, 1993.

Parameters:
  • probability[in] Probability.

  • percentage_point[out] Percentage point.

Returns:

True on success, false on failure.

bool ComputeProbabilityOfTDistribution(double percentage_point, int degrees_of_freedom, double *probability)

Compute the probablity of the t-distribution.

Parameters:
  • percentage_point[in] Percentage point.

  • degrees_of_freedom[in] Degrees of freedom.

  • probability[out] Probability.

Returns:

True on success, false on failure.

bool ComputePercentagePointOfTDistribution(double probability, int degrees_of_freedom, double *percentage_point)

Compute the percentage point of the t-distribution using the Cornish-Fisher expansion in the percentage point of the standard normal distribution.

[1] R. A. Fisher and E. A. Cornish, “The percentile points of distributions having known cumulants,” Technometrics, vol. 2, no. 2, pp. 209-225, 1960.

Parameters:
  • probability[in] Probability.

  • degrees_of_freedom[in] Degrees of freedom.

  • percentage_point[out] Percentage point.

Returns:

True on success, false on failure.

bool MakePseudoQuadratureMirrorFilterBanks(bool inverse, int num_subband, int num_order, double attenuation, int num_iteration, double convergence_threshold, double initial_step_size, std::vector<std::vector<double>> *filter_banks, bool *is_converged)

Make pseudo quadrature mirror filter banks under given condition.

[1] T. Q. Nguyen, “Near-perfect-reconstruction pseudo-QMF banks,” IEEE Transactions on Signal Processing, vol. 42, no. 1, pp. 65-76, 1994.

[2] Y.-P. Lin and P. P. Vaidyanathan, “A Kaiser window approach for the design of prototype filters of cosine modulated filterbanks,” IEEE Signal Processing Letters, vol. 5, no. 6, pp. 132-134, 1998.

[3] F. Cruz-Roldan, P. Amo-Lopez, S. Maldonado-Bascon, and S. S. Lawson, “An efficient and simple method for designing prototype filters for cosine-modulated pseudo-QMF banks,” IEEE Signal Processing Letters, vol. 9, no. 1, pp. 29-31, 2002.

Parameters:
  • inverse[in] If true, filter banks for synthesis is calculated.

  • num_subband[in] Number of subbands.

  • num_order[in] Order of filter.

  • attenuation[in] Stopband attenuation.

  • num_iteration[in] Number of iterations.

  • convergence_threshold[in] Convergence threshold.

  • initial_step_size[in] Initial step size.

  • filter_banks[out] Filter banks.

  • is_converged[out] True if convergence is reached (optional).

Returns:

True on success, false on failure.

bool Perform1DConvolution(const std::vector<double> &f, const std::vector<double> &g, std::vector<double> *result)

Perform 1D convolution.

Parameters:
  • f[in] First input signal.

  • g[in] Second Input signal.

  • result[out] Output signal.

Returns:

True on success, false on failure.

bool ComputeFirstOrderRegressionCoefficients(int n, std::vector<double> *coefficients)

Compute 1st order regression coefficients.

Parameters:
  • n[in] Width of regression coefficients.

  • coefficients[out] Regression coefficients.

Returns:

True on success, false on failure.

bool ComputeSecondOrderRegressionCoefficients(int n, std::vector<double> *coefficients)

Compute 2nd order regression coefficients.

Parameters:
  • n[in] Width of regression coefficients.

  • coefficients[out] Regression coefficients.

Returns:

True on success, false on failure.

bool ComputeLowerAndUpperBounds(double confidence_level, int num_data, const std::vector<double> &mean, const std::vector<double> &variance, std::vector<double> *lower_bound, std::vector<double> *upper_bound)

Compute lower and upper bounds.

Parameters:
  • confidence_level[in] Confidence level.

  • num_data[in] Number of data.

  • mean[in] Mean vector.

  • variance[in] Variance vector.

  • lower_bound[out] Lower bound.

  • upper_bound[out] Upper bound.

Returns:

True on success, false on failure.