Fast Fourier transform: Difference between revisions

No edit summary
Line 368:
contains
 
! In place Cooley-Tookey FFT
recursive subroutine fft(x)
complex(kind=dp), dimension(:), intent(inout) :: x
Line 382 ⟶ 383:
allocate(even((N+1)/2))
 
! divide
odd=x(1:N:2)
even=x(2:N:2)
 
! conquer
call fft(odd)
call fft(even)
 
! combine
do i=1,N2
t=exp(cmplx(0.0_dp,-2.0_dp*pi*real(i-1,dp)/real(N,dp)))*even(i)
Line 423 ⟶ 427:
( 0.00, 0.00i )
( 1.00, 2.41i )</pre>
 
 
=={{header|GAP}}==
Anonymous user