cosine_transform, a MATLAB 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 a Python version.

Related Data and Programs:


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

haar, a MATLAB code which computes the Haar transform of data.

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

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

walsh, a MATLAB code which implements versions of the Walsh and Haar transforms.

wavelet, a MATLAB 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 20 December 2018.