ran1f_c.mht

来自「常用的DSP算法集锦」· MHT 代码 · 共 37 行

MHT
37
字号
From: <由 Microsoft Internet Explorer 5 保存>
Subject: 
Date: Wed, 27 Sep 2006 22:48:40 +0800
MIME-Version: 1.0
Content-Type: text/html;
	charset="gb2312"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.oxbad.com/DSP/maindoc/arithmetic_source/c/RAN1F.C
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2962

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dgb2312">
<META content=3D"MSHTML 6.00.2900.2963" name=3DGENERATOR></HEAD>
<BODY><PRE>/* ran1f.c - 1/f random number generator */

double ranh();                              /* random hold periodic =
generator */

double ran1f(B, u, q, iseed)                /* usage: y =3D ran1f(B, u, =
q, &amp;iseed); */
int B, *q;                                  /* \(q, u\) are =
\(B\)-dimensional */
double *u;
long *iseed;                                /* passed by address */
{
    double y;
    int b;

    for(y=3D0, b=3D0; b&lt;B; b++)
          y +=3D ranh(1&lt;&lt;b, u+b, q+b, iseed);         /* period =
=3D (1&lt;&lt;b) =3D 2\(\sp{b}\) */

    return y / B;
}
</PRE></BODY></HTML>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?