Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

discrete cos sum as FFT

2 views
Skip to first unread message

Axel Vogt

unread,
Feb 7, 2009, 3:52:06 PM2/7/09
to
I want to express Sum(z(j)*cos(k*j*Pi/N),j = 0 .. N-1) as some
discrete Fourier sum, z some complex vector.

Using the recipe shortly mentioned at Wikipedia *) for DCT-1 does
not give me the result (not even for z(j) = 1 constant):

The 'even symmetry' for indices beyond N-1 writes as

z(2*N-j-1) = z(j), 0 <= j, j <= N-1 or
z(i+N) = z(-i+N-1), 0 <= i, i <= N-1

Then the DFT of the extended vector writes as

Sum(z(j) * exp(-2*I*k*j*Pi/N), j = 0 .. 2*N-1) =

Sum(z(j) * exp(-2*I*k* j *Pi/N), j = 0 .. N-1)+
Sum(z(j+N)* exp(-2*I*k*(j+N)*Pi/N), j = 0 .. N-1)

using an index change j=j+N in the second sum and using symmetry gives

Sum(z(j) * exp(-2*I*k* j *Pi/N) +
z(-j+N-1)* exp(-2*I*k*(j+N)*Pi/N), j = 0 .. N-1)

which up to a factor of 2 should give the DCT-1

Sum(z(j)*cos(k*j*Pi/N),j = 1 .. N-2)+1/2*z(0)+1/2*(-1)^k*z(N-1)


However z = 1 identically, N=3, k=1 gives me 1/2 for the DCT-1,
but it is 0 for the DFT (using Maple for all that).


This may be my fault - can somebody please help with a validated
formula? I do not want to dig for that within library codes ...
it would be quite error-prone and painful.

Or an idea, what is going wrong?


*) the link is http://en.wikipedia.org/wiki/Discrete_cosine_transform

0 new messages