« Return to Thread: ack. P. Kienzle: little mistake in documentation of dct/idct (signal package, version 1.0.9)

ack. P. Kienzle: little mistake in documentation of dct/idct (signal package, version 1.0.9)

by Dr.-Ing. Torsten Finke-2 :: Rate this Message:

Reply to Author | View in Thread

Dear Paul,

the help message of DCT says:

...
              N-1
  X[k] = w(k) sum x[n] cos (pi (2n-1) k / 2N ),  k = 0, ..., N-1
              n=0
...

I think the term (2n-1) should be (2n+1). May I suggest to change the help
message.

(It's the same in IDCT)

Reason:

Trying to understand this formula as exactly as possible I wrote my own (very
simple, brute force, could be done much more sophisticated) program according
to that formula:

   function x = myidct(X)
   N = length(X);
   NN = [1:N];
   [k, n] = meshgrid(NN-1, NN-1);
   wk = ones(size(NN)) * sqrt(2/N);
   wk(1) = sqrt(1/N);
   c = cos (pi * (2*n-1) .* k / (2*N));
   s = X(k+1) .* c;
   x = sum(repmat(wk', 1, N) .* s')';

It's results differ from DCT's.

Changing (2n-1) to (2n+1) my function produces the same results as DCT.

This is also conforming to the article at
http://en.wikipedia.org/wiki/Discrete_cosine_transform


Once again thank you for your great and fmaous work

with best regards



Torsten Finke




--

------------------------------------------------------------------------

Dr.-Ing. Torsten Finke                       Amtsgericht Essen HRB 11500
Ingenieurgemeinschaft IgH                    USt-Id.-Nr.: DE 174 626 722
Ges. für Ingenieurleistungen mbH             Geschäftsführung:
Heinz-Bäcker-Str. 34                         Dr.-Ing. S. Rotthäuser
D-45356 Essen                                Dr.-Ing. T. Finke
Tel.: +49 201 / 360-14-17                    Dr.-Ing. W. Hagemeister
Fax.: +49 201 / 360-14-14     Tel.: +49 201 / 360-14-0
torsten.finke@...                  http://www.igh-essen.com

------------------------------------------------------------------------

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Octave-dev mailing list
Octave-dev@...
https://lists.sourceforge.net/lists/listinfo/octave-dev

 « Return to Thread: ack. P. Kienzle: little mistake in documentation of dct/idct (signal package, version 1.0.9)