--- gforth/fft.fs 2005/12/31 15:46:08 1.2 +++ gforth/fft.fs 2007/10/17 15:50:01 1.4 @@ -70,9 +70,13 @@ Carray expix BEGIN 2dup > WHILE dup 2* swap fft-step REPEAT 2drop drop ; -: normalize ( -- ) #points dup s>f 1/f - 0 DO I values dup z@ 2 fpick zscale z! LOOP fdrop ; +: fftscale ( r -- ) + #points 0 DO I values dup z@ 2 fpick zscale z! LOOP fdrop ; +: normalize ( -- ) #points s>f 1/f fftscale ; : fft ( -- ) #points true (fft ; : rfft ( -- ) #points false (fft ; +: hamming ( -- ) #points 0 DO + I values dup z@ pi I #points fm*/ fsin f**2 f2* zscale z! + LOOP ; \ No newline at end of file