[Scilab-users] discrete Fourier transform
Mike Page
Mike at Page-One.Waitrose.com
Thu Mar 21 22:34:16 CET 2013
Hi,
I think this is just a question of scaling. There is no "correct" scaling
for the FFT - just some different conventions. This is explained here
(http://www.mathworks.co.uk/matlabcentral/answers/15770-scaling-the-fft-and-
the-ifft).
The "correct" answer with Scilab would be exactly 100 (N/2) in your case,
but you have a small error because your waveform is not exactly periodic -
the first and last sample are the same, but you should have the last sample
being the one before the first sample for a complete cycle.
The following code does that:
-->n=201;
-->x=linspace(0,2*%pi,n);
-->x=x(1:200);
-->y=sin(x);
-->Xf=dft(y,-1);
-->XfA = abs(Xf);
-->XfA(2)
ans =
100.
HTH,
Mike.
-----Original Message-----
From: users-bounces at lists.scilab.org
[mailto:users-bounces at lists.scilab.org]On Behalf Of haasejos
Sent: 21 March 2013 21:14
To: users at lists.scilab.org
Subject: Re: [Scilab-users] discrete Fourier transform
-->n = 200;
-->x=linspace(0,2*%pi,n);
-->y=sin(x);
-->Xf=dft(y,-1);
-->XfA = abs(Xf); *please look at the difference! *
-->XfA(2)
ans =
99.745189
--
View this message in context:
http://mailinglists.scilab.org/discrete-Fourier-transform-tp4026318p4026326.
html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at
Nabble.com.
_______________________________________________
users mailing list
users at lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2013.0.3267 / Virus Database: 3160/6194 - Release Date: 03/21/13
More information about the users
mailing list