[Scilab-users] Code problem fft-ifft

Lester Anderson arctica1963 at gmail.com
Mon Aug 26 11:03:38 CEST 2013


Hi Antoine,

The prn files are just plain text files, no idea why they were given prn as
an extension, that's how they came with the Mathcad code. They can be
loaded into Notepad with no problem)

The complex issue is coming from the forward and inverse fft as you say. I
am kind of suspicious if it is actually loading the data files properly?

c = fft(obs_topo1); =  COMPLEX
k = 0:1:npts-1;
phik = (D*(k*XKint)^4/(g*(rho_m-rho_c))+1)^-1;Zflexure =
(2*%pi*G*1e5)*(rho_c-rho_w).*exp(-k*XKint*mean_depth).*(1-phik.*exp(-XKint*ocean_thick));
factork = Zflexure * c; = COMPLEX (single value eg
-4.490857598202565E-10-8.427771813321494E-11*%i)
calc_grv = ifft(factork) = COMPLEX - this should be a real set of values.


Cheers
Lester




On 26 August 2013 09:24, Antoine Monmayrant <antoine.monmayrant at laas.fr>wrote:

>  On 25/08/2013 12:45, Lester Anderson wrote:
>
> Hi all,
>
> I am attempting to code up a Mathcad file into Scilab and it should be
> straightforward, but for some reason it is not working as it should. And
> checking the variable values, some are still complex as output from the
> fft/ifft runs - the inputs look right as far as I can see.
>
>  I cannot open the prn files and it's thus difficult for me to check your
> data.
> What do you mean by still complex?
> When you run fft or ifft on a real dataset, the output is complex, that's
> to be expected.
> Maybe (it's just a wild guess) you ended up with complex values that have
> an imaginary part that is zero.
> Scilab still consider these values to be complex.
>
> Antoine
>
>
> If someone can see what the issue is and a solution, that would be great.
>
> Attached my quick attempt at converting the Mathcad code (see PDF) and the
> input profile data (*.prn files)
>
> Cheers
>
> Lester
>
>
>
> _______________________________________________
> users mailing listusers at lists.scilab.orghttp://lists.scilab.org/mailman/listinfo/users
>
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20130826/74663e69/attachment.htm>


More information about the users mailing list