cosine_transform, a Fortran90 code which demonstrates some simple properties of the discrete cosine transform (DCT) for real data.

The code is not optimized in any way, and is intended instead for investigation and education.


The computer code and data files described and made available on this web page are distributed under the MIT license.


cosine_transform is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.

Related Data and Programs:


fft_serial, a Fortran90 code which demonstrates the computation of a Fast Fourier Transform, and is intended as a starting point for implementing a parallel version.

haar_transform, a Fortran90 code which computes the Haar transform of data.

sftpack, a Fortran90 code which implements the "slow" Fourier transform, intended as a teaching tool and comparison with the fast Fourier transform.

sine_transform, a Fortran90 code which implements the discrete sine transform.

walsh_transform, a Fortran90 code which implements versions of the Walsh and Haar transforms.

wavelet, a Fortran90 code which does some simple calculations with wavelet transforms;


  1. William Briggs, Van Emden Henson,
    The DFT: An Owner's Manual for the Discrete Fourier Transform,
    SIAM, 1995,
    ISBN13: 978-0-898713-42-8,
    LC: QA403.5.B75.
  2. Eleanor Chu, Alan George,
    Inside the FFT Black Box,
    CRC Press,
    ISBN: 0849302706,
    LC: QA403.5C5.

Source Code:

Last modified on 12 June 2020.