for(j=k;j<=kup;j++)
{printf(“%14.7lf”,wtx[j]);}
for(j=k;j<=kup;j++)
{deviat[j]=dev/wtx[j];}
printf(“\n deviation ”);
for(j=k;j<=kup;j++)
{printf(“%14.7lf’,deviat[j]);}
if(type!=1) continue;
for(j=k;j<=kup;j++)
{deviat[j]=20.0*log10(deviat[j]+fx[j]);}
printf(“\n deviation in db”);
for(j=k;j<=kup;j++)
{printf(“%14.7lf”,deviat[j]);}}
for(j=1;j<=nz;j++)
{ix=iext[j];
grid[j]=grid[ix];}
printf(“\n\n extremal frequencies maxima of the error curve\n”);
for(j=1;j<=nz;j++)
{printf(“%12.7lf”,grid[j]);
if(j%5==0) printf(“\n”);}
printf(“\n\n\n”);
for(j=1;j<=70;j++)
{printf(“*”);}
printf(“\n”);}
static double eff(freq,fx,band,type)
double freq,fx[];
int band,type;
{duble effv;
effv=(type!=2)?fx[band]:freq;
return(effv);}
static double wate(freq,fx,wtx,band,type)
int band,type;
double freq,fx[],wtx[];
{double wate-v;
if(type!=2)
{wate-v=wtx[band];}
else
{if(fx[band]>=0.0001)
{wate-v=wtx[band]/freq;}
else
{wate-v=wtx[band];}}
return(wate-v);}
static void remez(nfcns,ngrid,pdev,ad,x,y,alpha,grid,des,wt,iext)
int nfcns,ngrid,iext[];
double *pdev;
double ad[],x[],y[],alpha[],grid[],des[],wt[];
{int j,k,l,k1,nu,nzz,jxt,jet,knz,klow,nut,niter,itrmax,jchnge;
int nz,kup,nut1,luck,nzzmj,kn,nm1,nzmj,kkk,jm1,jp1,nf1j;
double dk,dak,pi2,dnum,dden,dtemp,ynz,yq,err;
double aa,bb,cn,ft,xt,xtl,xe,fsh,gtemp,delf;
double comp=0.0,dev1=-1.0;
double a[67],p[67],q[67];
double d(),gee();
void ouch();
pi2=8.0*atan(1.0);
itrmax=25;
nz=nfcns+1;
nzz=nfcns+2;
niter=0;
while(1)
{iext[nzz]=ngrid+1;
niter++;
if(niter>itrmax) goto 19;
for(j=1;j<=nz;j++)
{jxt=iext[j];
dtemp=grid[jxt];
dtemp=cos(dtemp*pi2);
x[j]=dtemp;}
jet=(nfcns-1)/15+1;
for(j=1;j<=nz;j++)
{ad[j]=d(j,nz,jet,x);}
dnum=0.0;
dden=0.0;
<< 上一页 [21] [22] [23] [24] [25] [26] [27] [28] 下一页