Recall that a time shift of t0 can be implemented in
the Fourier domain by multiplication by
.Likewise, in the Fourier domain,
the frequency interval used by subroutine ftu() ,
namely, ,can be shifted to the friendlier interval
by a weighting function in the time domain.
That weighting function is where happens to be the Nyquist frequency,
i.e. alternate points on the time axis are to be multiplied by -1.
A subroutine for this purpose is fth().
# FT a vector in a matrix, with first omega = - pi
#
subroutine fth( adj,sign, m1, n12, cx)
integer i, adj, m1, n12
real sign
complex cx(m1,n12)
temporary complex temp(n12)
do i= 1, n12
temp(i) = cx(1,i)
if( adj == 0) { do i= 2, n12, 2
temp(i) = -temp(i)
call ftu( sign, n12, temp)
}
else { call ftu( -sign, n12, temp)
do i= 2, n12, 2
temp(i) = -temp(i)
}
do i= 1, n12
cx(1,i) = temp(i)
return; end
To Fourier transform a 1024-point complex vector cx(1024) and then inverse transform it, we would write
call fth( 0, 1., 1, 1024, cx) call fth( 1, 1., 1, 1024, cx)
You might wonder about the apparent redundancy of using both the argument adj and the argument sign. Having two arguments instead of one allows us to define the forward transform for a time axis with the opposite sign as the forward transform for a space axis.
The subroutine fth() is somewhat cluttered by the inclusion of a frequently needed practical feature--namely, the facility to extract vectors from a matrix, transform the vectors, and then restore them into the matrix.