int i;
double pi,gam,omega,sigma;
pi=4.0*atan(1.0);
gam=pow(((1.0+sqrt(1.0+ep*ep))/ep),1.0/ln);
sigma=0.5*(1.0/gam-gam)*sin((2*(k+1)-1)*pi/(2*ln));
omega=0.5*(1.0/gam+gam)*cos((2*(k+1)-1)*pi/(2*ln));
for(i=0;i<=n;i++)
{
d[i]=0.0;
c[i]=0.0;
}
if(((ln%2)==1)&&((k+1)==(ln+1)/2))
{
d[0]=-sigma;
c[0]=d[0];
c[1]=1.0;
}
else
{
c[0]=sigma*sigma+omega*omega;
c[1]=-2.0*sigma;
c[2]=1.0;
d[0]=c[0];
if(((ln%2)==0)&&(k==0))
d[0]=d[0]/sqrt(1.0+ep*ep);
}
}
static void chebyii(ln,k,n,ws,att,d,c)
double d[],c[],ws,att;
int ln,k,n;
{
int i;
double pi,gam,alpha,beta,sigma,omega,scln,scld;
pi=4.0*atan(1.0);
gam=pow((att+sqrt(att*att-1.0)),1.0/ln);
alpha=0.5*(1.0/gam-gam)*sin((2*(k+1)-1)*pi/(2*ln));
beta=0.5*(1.0/gam+gam)*cos((2*(k+1)-1)*pi/(2*ln));
sigma=ws*alpha/(alpha*alpha+beta*beta);
omega=-1.0*ws*beta/(alpha*alpha+beta*beta);
for(i=0;i<=n;i++)
{
d[i]=0.0;
c[i]=0.0;
}
if(((ln%2)==1)&&((k+1)==(ln+1)/2))
{
d[0]=-1.0*sigma;
c[0]=d[0];
c[1]=1.0;
}
else
{
scln=sigma*sigma+omega*omega;
scld=pow((ws/cos((2*(k+1)-1)*pi/(2*ln))),2);
d[0]=scln*scld;
d[2]=scln;
c[0]=d[0];
c[1]=-2.0*sigma*scld;
c[2]=scld;
}
}
#inlcude <stdlib.h>
static void fblt(d,c,n,band,fln,fhn,b,a)
int n,band;
double fln,fhn,d[],d[],b[],a[];
{
int i,k,m,n1,n2,ls;
double pi,w,w0,w1,w2,tmp ,tmpd,tmpc,*work;
double combin();
void bilinear();
pi=4.0*atan(1.0);
w1=tan(pi*fln);
for(i=n;i>=0;i--)
{
if((c[i]!=0.0)||(d[i]!=0.0))
break;
}
m=i;
switch(band)
{
case1:
case2:
{
n2=m;
n1=n2+1;
if(band==2)
{
for(i=0;i<=m/2;i++)
{
tmp=d[i];
d[i]=d[m-i];
d[m-i]=tmp;
tmp=c[i];
c[i]c[m-i];
c[m-i]=tmp;
}
}
for(i=0;i<=m;i++)
{
d[i]=d[i]/pow(w1,i);
c[i]=c[i]/pow(w1,i);
}
<< 上一页 [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] ... 下一页 >>