A subroutine (FFTDC2) coded in Fortran 77 is described, which performs a Fast Fourier Transform or Discrete Fourier Transform together with necessary conditioning steps of trend removal, extension, and windowing. The source code for the entire library of required subroutines is provided with the digital release of this report. But, there is only one required entry point, the subroutine call to FFTDC2; all the other subroutines are operationally transparent to the user. Complete instructions for use of FFTDC2.F (as well as for all the other subroutines) and some practical theoretical discussions are included as comments at the beginning of the source code. This subroutine is intended to be an efficient tool for the programmer in a variety of production-level signal-processing applications.