[Scilab-users] discrete cosine transform

classic Classic list List threaded Threaded
5 messages Options
grivet grivet
Reply | Threaded
Open this post in threaded view
|

[Scilab-users] discrete cosine transform

Hello,
I have found a strange and, for me annoying, behavior of the dct funtion
(discrete cosine transform). A minimal example follows.

    clear;
    imax1 = 128; imax2 = 64;
   sig = rand(imax1,imax2);
   for i1 = 1:imax1
     sig1(i1,:) = fft(sig(i1,:));
   end
   for i2 = 1:imax2
     spc(:,i2) = dct(real(sig1(:,i2)),"dct1");
   end

This program executes without a hitch; however, it fails when I choose
imax1 = imax2 (whatever the value), with error message

Warning !!!
Scilab has found a critical error (EXCEPTION_ACCESS_VIOLATION)
with "dct" function.
Save your data and restart Scilab.
end
  !--error 115
Problème de pile détecté pendant une boucle.
Une fonction primitive a été appelée avec un nombre erroné d'arguments
de sortie.
Aucun test sur les arguments de sortie n'a pu être effectué dans cette
fonction.
Veuillez rapporter ce bug :
http://bugzilla.scilab.org/
at line       9 of exec file called by :
exec(%fileToExec);                 disp(msprintf(gettext("Execution done.
while executing a callback

i find it surprising that Scilab's behavior is somewhat random: the
error message is not always the same and a fresh Scilab can
behave differently than when is runs the program several times in a row.

I have also seen the following message

Warning !!!
Scilab has found a critical error (EXCEPTION_ACCESS_VIOLATION)
with "dct" function.
Save your data and restart Scilab.
  !--error 10000
L'affectation d'une chaîne de caractères dans une matrice de nombres
n'est pas implémentée.
at line       7 of function %c_i_s called by :
  spc(:,i2) = dct(real(sig1(:,i2)),"dct1");
at line      10 of exec file called by :
       exec(%fileToExec); disp(msprintf(gettext("Execution done.\n"))
while executing a callback

I would be grateful to learn about a workaround.
Thank you in advance
JP Grivet

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Stanislav Stanislav
Reply | Threaded
Open this post in threaded view
|

Re: [Scilab-users] discrete cosine transform

Hello.
I have no problem with your example. I use Scilab-5.4.1 on Linux 64-bit.

Stanislav
grivet grivet
Reply | Threaded
Open this post in threaded view
|

Re: discrete cosine transform

Le 09/08/2013 16:02, Stanislav a écrit :
> Hello.
> I have no problem with your example. I use Scilab-5.4.1 on Linux 64-bit.
>
> Stanislav
>
Sorry,
I should have mentionned that I use Scilab 5.4.1 under winXP
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: discrete cosine transform

Le 09/08/2013 16:56, grivet a écrit :
> Le 09/08/2013 16:02, Stanislav a écrit :
>> Hello.
>> I have no problem with your example. I use Scilab-5.4.1 on Linux 64-bit.
>>
>> Stanislav
>>
> Sorry,
> I should have mentionned that I use Scilab 5.4.1 under winXP
Hello,
You may have a look at http://bugzilla.scilab.org/show_bug.cgi?id=12303
where a work-around is provided
Regards
Samuel
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
grivet grivet
Reply | Threaded
Open this post in threaded view
|

Re: discrete cosine transform

Le 09/08/2013 22:23, Samuel Gougeon a écrit
       Hello,
> You may have a look at http://bugzilla.scilab.org/show_bug.cgi?id=12303
> where a work-around is provided
Thank you Smauel for providing this pointer. I have three additional
remarks:
1. It seems that the problem has been partly solved since the original
bug report. In my case (dft on the rows and dct on the columns of a 2D
matrix),
the bug only appears when the matrix is square.
2. The Scilab function provided as a workaround emulates the "dct2"
option; unfortunately, I need the"dct1" case. However, "dct2" is almost
identical to
"dct1" if I shift the time points by half an interval.
3. There is a :misprint in the Scilab help for dct: the result X(k) is
not a function of X(i) and X(n) but of a(1) and a(n), the input data.

Thank you for your help
JP Grivet

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users