📄 dftmerge_c.mht
字号:
From: <由 Microsoft Internet Explorer 5 保存>
Subject:
Date: Wed, 27 Sep 2006 22:46:21 +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/DFTMERGE.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>/* dftmerge.c - DFT merging for radix 2 decimation-in-time =
FFT */
#include <cmplx.h>
void dftmerge(N, XF)
complex *XF;
int N;
{
double pi =3D 4. * atan(1.0);
int k, i, p, q, M;
complex A, B, V, W;
M =3D 2;
while (M <=3D N) { /* two =
\((M/2)\)-DFTs into one \(M\)-DFT */
W =3D cexp(cmplx(0.0, -2 * pi / M)); /* order-\(M\) =
twiddle factor */
V =3D cmplx(1., 0.); /* successive powers =
of \(W\) */
for (k =3D 0; k < M/2; k++) { /* index for an =
\((M/2)\)-DFT */
for (i =3D 0; i < N; i +=3D M) { /* \(i\)th =
butterfly; increment by \(M\) */
p =3D k + i; /* absolute indices =
for */
q =3D p + M / 2; /* \(i\)th butterfly =
*/
A =3D XF[p];
B =3D cmul(XF[q], V); /* \(V =3D W\sp{k}\) =
*/
XF[p] =3D cadd(A, B); /* butterfly =
operations */
XF[q] =3D csub(A, B);
}
V =3D cmul(V, W); /* \(V =3D VW =3D =
W\sp{k+1}\) */
}
M =3D 2 * M; /* next stage */
}
}
</PRE></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -