PDA

View Full Version : Of Fouriers and DCT's


SirDavidGuy
23rd May 2003, 03:48
Since the DCT is basically a fourier transform which mirrors the original sequence and then does a DFT, leaving only the cosine outputs (since no sine waves now exist in the signal), shouldn't the output for the DCT have one more entry in the output array than the input? (Since the real component has N/2 + 1 entries, and the input is doubled)?

TIA

vinouz
24th May 2003, 20:35
since the real component has N/2+1 entries

I don't get you well. What real component. Of the DFT of the input. Then it has N entries theoretically.
(IIRC)

SirDavidGuy
25th May 2003, 01:37
I was under the impression that the real output had N entries, but only the first N/2 + 1 were required to rebuild the signal (the rest being redundant). I think that the answer may rely on the fact that since the DCT is a DFT on the input next to its mirror, that two of the terms aren't required to rebuild it (but all this would be in the time domain).

shlezman
25th May 2003, 17:04
Mathematically you are correct, DCT can be done by mirroring the input data and DFTing it. The output is N length and if the innput signal is real then the first n/2 coefs are the same as the last ones.
In image processing, the input is real and the DCT exploits several mathematical properties of the mirror+dft and dose it all at once.

Usually the input signal is real 8x8 . The DCT is usually done over rows and cols. The output is 8x8 DCT coefficients which are real as well.

SirDavidGuy
26th May 2003, 00:31
So my source was mistaken? Only the first N/2 are required, and not the first N/2 + 1?

shlezman
26th May 2003, 07:36
input sample are x(n) n=0..N-1 (N samples)
extend to y(n) = /x(n) n=0..N-1 (N samples)
|
\x(2N-n-1) n=N..2N-1 (N samples)
so that y(n) has 2N samples.
DFT(y(n)) = Y(n) (also 2N samlpes)
X(n) = (Some norma)*Y(n) n=0..N-1 (N samples)

mybe you are confused by the fact that the numbering
start from 1...N and not 0..N-1

SirDavidGuy
26th May 2003, 15:07
Ah, thank you.

tiki4
27th May 2003, 18:13
For all kinds of information about DFT's and the like you may check fftw.org (http://www.fftw.org). FFTW is a really fast and free set of DFT routines written in C. The documentation maybe interesting to you.

Regards,

tiki4