# Re: [Scilab-users] fourier series and fft

`Thanks Tim for this answer; well I notice I need to "dig" deeper on that topic`
```
Paul

----- Mail original -----
De: "Tim Wescott" <t...@wescottdesign.com>
À: "Users mailing list for Scilab" <users@lists.scilab.org>
Envoyé: Jeudi 22 Septembre 2016 23:17:27
Objet: Re: [Scilab-users] fourier series and fft

Hey Paul:

If you mean the Fourier series of a continuous-time periodic signal (or
a continuous-time function of finite scope), then no, Scilab doesn't do
that, because the FFT is different from the Fourier Series.  If you have
a signal that's symbolically defined as f(t) over some span of time,
then Maxima may help you get a symbolic definition of the Fourier
Series.

The FFT is essentially the Fourier series of a sampled-time periodic (or
finite-scope) signal, so if that sampled-time signal is a sufficiently
a_k and b_k are defined to match the way that Scilab does the FFT, then
the real part of the FFT are the a coefficients, and the imaginary part
are the b coefficients.

If you gather up half a dozen books that include signal processing,
especially if some are from applications areas a bit removed from
"normal" signal processing, you'll find that everyone specifies their
Fourier stuff differently.  So what comes out of Scilab's FFT may not
match _your_ definitions of a0, etc., but they match _someone's_.

On Thu, 2016-09-22 at 23:09 +0200, paul.carr...@free.fr wrote:
> dear all
>
> I'm novice in Fourier series and other and my question is probably
> naive (sorry for this) => I'm wondering if scilab can directly
> calculate the Fourier coefficient a0, a_k and b_k ?
>
>
> I'm currently doing it "by hand" is order to familiarise myself with
> it (and I'm looking at the same time to documents on  FFT use and
> rules to refind the 2 natural frequencies of the example here bellow),
> but it seems I'll need to code the coefficient calculations ... Am I
> right ?
>
>
>
> Thanks
>
>
> Paul
>
>
> #########################################################################
> mode(0)
>
> function y=f(x)
>     y=2.*sin(2 * %pi * x) - 3.*cos(%pi * x);
> endfunction
>
> periode = 2;
> number_of_periodes = 1;
> n = periode * number_of_periodes;
>
> x = [0 : %pi/100 : n]';
> y = f(x);
> N = size(x,"*");
>
> scf()
> plot2d(x,y);
>
> a = fft(y,-1);
> _______________________________________________
> users mailing list
> users@lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

--

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432

_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users
```