Anonymous user
Fast Fourier transform: Difference between revisions
→{{header|lambdatalk}}
Line 1,473:
=={{header|lambdatalk}}==
<lang scheme>
1) the function fft
{def fft
{lambda {:s :
{if {= {list.length :
then :
else {
▲ {list.map Csub :a :b}}}}
{def rotate
{lambda {:s :
{if {list.null? :f}
then nil
else {cons {Cmul {car :f} {Cexp {Cnew 0 {/ {* :s {PI} :k} :N}}}}
▲ {rotate :s {+ :k 1} :N {cdr :f}}}}}}
2) functions for lists
|