Functions

int dspl_ap2bpass (double *b, double *a, int n, double wp0, double wp1, double *beta, double *alpha)
 Analog low-pass prototype frequency transformation to a band-pass filter with [wp0 ... wp1] pass-band. More...
 
int dspl_ap2bstop (double *b, double *a, int n, double ws0, double ws1, double *beta, double *alpha)
 Analog low-pass prototype frequency transformation to a band-stop filter with [wp0 ... wp1] stop-band. More...
 
int dspl_ap2high (double *b, double *a, int n, double wp, double *beta, double *alpha)
 Analog low-pass prototype frequency transformation to a high-pass filter with wp cutoff. More...
 
int dspl_ap2low (double *b, double *a, int n, double wp, double *beta, double *alpha)
 Analog low-pass prototype frequency transformation to a low-pass filter with wp cutoff. More...
 
int dspl_butter_ap (double Rp, int ord, double *b, double *a)
 Analog Butterworth filter prototype. More...
 
int dspl_cheby1_ap (double Rp, int ord, double *b, double *a)
 Analog Chebyshev type 1 filter prototype. More...
 
int dspl_cheby2_ap (double Rs, int ord, double *b, double *a)
 Analog Chebyshev type 2 filter prototype. More...
 

Detailed Description

Functions for digital IIR filter design.

Function Documentation

◆ dspl_ap2bpass()

int dspl_ap2bpass ( double *  b,
double *  a,
int  n,
double  wp0,
double  wp1,
double *  beta,
double *  alpha 
)

Analog low-pass prototype frequency transformation to a band-pass filter with [wp0 ... wp1] pass-band.

Function transforms analog prototype filter transfer function \( H_{\text{ap}}(s) \) to a band-pass filter transfer function \( H(s) \):

\[ H(s) = H_{\text{ap}} \left(\frac{s^2 + w^2_0}{B \cdot s} \right), \]

here \(w^2_0 = \) wp0 * wp1, \(wB = \)wp1 - wp0.

Result band-pass filter order is 2*n.

Parameters
[in]bAnalog prototype \( H_{\text{ap}}(s) \) numerator coefficients vector pointer. Vector size is [n+1 x 1].
[in]aAnalog prototype \( H_{\text{ap}}(s) \) denominator coefficients vector pointer. Vector size is [n+1 x 1].
[in]nAnalog prototype filter order
[in]wp0Band-pass low frequency (rad/s) after transformation
[in]wp1Band-pass hight frequency (rad/s) after transformation
[out]betaAnalog band-pass filter \( H(s) \) numerator coefficients vector pointer after transformation. Vector size is [2n+1 x 1].
[out]alphaAnalog band-pass filter \( H(s) \) denominator coefficients vector pointer after transformation. Vector size is [2n+1 x 1].
Returns
DSPL_OK if filter has been transformed successfully or code of error otherwise.
Author
Sergey Bakhurin. www.dsplib.org

◆ dspl_ap2bstop()

int dspl_ap2bstop ( double *  b,
double *  a,
int  n,
double  wp0,
double  wp1,
double *  beta,
double *  alpha 
)

Analog low-pass prototype frequency transformation to a band-stop filter with [wp0 ... wp1] stop-band.

Function transforms analog prototype filter transfer function \( H_{\text{ap}}(s) \) to a band-stop filter transfer function \( H(s) \):

\[ H(s) = H_{\text{ap}} \left(\frac{B \cdot s}{s^2 + w^2_0} \right), \]

here \(w^2_0 = \) wp0 * wp1, \(wB = \)wp1 - wp0.

Result band-stop filter order is 2*n.

Parameters
[in]bAnalog prototype \( H_{\text{ap}}(s) \) numerator coefficients vector pointer. Vector size is [n+1 x 1].
[in]aAnalog prototype \( H_{\text{ap}}(s) \) denominator coefficients vector pointer. Vector size is [n+1 x 1].
[in]nAnalog prototype filter order
[in]wp0Band-stop low frequency (rad/s) after transformation
[in]wp1Band-stop hight frequency (rad/s) after transformation
[out]betaAnalog band-stop filter \( H(s) \) numerator coefficients vector pointer after transformation. Vector size is [2n+1 x 1].
[out]alphaAnalog band-stop filter \( H(s) \) denominator coefficients vector pointer after transformation. Vector size is [2n+1 x 1].
Returns
DSPL_OK if filter has been transformed successfully or code of error otherwise.
Author
Sergey Bakhurin. www.dsplib.org

◆ dspl_ap2high()

int dspl_ap2high ( double *  b,
double *  a,
int  n,
double  wp,
double *  beta,
double *  alpha 
)

Analog low-pass prototype frequency transformation to a high-pass filter with wp cutoff.

Function transforms analog prototype filter transfer function \( H_{\text{ap}}(s) \) to a high-pass filter transfer function \( H(s) \):

\[ H(s) = H_{\text{ap}} \left(\frac{w_p}{s} \right), \]

Result high-pass filter order is n.

Parameters
[in]bAnalog prototype \( H_{\text{ap}}(s) \) numerator coefficients vector pointer. Vector size is [n+1 x 1].
[in]aAnalog prototype \( H_{\text{ap}}(s) \) denominator coefficients vector pointer. Vector size is [n+1 x 1].
[in]nAnalog prototype filter order
[in]wpHigh-pass cutoff frequency (rad/s) after transformation
[out]betaAnalog high-pass filter \( H(s) \) numerator coefficients vector pointer after transformation. Vector size is [n+1 x 1].
[out]alphaAnalog high-pass filter \( H(s) \) denominator coefficients vector pointer after transformation. Vector size is [n+1 x 1].
Returns
DSPL_OK if filter has been transformed successfully or code of error otherwise.
Author
Sergey Bakhurin. www.dsplib.org

