This is really not a problem in Octave or its packages, but rather me
trying to get help from the devs here to modify my implementation in
such a way that I get consistent results.
The challenge I am facing right now is implementing a DCT/IDCT in C
that its output matches that of Octave.
My testing input matrix (x):
1 1 1
2 2 2
3 3 3
Octave's DCT function results in (dct2(x)):
3.46410 3.46410 3.46410
-1.41421 -1.41421 -1.41421
0.00000 0.00000 0.00000
Octave's IDCT function results in (idct2(x)):
1 1 1
2 2 2
3 3 3
So far so good? Below is my implementation in C via FFTW3 (which gives
diff. results). My C code is pasted here: http://codepad.org/cHErvFMn
My DCT (via FFTW3) results are different:
72.00 0.00 0.00
-20.78 0.00 0.00
0.00 0.00 0.00
My IDCT is correct but scalled (if I divide them all by 36, it gets
OK):
36.00 36.00 36.00
72.00 72.00 72.00
108.00 108.00 108.00
Any idea how to alter my code in such a way to get results identical
to that of Octave?
Links that I found so far:
* this guy seems to have explained it (but didn't fully get it):
http://www.dsprelated.com/showmessage/93988/1.php
* FFTW3's page on DCT/IDCT
http://www.fftw.org/doc/1d-Real_002deven-DFTs-_0028DCTs_0029.html
* Matlab's page on DCT/IDCT (which should match Octave's imp.)
http://www.mathworks.com/help/toolbox/signal/ref/dct.html
* Wiki's page on
DCT/IDCThttp://en.wikipedia.org/wiki/Discrete_cosine_transform#DCT-II
To me, all of the links are presenting different equations. Which
makes me wonder what is really going on.
- mtrg
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev