离散傅里叶变换DFT的推导和lisp实现

lisp 代码:点击打开链接

执行例子:

> (load "ss/dft.ss")
> (dft '(1 1 1 1 1 1 1 1))
(8 0 0 0 0 0 0 0)
> (idft (dft '(1 1 1 1 1 1 1 1)))
(1 1.0 1.0 1.0 1 1.0 1.0 1.0)

> (dft '(1 2 3 4 5 6 7 8))
(36 -4.0+9.65685424949238i -4.0+4.0i -4.0+1.6568542494923797i -4
    -3.9999999999999996-1.6568542494923797i
    -3.9999999999999996-4.0i
    -3.9999999999999987-9.65685424949238i)
> (idft (dft '(1 2 3 4 5 6 7 8)))
(1.0000000000000002+0.0i 2.0000000000000004+1.167434911886255e-16i
  3.0-9.957992501029599e-17i 4.0+2.2776579365114115e-16i
  5.0+0.0i 6.0-1.0530111373640582e-16i
  7.0+9.957992501029599e-17i 8.0-2.3920817110336085e-16i)

你可能感兴趣的:(数学,lisp,scheme)