[Scilab-users] discrete cosine transform

grivet grivet at cnrs-orleans.fr
Mon Oct 8 16:08:22 CEST 2012


Hello,

I am interested in using the dscrete cosine transfomr function that is 
now part of Scilab 5.4.
To try this function, I modified the example given in the Help, as follows
     sample_rate=1000;
     t = 0:1/sample_rate:0.6;
     N=size(t,'*'); //number of samples
     s=cos(2*%pi*100*t).*exp(-20*t)+cos(2*%pi*200*t).*exp(-20*t)+ 
cos(2*%pi*300*t).*exp(-20*t)+cos(2*%pi*400*t).*exp(-20*t);
     s(1) = 0.5*s(1);
     d=dct(s,"dct1");
     clf();scf(0);
     plot(d);
I expected to see a plot of 4 lorentzian functions ( ~ 1/(1+x^2)) with 
increasing frequencies. But, surprise, I get 4 functions
that smoothly evolve from ~ 1/(1+x^2) (absorption) to ~ x/(1+x^2) 
(dispersion) shape. In other words, the transform shows
a linear phase increase, from 0 to pi/2.
This is surprising since dct1 (or DCT-I) is, according to textbooks, 
equivalent to the discrete Fourier tranform of a set of real
numbers. Apart from discretization and truncation problems, this is 
close to the analytical transform.

On the other hand, dct4 leads to a pure absorption phase transform, 
which is what I need.
Can somebody explain the subltle features of the DCT ?

Thank you in advance,
JP Grivet





More information about the users mailing list