page overview:

A simple way to relate the Discrete Trigonometric Transforms (DTT) to the Generalized Discrete Fourier Transform (GDFT) is by using the Symmetric Extension Operator (SEO).  The SEO was introduced by Martucci in [Mart94] where he presented very neatly the relationships between all the DTTs (type I-IV odd/even) and the four GDFTs.

On this page we provide the code for the GDFT and the SEO and give some examples on how to use it.  Both gdft() and igdft() are vectorized and use the fft() frame-per-column syntax.

We give code for the calculation of all types of DCT (I-IV) in their unitary form. 


The core m-files provided are:


1 - the symmetric extension operator:
The first example generates figure 2 in [Mart94]. The m-file test_seo.m takes no arguments and when you run it you should get the following figure.

Figure 2 from Martucci's paper (click for full resolution)

Those are all the possible ways to symmetrize a sequence.  Most of us are aware of a few of them but in fact there are 16 in total.

2 - GDFT sanity:
In the second example we do some simple tests for the gdft, gdftmtx and the dft.  You can find the code at test_gdft.m with some comments.

3 - derive DCT Type-II:
Here we recreate the formula 19 on page 1043 of [Mart94].  The code in test_dctII.m shows the use of SEO and GDFT to generate the familiar DCT type II transformation matrix.  Notice that the derivation using the SEO does NOT create an orthogonal matrix since it lacks the special normalization factor for the first row.

5 - all the types of DCT:
Here we show some fundamental properties of the four types of even DCT as presented in [Rao90].  I and IV are involutary and all of them are symmetric.  Also type III is the inverse of type II and vice versa.  You can find the code at test_dctall.m.  Some speed comparison with MATLAB's internal dct() is given too.

6 - all the DTTs:
Here we test the inversion and orthogonality properties of all 16 discrete trigonometric transforms (DTTs) in both orthogonal [Wang85] and non orthogonal [Mart94] forms.  The test code is test_dtt.m


[Mart94] S.A. Martucci, "Symmetric convolution and the discrete sine and cosine transforms", IEEE Trans. Sig. Processing SP-42, pp1038-1051, 1994

[Rao90] K.R. Rao P. Yip, "Discrete Cosine Transform", Algorithms, Advantages, Applications", Academic Press INC, 1990, ISBN 0-12-580203-X

[Wang85] Z. Wang and B. Hunt, "The discrete W-transform", Appl. Math. Comput., 16 (1985), pp. 19-48