kopia lustrzana https://github.com/Dsplib/libdspl-2.0
some changes
rodzic
c3a60ae256
commit
5e5ec534d1
|
@ -27,44 +27,44 @@
|
|||
|
||||
|
||||
|
||||
/**************************************************************************************************
|
||||
Analog Normalized Butterworth filter
|
||||
***************************************************************************************************/
|
||||
/******************************************************************************
|
||||
Analog Normalized Butterworth filter
|
||||
*******************************************************************************/
|
||||
int DSPL_API butter_ap(double rp, int ord, double* b, double* a)
|
||||
{
|
||||
int res;
|
||||
complex_t *z = NULL;
|
||||
complex_t *p = NULL;
|
||||
int nz, np;
|
||||
int res;
|
||||
complex_t *z = NULL;
|
||||
complex_t *p = NULL;
|
||||
int nz, np;
|
||||
|
||||
if(rp < 0.0)
|
||||
return ERROR_FILTER_RP;
|
||||
if(ord < 1)
|
||||
return ERROR_FILTER_ORD;
|
||||
if(!a || !b)
|
||||
return ERROR_PTR;
|
||||
if(rp < 0.0)
|
||||
return ERROR_FILTER_RP;
|
||||
if(ord < 1)
|
||||
return ERROR_FILTER_ORD;
|
||||
if(!a || !b)
|
||||
return ERROR_PTR;
|
||||
|
||||
z = (complex_t*) malloc(ord*sizeof(complex_t));
|
||||
p = (complex_t*) malloc(ord*sizeof(complex_t));
|
||||
|
||||
|
||||
res = butter_ap_zp(ord, rp, z, &nz, p, &np);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
|
||||
res = filter_zp2ab(z, nz, p, np, ord, b, a);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
z = (complex_t*) malloc(ord*sizeof(complex_t));
|
||||
p = (complex_t*) malloc(ord*sizeof(complex_t));
|
||||
|
||||
|
||||
res = butter_ap_zp(ord, rp, z, &nz, p, &np);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
|
||||
res = filter_zp2ab(z, nz, p, np, ord, b, a);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
|
||||
b[0] = a[0];
|
||||
b[0] = a[0];
|
||||
|
||||
|
||||
exit_label:
|
||||
if(z)
|
||||
free(z);
|
||||
if(p)
|
||||
free(p);
|
||||
return res;
|
||||
if(z)
|
||||
free(z);
|
||||
if(p)
|
||||
free(p);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,47 +74,48 @@ exit_label:
|
|||
|
||||
|
||||
|
||||
/**************************************************************************************************
|
||||
/******************************************************************************
|
||||
Analog Normalized Butterworth filter zeros and poles
|
||||
***************************************************************************************************/
|
||||
int DSPL_API butter_ap_zp(int ord, double rp, complex_t *z, int* nz, complex_t *p, int* np)
|
||||
*******************************************************************************/
|
||||
int DSPL_API butter_ap_zp(int ord, double rp, complex_t *z, int* nz,
|
||||
complex_t *p, int* np)
|
||||
{
|
||||
double alpha;
|
||||
double theta;
|
||||
double ep;
|
||||
int r;
|
||||
int L;
|
||||
int ind = 0, k;
|
||||
double alpha;
|
||||
double theta;
|
||||
double ep;
|
||||
int r;
|
||||
int L;
|
||||
int ind = 0, k;
|
||||
|
||||
if(rp < 0 || rp == 0)
|
||||
return ERROR_FILTER_RP;
|
||||
if(ord < 1)
|
||||
return ERROR_FILTER_ORD;
|
||||
if(!z || !p || !nz || !np)
|
||||
return ERROR_PTR;
|
||||
if(rp < 0 || rp == 0)
|
||||
return ERROR_FILTER_RP;
|
||||
if(ord < 1)
|
||||
return ERROR_FILTER_ORD;
|
||||
if(!z || !p || !nz || !np)
|
||||
return ERROR_PTR;
|
||||
|
||||
ep = sqrt(pow(10.0, rp*0.1) - 1.0);
|
||||
r = ord % 2;
|
||||
L = (int)((ord-r)/2);
|
||||
ep = sqrt(pow(10.0, rp*0.1) - 1.0);
|
||||
r = ord % 2;
|
||||
L = (int)((ord-r)/2);
|
||||
|
||||
alpha = pow(ep, -1.0/(double)ord);
|
||||
if(r)
|
||||
{
|
||||
RE(p[ind]) = -alpha;
|
||||
IM(p[ind]) = 0.0;
|
||||
ind++;
|
||||
}
|
||||
for(k = 0; k < L; k++)
|
||||
{
|
||||
theta = M_PI*(double)(2*k + 1)/(double)(2*ord);
|
||||
RE(p[ind]) = RE(p[ind+1]) = -alpha * sin(theta);
|
||||
IM(p[ind]) = alpha * cos(theta);
|
||||
IM(p[ind+1]) = -alpha * cos(theta);
|
||||
ind+=2;
|
||||
}
|
||||
*np = ord;
|
||||
*nz = 0;
|
||||
return RES_OK;
|
||||
alpha = pow(ep, -1.0/(double)ord);
|
||||
if(r)
|
||||
{
|
||||
RE(p[ind]) = -alpha;
|
||||
IM(p[ind]) = 0.0;
|
||||
ind++;
|
||||
}
|
||||
for(k = 0; k < L; k++)
|
||||
{
|
||||
theta = M_PI*(double)(2*k + 1)/(double)(2*ord);
|
||||
RE(p[ind]) = RE(p[ind+1]) = -alpha * sin(theta);
|
||||
IM(p[ind]) = alpha * cos(theta);
|
||||
IM(p[ind+1]) = -alpha * cos(theta);
|
||||
ind+=2;
|
||||
}
|
||||
*np = ord;
|
||||
*nz = 0;
|
||||
return RES_OK;
|
||||
}
|
||||
|
||||
|
||||
|
@ -122,226 +123,273 @@ int L;
|
|||
|
||||
|
||||
|
||||
/**************************************************************************************************
|
||||
/******************************************************************************
|
||||
Analog Normalized Chebyshev type 1 filter
|
||||
***************************************************************************************************/
|
||||
*******************************************************************************/
|
||||
int DSPL_API cheby1_ap(double rp, int ord, double* b, double* a)
|
||||
{
|
||||
int res;
|
||||
complex_t *z = NULL;
|
||||
complex_t *p = NULL;
|
||||
int nz, np, k;
|
||||
complex_t h0 = {1.0, 0.0};
|
||||
double tmp;
|
||||
|
||||
|
||||
if(rp < 0.0)
|
||||
return ERROR_FILTER_RP;
|
||||
if(ord < 1)
|
||||
return ERROR_FILTER_ORD;
|
||||
if(!a || !b)
|
||||
return ERROR_PTR;
|
||||
int res;
|
||||
complex_t *z = NULL;
|
||||
complex_t *p = NULL;
|
||||
int nz, np, k;
|
||||
complex_t h0 = {1.0, 0.0};
|
||||
double tmp;
|
||||
|
||||
|
||||
if(rp < 0.0)
|
||||
return ERROR_FILTER_RP;
|
||||
if(ord < 1)
|
||||
return ERROR_FILTER_ORD;
|
||||
if(!a || !b)
|
||||
return ERROR_PTR;
|
||||
|
||||
z = (complex_t*) malloc(ord*sizeof(complex_t));
|
||||
p = (complex_t*) malloc(ord*sizeof(complex_t));
|
||||
|
||||
|
||||
res = cheby1_ap_zp(ord, rp, z, &nz, p, &np);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
|
||||
res = filter_zp2ab(z, nz, p, np, ord, b, a);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
z = (complex_t*) malloc(ord*sizeof(complex_t));
|
||||
p = (complex_t*) malloc(ord*sizeof(complex_t));
|
||||
|
||||
|
||||
res = cheby1_ap_zp(ord, rp, z, &nz, p, &np);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
|
||||
res = filter_zp2ab(z, nz, p, np, ord, b, a);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
|
||||
|
||||
if(!(ord % 2))
|
||||
RE(h0) = 1.0 / pow(10.0, rp*0.05);
|
||||
if(!(ord % 2))
|
||||
RE(h0) = 1.0 / pow(10.0, rp*0.05);
|
||||
|
||||
for(k = 0; k < np; k++)
|
||||
{
|
||||
tmp = CMRE(h0, p[k]);
|
||||
IM(h0) = CMIM(h0, p[k]);
|
||||
RE(h0) = tmp;
|
||||
}
|
||||
|
||||
b[0] = fabs(RE(h0));
|
||||
for(k = 0; k < np; k++)
|
||||
{
|
||||
tmp = CMRE(h0, p[k]);
|
||||
IM(h0) = CMIM(h0, p[k]);
|
||||
RE(h0) = tmp;
|
||||
}
|
||||
|
||||
b[0] = fabs(RE(h0));
|
||||
|
||||
exit_label:
|
||||
if(z)
|
||||
free(z);
|
||||
if(p)
|
||||
free(p);
|
||||
return res;
|
||||
if(z)
|
||||
free(z);
|
||||
if(p)
|
||||
free(p);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**************************************************************************************************
|
||||
/******************************************************************************
|
||||
Analog Normalized Chebyshev type 1 filter zeros and poles
|
||||
***************************************************************************************************/
|
||||
int DSPL_API cheby1_ap_zp(int ord, double rp, complex_t *z, int* nz, complex_t *p, int* np)
|
||||
*******************************************************************************/
|
||||
int DSPL_API cheby1_ap_zp(int ord, double rp, complex_t *z, int* nz,
|
||||
complex_t *p, int* np)
|
||||
{
|
||||
double theta;
|
||||
double ep;
|
||||
double beta;
|
||||
double shbeta;
|
||||
double chbeta;
|
||||
int r;
|
||||
int L;
|
||||
int ind = 0, k;
|
||||
double theta;
|
||||
double ep;
|
||||
double beta;
|
||||
double shbeta;
|
||||
double chbeta;
|
||||
int r;
|
||||
int L;
|
||||
int ind = 0, k;
|
||||
|
||||
if(rp < 0 || rp == 0)
|
||||
return ERROR_FILTER_RP;
|
||||
if(ord < 1)
|
||||
return ERROR_FILTER_ORD;
|
||||
if(!z || !p || !nz || !np)
|
||||
return ERROR_PTR;
|
||||
if(rp < 0 || rp == 0)
|
||||
return ERROR_FILTER_RP;
|
||||
if(ord < 1)
|
||||
return ERROR_FILTER_ORD;
|
||||
if(!z || !p || !nz || !np)
|
||||
return ERROR_PTR;
|
||||
|
||||
ep = sqrt(pow(10.0, rp*0.1) - 1.0);
|
||||
r = ord % 2;
|
||||
L = (int)((ord-r)/2);
|
||||
|
||||
|
||||
beta = asinh(1.0/ep)/(double)ord;
|
||||
chbeta = cosh(beta);
|
||||
shbeta = sinh(beta);
|
||||
ep = sqrt(pow(10.0, rp*0.1) - 1.0);
|
||||
r = ord % 2;
|
||||
L = (int)((ord-r)/2);
|
||||
|
||||
|
||||
beta = asinh(1.0/ep)/(double)ord;
|
||||
chbeta = cosh(beta);
|
||||
shbeta = sinh(beta);
|
||||
|
||||
if(r)
|
||||
{
|
||||
RE(p[ind]) = -shbeta;
|
||||
IM(p[ind]) = 0.0;
|
||||
ind++;
|
||||
}
|
||||
for(k = 0; k < L; k++)
|
||||
{
|
||||
theta = M_PI*(double)(2*k + 1)/(double)(2*ord);
|
||||
RE(p[ind]) = RE(p[ind+1]) = -shbeta * sin(theta);
|
||||
IM(p[ind]) = chbeta * cos(theta);
|
||||
IM(p[ind+1]) = -IM(p[ind]);
|
||||
ind+=2;
|
||||
}
|
||||
*np = ord;
|
||||
*nz = 0;
|
||||
return RES_OK;
|
||||
if(r)
|
||||
{
|
||||
RE(p[ind]) = -shbeta;
|
||||
IM(p[ind]) = 0.0;
|
||||
ind++;
|
||||
}
|
||||
for(k = 0; k < L; k++)
|
||||
{
|
||||
theta = M_PI*(double)(2*k + 1)/(double)(2*ord);
|
||||
RE(p[ind]) = RE(p[ind+1]) = -shbeta * sin(theta);
|
||||
IM(p[ind]) = chbeta * cos(theta);
|
||||
IM(p[ind+1]) = -IM(p[ind]);
|
||||
ind+=2;
|
||||
}
|
||||
*np = ord;
|
||||
*nz = 0;
|
||||
return RES_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Analog Normalized Chebyshev type 2 filter
|
||||
*******************************************************************************/
|
||||
int DSPL_API cheby2_ap(double rs, int ord, double* b, double* a)
|
||||
{
|
||||
int res;
|
||||
complex_t *z = NULL;
|
||||
complex_t *p = NULL;
|
||||
int nz, np;
|
||||
double norm;
|
||||
|
||||
|
||||
if(rs < 0.0)
|
||||
return ERROR_FILTER_RP;
|
||||
if(ord < 1)
|
||||
return ERROR_FILTER_ORD;
|
||||
if(!a || !b)
|
||||
return ERROR_PTR;
|
||||
|
||||
z = (complex_t*) malloc(ord*sizeof(complex_t));
|
||||
p = (complex_t*) malloc(ord*sizeof(complex_t));
|
||||
|
||||
|
||||
res = cheby2_ap_zp(ord, rs, z, &nz, p, &np);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
|
||||
res = filter_zp2ab(z, nz, p, np, ord, b, a);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
|
||||
norm = a[0] / b[0];
|
||||
|
||||
for(nz = 0; nz < ord+1; nz++)
|
||||
b[nz]*=norm;
|
||||
|
||||
exit_label:
|
||||
if(z)
|
||||
free(z);
|
||||
if(p)
|
||||
free(p);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
Analog Normalized Chebyshev type 2 filter zeros and poles
|
||||
*******************************************************************************/
|
||||
int DSPL_API cheby2_ap_zp(int ord, double rs, complex_t *z, int* nz,
|
||||
complex_t *p, int* np)
|
||||
{
|
||||
double es;
|
||||
int L, r, k;
|
||||
double beta;
|
||||
int iz, ip;
|
||||
|
||||
double alpha;
|
||||
double chb, shb, sa, ca;
|
||||
double ssh2, cch2;
|
||||
|
||||
if(rs < 0 || rs == 0)
|
||||
return ERROR_FILTER_RS;
|
||||
if(ord < 1)
|
||||
return ERROR_FILTER_ORD;
|
||||
if(!z || !p || !nz || !np)
|
||||
return ERROR_PTR;
|
||||
|
||||
es = sqrt(pow(10.0, rs*0.1) - 1.0);
|
||||
r = ord % 2;
|
||||
L = (int)((ord-r)/2);
|
||||
|
||||
beta = asinh(es)/(double)ord;
|
||||
|
||||
chb = cosh(beta);
|
||||
shb = sinh(beta);
|
||||
|
||||
iz = ip = 0;
|
||||
|
||||
if(r)
|
||||
{
|
||||
RE(p[0]) = -1.0 / sinh(beta);
|
||||
IM(p[0]) = 0.0;
|
||||
ip = 1;
|
||||
}
|
||||
|
||||
for(k = 0; k < L; k++)
|
||||
{
|
||||
alpha = M_PI*(double)(2*k + 1)/(double)(2*ord);
|
||||
sa = sin(alpha);
|
||||
ca = cos(alpha);
|
||||
ssh2 = sa*shb;
|
||||
ssh2 *= ssh2;
|
||||
|
||||
cch2 = ca*chb;
|
||||
cch2 *= cch2;
|
||||
|
||||
RE(z[iz]) = RE(z[iz+1]) = 0.0;
|
||||
IM(z[iz]) = 1.0 / ca;
|
||||
IM(z[iz+1]) = -IM(z[iz]);
|
||||
iz+=2;
|
||||
|
||||
RE(p[ip]) = RE(p[ip+1]) = -sa*shb / (ssh2 + cch2);
|
||||
IM(p[ip]) = ca*chb / (ssh2 + cch2);
|
||||
IM(p[ip+1]) = -IM(p[ip]);
|
||||
ip+=2;
|
||||
}
|
||||
*nz = iz;
|
||||
*np = ip;
|
||||
|
||||
return RES_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**************************************************************************************************
|
||||
Analog Normalized Chebyshev type 2 filter zeros and poles
|
||||
***************************************************************************************************/
|
||||
int DSPL_API cheby2_ap_zp(int ord, double rs, complex_t *z, int* nz, complex_t *p, int* np)
|
||||
{
|
||||
double es;
|
||||
int L, r, k;
|
||||
double beta;
|
||||
int iz, ip;
|
||||
|
||||
double alpha;
|
||||
double chb, shb, sa, ca;
|
||||
double ssh2, cch2;
|
||||
|
||||
if(rs < 0 || rs == 0)
|
||||
return ERROR_FILTER_RS;
|
||||
if(ord < 1)
|
||||
return ERROR_FILTER_ORD;
|
||||
if(!z || !p || !nz || !np)
|
||||
return ERROR_PTR;
|
||||
|
||||
es = sqrt(pow(10.0, rs*0.1) - 1.0);
|
||||
r = ord % 2;
|
||||
L = (int)((ord-r)/2);
|
||||
|
||||
beta = asinh(es)/(double)ord;
|
||||
|
||||
chb = cosh(beta);
|
||||
shb = sinh(beta);
|
||||
|
||||
iz = ip = 0;
|
||||
|
||||
if(r)
|
||||
{
|
||||
RE(p[0]) = -1.0 / sinh(beta);
|
||||
IM(p[0]) = 0.0;
|
||||
ip = 1;
|
||||
}
|
||||
|
||||
for(k = 0; k < L; k++)
|
||||
{
|
||||
alpha = M_PI*(double)(2*k + 1)/(double)(2*ord);
|
||||
sa = sin(alpha);
|
||||
ca = cos(alpha);
|
||||
ssh2 = sa*shb;
|
||||
ssh2 *= ssh2;
|
||||
|
||||
cch2 = ca*chb;
|
||||
cch2 *= cch2;
|
||||
|
||||
RE(z[iz]) = RE(z[iz+1]) = 0.0;
|
||||
IM(z[iz]) = 1.0 / ca;
|
||||
IM(z[iz+1]) = -IM(z[iz]);
|
||||
iz+=2;
|
||||
|
||||
RE(p[ip]) = RE(p[ip+1]) = -sa*shb / (ssh2 + cch2);
|
||||
IM(p[ip]) = ca*chb / (ssh2 + cch2);
|
||||
IM(p[ip+1]) = -IM(p[ip]);
|
||||
ip+=2;
|
||||
}
|
||||
*nz = iz;
|
||||
*np = ip;
|
||||
|
||||
return RES_OK;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**************************************************************************************************
|
||||
/******************************************************************************
|
||||
Zeros and poles to filter coefficients recalc
|
||||
***************************************************************************************************/
|
||||
int DSPL_API filter_zp2ab(complex_t *z, int nz, complex_t *p, int np, int ord, double* b, double* a)
|
||||
*******************************************************************************/
|
||||
int DSPL_API filter_zp2ab(complex_t *z, int nz, complex_t *p, int np,
|
||||
int ord, double* b, double* a)
|
||||
{
|
||||
complex_t *acc = NULL;
|
||||
int res;
|
||||
complex_t *acc = NULL;
|
||||
int res;
|
||||
|
||||
if(!z || !p || !b || !a)
|
||||
return ERROR_PTR;
|
||||
if(nz < 0 || np < 0)
|
||||
return ERROR_SIZE;
|
||||
if(nz > ord || np > ord)
|
||||
return ERROR_POLY_ORD;
|
||||
if(!z || !p || !b || !a)
|
||||
return ERROR_PTR;
|
||||
if(nz < 0 || np < 0)
|
||||
return ERROR_SIZE;
|
||||
if(nz > ord || np > ord)
|
||||
return ERROR_POLY_ORD;
|
||||
|
||||
acc = (complex_t*) malloc((ord+1) * sizeof(complex_t));
|
||||
res = poly_z2a_cmplx(z, nz, ord, acc);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
acc = (complex_t*) malloc((ord+1) * sizeof(complex_t));
|
||||
res = poly_z2a_cmplx(z, nz, ord, acc);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
|
||||
res = cmplx2re(acc, ord+1, b, NULL);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
res = cmplx2re(acc, ord+1, b, NULL);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
|
||||
res = poly_z2a_cmplx(p, np, ord, acc);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
res = poly_z2a_cmplx(p, np, ord, acc);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
|
||||
res = cmplx2re(acc, ord+1, a, NULL);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
res = cmplx2re(acc, ord+1, a, NULL);
|
||||
if(res != RES_OK)
|
||||
goto exit_label;
|
||||
|
||||
|
||||
exit_label:
|
||||
if(acc)
|
||||
free(acc);
|
||||
return res;
|
||||
|
||||
if(acc)
|
||||
free(acc);
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
118
include/dspl.c
118
include/dspl.c
|
@ -35,64 +35,65 @@
|
|||
|
||||
#ifndef BUILD_LIB
|
||||
|
||||
p_acos_cmplx acos_cmplx ;
|
||||
p_asin_cmplx asin_cmplx ;
|
||||
p_butter_ap butter_ap ;
|
||||
p_butter_ap_zp butter_ap_zp ;
|
||||
p_cheby_poly1 cheby_poly1 ;
|
||||
p_cheby_poly2 cheby_poly2 ;
|
||||
p_cheby1_ap cheby1_ap ;
|
||||
p_cheby1_ap_zp cheby1_ap_zp ;
|
||||
p_cheby2_ap_zp cheby2_ap_zp ;
|
||||
p_cmplx2re cmplx2re ;
|
||||
p_concat concat ;
|
||||
p_conv conv ;
|
||||
p_conv_cmplx conv_cmplx ;
|
||||
p_conv_fft_cmplx conv_fft_cmplx ;
|
||||
p_cos_cmplx cos_cmplx ;
|
||||
p_dft dft ;
|
||||
p_dft_cmplx dft_cmplx ;
|
||||
p_dmod dmod ;
|
||||
p_idft_cmplx idft_cmplx ;
|
||||
p_ifft_cmplx ifft_cmplx ;
|
||||
p_dspl_info dspl_info ;
|
||||
p_farrow_lagrange farrow_lagrange ;
|
||||
p_farrow_spline farrow_spline ;
|
||||
p_filter_iir filter_iir ;
|
||||
p_filter_zp2ab filter_zp2ab ;
|
||||
p_fft fft ;
|
||||
p_fft_cmplx fft_cmplx ;
|
||||
p_fft_create fft_create ;
|
||||
p_fft_free fft_free ;
|
||||
p_fft_shift fft_shift ;
|
||||
p_fft_shift_cmplx fft_shift_cmplx ;
|
||||
p_flipip flipip ;
|
||||
p_flipip_cmplx flipip_cmplx ;
|
||||
p_fourier_series_dec fourier_series_dec ;
|
||||
p_fourier_series_rec fourier_series_rec ;
|
||||
p_freqs freqs ;
|
||||
p_freqs_resp freqs_resp ;
|
||||
p_freqs2time freqs2time ;
|
||||
p_freqz freqz ;
|
||||
p_goertzel goertzel ;
|
||||
p_goertzel_cmplx goertzel_cmplx ;
|
||||
p_linspace linspace ;
|
||||
p_log_cmplx log_cmplx ;
|
||||
p_logspace logspace ;
|
||||
p_poly_z2a_cmplx poly_z2a_cmplx ;
|
||||
p_polyval polyval ;
|
||||
p_polyval_cmplx polyval_cmplx ;
|
||||
p_randn randn ;
|
||||
p_randu randu ;
|
||||
p_re2cmplx re2cmplx ;
|
||||
p_signal_pimp signal_pimp ;
|
||||
p_sin_cmplx sin_cmplx ;
|
||||
p_sqrt_cmplx sqrt_cmplx ;
|
||||
p_trapint trapint ;
|
||||
p_trapint_cmplx trapint_cmplx ;
|
||||
p_unwrap unwrap ;
|
||||
p_writebin writebin ;
|
||||
p_writetxt writetxt ;
|
||||
p_acos_cmplx acos_cmplx ;
|
||||
p_asin_cmplx asin_cmplx ;
|
||||
p_butter_ap butter_ap ;
|
||||
p_butter_ap_zp butter_ap_zp ;
|
||||
p_cheby_poly1 cheby_poly1 ;
|
||||
p_cheby_poly2 cheby_poly2 ;
|
||||
p_cheby1_ap cheby1_ap ;
|
||||
p_cheby1_ap_zp cheby1_ap_zp ;
|
||||
p_cheby2_ap cheby2_ap ;
|
||||
p_cheby2_ap_zp cheby2_ap_zp ;
|
||||
p_cmplx2re cmplx2re ;
|
||||
p_concat concat ;
|
||||
p_conv conv ;
|
||||
p_conv_cmplx conv_cmplx ;
|
||||
p_conv_fft_cmplx conv_fft_cmplx ;
|
||||
p_cos_cmplx cos_cmplx ;
|
||||
p_dft dft ;
|
||||
p_dft_cmplx dft_cmplx ;
|
||||
p_dmod dmod ;
|
||||
p_idft_cmplx idft_cmplx ;
|
||||
p_ifft_cmplx ifft_cmplx ;
|
||||
p_dspl_info dspl_info ;
|
||||
p_farrow_lagrange farrow_lagrange ;
|
||||
p_farrow_spline farrow_spline ;
|
||||
p_filter_iir filter_iir ;
|
||||
p_filter_zp2ab filter_zp2ab ;
|
||||
p_fft fft ;
|
||||
p_fft_cmplx fft_cmplx ;
|
||||
p_fft_create fft_create ;
|
||||
p_fft_free fft_free ;
|
||||
p_fft_shift fft_shift ;
|
||||
p_fft_shift_cmplx fft_shift_cmplx ;
|
||||
p_flipip flipip ;
|
||||
p_flipip_cmplx flipip_cmplx ;
|
||||
p_fourier_series_dec fourier_series_dec ;
|
||||
p_fourier_series_rec fourier_series_rec ;
|
||||
p_freqs freqs ;
|
||||
p_freqs_resp freqs_resp ;
|
||||
p_freqs2time freqs2time ;
|
||||
p_freqz freqz ;
|
||||
p_goertzel goertzel ;
|
||||
p_goertzel_cmplx goertzel_cmplx ;
|
||||
p_linspace linspace ;
|
||||
p_log_cmplx log_cmplx ;
|
||||
p_logspace logspace ;
|
||||
p_poly_z2a_cmplx poly_z2a_cmplx ;
|
||||
p_polyval polyval ;
|
||||
p_polyval_cmplx polyval_cmplx ;
|
||||
p_randn randn ;
|
||||
p_randu randu ;
|
||||
p_re2cmplx re2cmplx ;
|
||||
p_signal_pimp signal_pimp ;
|
||||
p_sin_cmplx sin_cmplx ;
|
||||
p_sqrt_cmplx sqrt_cmplx ;
|
||||
p_trapint trapint ;
|
||||
p_trapint_cmplx trapint_cmplx ;
|
||||
p_unwrap unwrap ;
|
||||
p_writebin writebin ;
|
||||
p_writetxt writetxt ;
|
||||
|
||||
#endif //BUILD_LIB
|
||||
|
||||
|
@ -152,6 +153,7 @@ void* dspl_load()
|
|||
LOAD_FUNC(cheby_poly2);
|
||||
LOAD_FUNC(cheby1_ap);
|
||||
LOAD_FUNC(cheby1_ap_zp);
|
||||
LOAD_FUNC(cheby2_ap);
|
||||
LOAD_FUNC(cheby2_ap_zp);
|
||||
LOAD_FUNC(cmplx2re);
|
||||
LOAD_FUNC(concat);
|
||||
|
|
|
@ -241,6 +241,11 @@ DECLARE_FUNC(int, cheby1_ap_zp, int
|
|||
COMMA complex_t*
|
||||
COMMA int*);
|
||||
//------------------------------------------------------------------------------
|
||||
DECLARE_FUNC(int, cheby2_ap, double rs
|
||||
COMMA int ord
|
||||
COMMA double* b
|
||||
COMMA double* a);
|
||||
//------------------------------------------------------------------------------
|
||||
DECLARE_FUNC(int, cheby2_ap_zp, int
|
||||
COMMA double
|
||||
COMMA complex_t*
|
||||
|
|
|
@ -35,64 +35,65 @@
|
|||
|
||||
#ifndef BUILD_LIB
|
||||
|
||||
p_acos_cmplx acos_cmplx ;
|
||||
p_asin_cmplx asin_cmplx ;
|
||||
p_butter_ap butter_ap ;
|
||||
p_butter_ap_zp butter_ap_zp ;
|
||||
p_cheby_poly1 cheby_poly1 ;
|
||||
p_cheby_poly2 cheby_poly2 ;
|
||||
p_cheby1_ap cheby1_ap ;
|
||||
p_cheby1_ap_zp cheby1_ap_zp ;
|
||||
p_cheby2_ap_zp cheby2_ap_zp ;
|
||||
p_cmplx2re cmplx2re ;
|
||||
p_concat concat ;
|
||||
p_conv conv ;
|
||||
p_conv_cmplx conv_cmplx ;
|
||||
p_conv_fft_cmplx conv_fft_cmplx ;
|
||||
p_cos_cmplx cos_cmplx ;
|
||||
p_dft dft ;
|
||||
p_dft_cmplx dft_cmplx ;
|
||||
p_dmod dmod ;
|
||||
p_idft_cmplx idft_cmplx ;
|
||||
p_ifft_cmplx ifft_cmplx ;
|
||||
p_dspl_info dspl_info ;
|
||||
p_farrow_lagrange farrow_lagrange ;
|
||||
p_farrow_spline farrow_spline ;
|
||||
p_filter_iir filter_iir ;
|
||||
p_filter_zp2ab filter_zp2ab ;
|
||||
p_fft fft ;
|
||||
p_fft_cmplx fft_cmplx ;
|
||||
p_fft_create fft_create ;
|
||||
p_fft_free fft_free ;
|
||||
p_fft_shift fft_shift ;
|
||||
p_fft_shift_cmplx fft_shift_cmplx ;
|
||||
p_flipip flipip ;
|
||||
p_flipip_cmplx flipip_cmplx ;
|
||||
p_fourier_series_dec fourier_series_dec ;
|
||||
p_fourier_series_rec fourier_series_rec ;
|
||||
p_freqs freqs ;
|
||||
p_freqs_resp freqs_resp ;
|
||||
p_freqs2time freqs2time ;
|
||||
p_freqz freqz ;
|
||||
p_goertzel goertzel ;
|
||||
p_goertzel_cmplx goertzel_cmplx ;
|
||||
p_linspace linspace ;
|
||||
p_log_cmplx log_cmplx ;
|
||||
p_logspace logspace ;
|
||||
p_poly_z2a_cmplx poly_z2a_cmplx ;
|
||||
p_polyval polyval ;
|
||||
p_polyval_cmplx polyval_cmplx ;
|
||||
p_randn randn ;
|
||||
p_randu randu ;
|
||||
p_re2cmplx re2cmplx ;
|
||||
p_signal_pimp signal_pimp ;
|
||||
p_sin_cmplx sin_cmplx ;
|
||||
p_sqrt_cmplx sqrt_cmplx ;
|
||||
p_trapint trapint ;
|
||||
p_trapint_cmplx trapint_cmplx ;
|
||||
p_unwrap unwrap ;
|
||||
p_writebin writebin ;
|
||||
p_writetxt writetxt ;
|
||||
p_acos_cmplx acos_cmplx ;
|
||||
p_asin_cmplx asin_cmplx ;
|
||||
p_butter_ap butter_ap ;
|
||||
p_butter_ap_zp butter_ap_zp ;
|
||||
p_cheby_poly1 cheby_poly1 ;
|
||||
p_cheby_poly2 cheby_poly2 ;
|
||||
p_cheby1_ap cheby1_ap ;
|
||||
p_cheby1_ap_zp cheby1_ap_zp ;
|
||||
p_cheby2_ap cheby2_ap ;
|
||||
p_cheby2_ap_zp cheby2_ap_zp ;
|
||||
p_cmplx2re cmplx2re ;
|
||||
p_concat concat ;
|
||||
p_conv conv ;
|
||||
p_conv_cmplx conv_cmplx ;
|
||||
p_conv_fft_cmplx conv_fft_cmplx ;
|
||||
p_cos_cmplx cos_cmplx ;
|
||||
p_dft dft ;
|
||||
p_dft_cmplx dft_cmplx ;
|
||||
p_dmod dmod ;
|
||||
p_idft_cmplx idft_cmplx ;
|
||||
p_ifft_cmplx ifft_cmplx ;
|
||||
p_dspl_info dspl_info ;
|
||||
p_farrow_lagrange farrow_lagrange ;
|
||||
p_farrow_spline farrow_spline ;
|
||||
p_filter_iir filter_iir ;
|
||||
p_filter_zp2ab filter_zp2ab ;
|
||||
p_fft fft ;
|
||||
p_fft_cmplx fft_cmplx ;
|
||||
p_fft_create fft_create ;
|
||||
p_fft_free fft_free ;
|
||||
p_fft_shift fft_shift ;
|
||||
p_fft_shift_cmplx fft_shift_cmplx ;
|
||||
p_flipip flipip ;
|
||||
p_flipip_cmplx flipip_cmplx ;
|
||||
p_fourier_series_dec fourier_series_dec ;
|
||||
p_fourier_series_rec fourier_series_rec ;
|
||||
p_freqs freqs ;
|
||||
p_freqs_resp freqs_resp ;
|
||||
p_freqs2time freqs2time ;
|
||||
p_freqz freqz ;
|
||||
p_goertzel goertzel ;
|
||||
p_goertzel_cmplx goertzel_cmplx ;
|
||||
p_linspace linspace ;
|
||||
p_log_cmplx log_cmplx ;
|
||||
p_logspace logspace ;
|
||||
p_poly_z2a_cmplx poly_z2a_cmplx ;
|
||||
p_polyval polyval ;
|
||||
p_polyval_cmplx polyval_cmplx ;
|
||||
p_randn randn ;
|
||||
p_randu randu ;
|
||||
p_re2cmplx re2cmplx ;
|
||||
p_signal_pimp signal_pimp ;
|
||||
p_sin_cmplx sin_cmplx ;
|
||||
p_sqrt_cmplx sqrt_cmplx ;
|
||||
p_trapint trapint ;
|
||||
p_trapint_cmplx trapint_cmplx ;
|
||||
p_unwrap unwrap ;
|
||||
p_writebin writebin ;
|
||||
p_writetxt writetxt ;
|
||||
|
||||
#endif //BUILD_LIB
|
||||
|
||||
|
@ -152,6 +153,7 @@ void* dspl_load()
|
|||
LOAD_FUNC(cheby_poly2);
|
||||
LOAD_FUNC(cheby1_ap);
|
||||
LOAD_FUNC(cheby1_ap_zp);
|
||||
LOAD_FUNC(cheby2_ap);
|
||||
LOAD_FUNC(cheby2_ap_zp);
|
||||
LOAD_FUNC(cmplx2re);
|
||||
LOAD_FUNC(concat);
|
||||
|
|
|
@ -241,6 +241,11 @@ DECLARE_FUNC(int, cheby1_ap_zp, int
|
|||
COMMA complex_t*
|
||||
COMMA int*);
|
||||
//------------------------------------------------------------------------------
|
||||
DECLARE_FUNC(int, cheby2_ap, double rs
|
||||
COMMA int ord
|
||||
COMMA double* b
|
||||
COMMA double* a);
|
||||
//------------------------------------------------------------------------------
|
||||
DECLARE_FUNC(int, cheby2_ap_zp, int
|
||||
COMMA double
|
||||
COMMA complex_t*
|
||||
|
|
Ładowanie…
Reference in New Issue