<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Le 10/10/2018 à 08:47, Samuel Gougeon a
      écrit :<br>
    </div>
    <blockquote type="cite"
      cite="mid:4f167b65-4986-7bd5-ccc7-68a4e99eed5b@free.fr">Le
      09/10/2018 à 21:52, antoine monmayrant a écrit :
      <br>
      <blockquote type="cite">Hello Samuel,
        <br>
        <br>
        Sorry I might not have made myself clear: fft and fftshift
        provide the ability to perform transform along only one of the
        dimensions of a multidimensional array.
        <br>
        Something like S(x,y,z) --[FFT along 3rd dim]-->
        ffthift(ffft(S(x,y,z), -1,3),3)=Ŝ(x,y,kz).
        <br>
        In that case, you need to perform fft and eventually fftshift
        along only the dimension of the transform.
        <br>
        ifftshift should also provide the same possibility to perform
        the inverse transform: Ŝ(x,y,kz) --[IFFT along 3rd dim]-->
        iffthift(ffft(Ŝ(x,y,kz), +1,3),3)=S(x,y,z).
        <br>
        <br>
        This is a basic signal processing requirement in my field.
        <br>
      </blockquote>
      <br>
      Hello Antoine,
      <br>
      <br>
      Yes, you are right: in case of directional FFT and odd number of
      elements along the chosen direction, ifftshift can't presently be
      used.
      <br>
      Could you please post the same remark on bugzilla? This bug/wish
      is not yet reported.
      <br>
    </blockquote>
    OK, I'll put it in my TODO-list.<br>
    <blockquote type="cite"
      cite="mid:4f167b65-4986-7bd5-ccc7-68a4e99eed5b@free.fr">
      <br>
      IMO we may propose and include it in Scilab as soon as for Scilab
      6.0.2.
      <br>
      <br>
      BTW, still IMO, fftshift and ifftshift should rather be merged in
      a single function.
      <br>
      It's the same code, except a floor<=>ceil. This should
      deserve just an option, not a separate dedicated function.
      <br>
      I guess that this separation likely comes from a kind of abusive
      Matlab-like mimicry.
      <br>
    </blockquote>
    Yes, I agree.<br>
    But I don't see how we can merge the two without increasing the huge
    halo of confusion that blurs the help pages and use of fft-related
    functions¹ ².<br>
    The first idea that came to my mind was to make one single fftshift
    function where:<br>
     - if dim>0, you do direct shift (ie for a direct Fourier
    transform) along dimension dim;<br>
     - if dim<0, you do inverse shift (ie for an inverse Fourier
    transform) along dimension |dim|.<br>
    But as "-1" means direct fft and "+1" inverse fft, mixing fft and
    fftshift would be a real mess.<br>
    <br>
    Antoine<br>
    ¹ One I just discovered yesterday: the help page for fft is not
    listed in "Scilab Help >> Signal Processing > Transforms "
    ! Only ifft is listed, cool, he? Of course, ifft points to "Scilab
    Help >> Signal Processing > Transforms > fft". Idem  for
    dst, ...<br>
    ² Oh, and this one cool too: in the fft help page: <br>
    "incr<br>
    a vector of positive numbers with integer values, or a vector of
    positive integers. <b>See the Description part for details.</b>"
    but the Description never says what the heck "incr" is, does and
    means.... Arghhh. It only appears once in an example of a "previous
    syntax".<br>
    <br>
    <blockquote type="cite"
      cite="mid:4f167b65-4986-7bd5-ccc7-68a4e99eed5b@free.fr">
      <br>
      Best regards
      <br>
      Samuel
      <br>
      <br>
      _______________________________________________
      <br>
      users mailing list
      <br>
      <a class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
      <br>
      <a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>
      <br>
      <br>
    </blockquote>
    <p><br>
    </p>
    <pre class="moz-signature" cols="72">-- 
+++++++++++++++++++++++++++++++++++++++++++++++++++++++

 Antoine Monmayrant LAAS - CNRS
 7 avenue du Colonel Roche
 BP 54200
 31031 TOULOUSE Cedex 4
 FRANCE

 Tel:+33 5 61 33 64 59
 
 email : <a class="moz-txt-link-abbreviated" href="mailto:antoine.monmayrant@laas.fr">antoine.monmayrant@laas.fr</a>
 permanent email : <a class="moz-txt-link-abbreviated" href="mailto:antoine.monmayrant@polytechnique.org">antoine.monmayrant@polytechnique.org</a>

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

</pre>
  </body>
</html>