◆ dspl_ap2low()

int dspl_ap2low ( double *  b,
double *  a,
int  n,
double  wp,
double *  beta,
double *  alpha 
)

Analog low-pass prototype frequency transformation to a low-pass filter with wp cutoff.

Function transforms analog prototype filter transfer function \( H_{\text{ap}}(s) \) to a low-pass filter transfer function \( H(s) \):

\[ H(s) = H_{\text{ap}} \left(\frac{s}{w_p} \right), \]

Result low-pass filter order is n.

Parameters
[in]bAnalog prototype \( H_{\text{ap}}(s) \) numerator coefficients vector pointer. Vector size is [n+1 x 1].
[in]aAnalog prototype \( H_{\text{ap}}(s) \) denominator coefficients vector pointer. Vector size is [n+1 x 1].
[in]nAnalog prototype filter order
[in]wpLow-pass cutoff frequency (rad/s) after transformation
[out]betaAnalog low-pass filter \( H(s) \) numerator coefficients vector pointer after transformation. Vector size is [n+1 x 1].
[out]alphaAnalog low-pass filter \( H(s) \) denominator coefficients vector pointer after transformation. Vector size is [n+1 x 1].
Returns
DSPL_OK if filter has been transformed successfully or code of error otherwise.
Author
Sergey Bakhurin. www.dsplib.org

◆ dspl_butter_ap()

int dspl_butter_ap ( double  Rp,
int  ord,
double *  b,
double *  a 
)

Analog Butterworth filter prototype.

Function calculates Analog Butterworth filter transfer function \(H(s)\) coefficients. Filter has order ord cutoff frequency 1 rad/s with distortion level -Rp dB in passband (from 0 rad/s to 1 rad/s).

Parameters
[in]RpFilter passband distortions dB. Distortions level from 0 rad/s to 1 rad/s. Must be positive.
[in]ordFilter order. Transfer function \(H(s)\) numerator and denominator coefficients number is ord+1.
[out]bTransfer function \(H(s)\) numerator coefficients vector pointer. Vector size is [ord+1 x 1]. Memory must be allocated.
[out]aTransfer function \(H(s)\) denominator coefficients vector pointer. Vector size is [ord+1 x 1]. Memory must be allocated.
Returns
DSPL_OK Filter is calculated successfully .
DSPL_ERROR_FILTER_RP Parameter Rp must be positive.
DSPL_ERROR_FILTER_ORD Filter order must be positive.
DSPL_ERROR_PTR Pointers b and a cannot be as NULL.
Author
Sergey Bakhurin. www.dsplib.org

◆ dspl_cheby1_ap()

int dspl_cheby1_ap ( double  Rp,
int  ord,
double *  b,
double *  a 
)

Analog Chebyshev type 1 filter prototype.

Function calculates Analog Chebyshev type 1 filter transfer function \(H(s)\) coefficients. Filter has order ord cutoff frequency 1 rad/s with distortion level -Rp dB in passband (from 0 rad/s to 1 rad/s). Chebyshev type 1 filter magnitude is equiripple in passband.

Parameters
[in]RpFilter passband distortions dB. Distortions level from 0 rad/s to 1 rad/s. Must be positive.
[in]ordFilter order. Transfer function \(H(s)\) numerator and denominator coefficients number is ord+1.
[out]bTransfer function \(H(s)\) numerator coefficients vector pointer. Vector size is [ord+1 x 1]. Memory must be allocated.
[out]aTransfer function \(H(s)\) denominator coefficients vector pointer. Vector size is [ord+1 x 1]. Memory must be allocated.
Returns
DSPL_OK Filter is calculated successfully .
DSPL_ERROR_FILTER_RP Parameter Rp must be positive.
DSPL_ERROR_FILTER_ORD Filter order must be positive.
DSPL_ERROR_PTR Pointers b and a cannot be as NULL.
Author
Sergey Bakhurin. www.dsplib.org

◆ dspl_cheby2_ap()

int dspl_cheby2_ap ( double  Rs,
int  ord,
double *  b,
double *  a 
)

Analog Chebyshev type 2 filter prototype.

Function calculates Analog Chebyshev type 2 filter transfer function \(H(s)\) coefficients. Filter has order ord stopband frequency 1 rad/s with suppression level -Rs dB in stopband.

Parameters
[in]RsFilter stopband suppression dB. Must be positive.
[in]ordFilter order. Transfer function \(H(s)\) numerator and denominator coefficients number is ord+1.
[out]bTransfer function \(H(s)\) numerator coefficients vector pointer. Vector size is [ord+1 x 1]. Memory must be allocated.
[out]aTransfer function \(H(s)\) denominator coefficients vector pointer. Vector size is [ord+1 x 1]. Memory must be allocated.
Returns
DSPL_OK Filter is calculated successfully .
DSPL_ERROR_FILTER_RS Parameter Rs must be positive.
DSPL_ERROR_FILTER_ORD Filter order must be positive.
DSPL_ERROR_PTR Pointers b and a cannot be as NULL.
Author
Sergey Bakhurin. www.dsplib.org

Select spelling error with your mouse and press Система Orphus