📄 shuffle_c.mht
字号:
From: <由 Microsoft Internet Explorer 5 保存>
Subject:
Date: Wed, 27 Sep 2006 22:47:27 +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/SHUFFLE.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>/* shuffle.c - in-place shuffling (bit-reversal) of a complex =
array */
#include <cmplx.h>
void swap();
int bitrev();
void shuffle(N, X)
complex *X;
int N; /* \(N\) must be a power of 2 =
*/
{
int n, r, B=3D1;
while ( (N >> B) > 0 ) /* \(B\) =3D number =
of bits */
B++;
B--; /* \(N =3D 2\sp{B}\) */
for (n =3D 0; n < N; n++) {
r =3D bitrev(n, B); /* bit-reversed version of =
\(n\) */
if (r < n) continue; /* swap only half of the =
\(n\)s */
swap(X+n, X+r); /* swap by addresses */
}
}
</PRE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -