transformée de fourier en sinus d'une fonction paire:
1

g[y_] := 1

Nmax = 18;
yym = 
        1;

a = 
      Table[ Pi/2 NIntegrate[
            g[y]    Cos[ Pi/2 (2  k - 1)  y/yym], {y, 0, 
              yym}] , {k, 1, Nmax}]

Table[
      N[(-1)^(i - 1)/(2 i - 1)] , {i, 1, Nmax}]

f =   Sum[ 
        N[ 4/Pi   a [[k]]  ] 
          Cos[N[Pi/2 (2  k - 1)   y/yym]], {k, 1, Nmax}]

Plot[{f  , g[y]}, {y, -yym, 4 yym}, 
      PlotRange -> {{-yym,  2 yym}, {-1, 1.3}}]

transformée de fourier en sinus d'une fonction paire:
rampe

g[y_] := y - Floor[y]

Nmax = 18;
yym = 
        1;

a = 
      Table[ Pi/2 NIntegrate[
            g[y]    Cos[ Pi/2 (2  k - 1)  y/yym], {y, 0, 
              yym}] , {k, 1, Nmax}]

f =   Sum[ 
        N[ 4/Pi   a [[k]]  ] 
          Cos[N[Pi/2 (2  k - 1)   y/yym]], {k, 1, Nmax}]

Plot[{f  , g[y]}, {y, -yym, 2 yym}, 
      PlotRange -> {{-yym,  2 yym}, {-1, 1.3}}]

transformée de fourier en sinus d'une fonction paire:
exp y y

g[y_] := Exp[-y y]

Nmax = 18;
yym = 
        6;

a = 
      Table[ Pi/2/yym  NIntegrate[
            g[y]    Cos[ Pi/2 (2  k - 1)  y/yym], {y, 0, 
              yym}] , {k, 1, Nmax}]

f =   Sum[ 
        N[ 4/Pi   a [[k]]  ] 
          Cos[N[Pi/2 (2  k - 1)   y/yym]], {k, 1, Nmax}]

Plot[{f  , g[y]}, {y, -yym, 4 yym}, 
      PlotRange -> {{-yym, 2 yym}, {-1, 1.3}}]

transformée de fourier en sinus d'une fonction paire:
1/Ch

g[y_] := 1/Cosh[ y]/Cosh[ y]

Nmax = 18;
yym = 
        6;

a = 
      Table[ Pi/2/yym  NIntegrate[
            g[y]    Cos[ Pi/2 (2  k - 1)  y/yym], {y, 0, 
              yym}] , {k, 1, Nmax}]

f =   Sum[ 
        N[ 4/Pi   a [[k]]  ] 
          Cos[N[Pi/2 (2  k - 1)   y/yym]], {k, 1, Nmax}]

Plot[{f , g[y]}, {y, 0, 4 yym}, 
      PlotRange -> {{0, yym}, {0, 1. }}]

transformée de fourier en sinus d'une fonction paire:
exp y y + animation

g[y_] := Exp[-y y]

Nmax = 18;
yym = 
        6;

a = 
      Table[ Pi/2/yym  NIntegrate[
            g[y]    Cos[ Pi/2 (2  k - 1)  y/yym], {y, 0, 
              yym}] , {k, 1, Nmax}]

Do[
      f =   Sum[ 
          N[ 4/Pi   a [[k]]  ] 
            Cos[N[Pi/2 (2  k - 1)   y/yym]], {k, 1, 
            Ni}]; 
Plot[{f  , g[y]}, {y, -yym, 
          4 yym}, 
        PlotRange -> {{-yym,  yym}, {-1, 
              1.3}}], 
{Ni, 1, 10}]

transformée de fourier en sinus d'une fonction paire:
exp y+ animation

g[y_] := Exp[- Abs[ y]]

Nmax = 18;
yym = 
        6;

a = 
        Table[ Pi/2/yym  NIntegrate[
              g[y]    Cos[ Pi/2 (2  k - 1)  y/yym], {y, 0, 
                yym}] , {k, 1, Nmax}];
ListPlot[a]

Do[
      f =   Sum[ 
          N[ 4/Pi   a [[k]]  ] 
            Cos[N[Pi/2 (2  k - 1)   y/yym]], {k, 1, 
            Ni}]; 
Plot[{f  , g[y], 
 
          a [[Ni]]  Cos[
              N[Pi/2 (2 Ni - 1)   y/yym]]}, {y, -yym, 4 yym}, 
        PlotRange -> {{- 0,  1.25  yym}, {- .2, 
              1. }}, 
PlotStyle -> {RGBColor[0, 0, 1], 
            RGBColor[0, 1, 0], RGBColor[1, 0, 0]}], 
{Ni, 
        1, 15}]

transformée de fourier en sinus d'une fonction paire:
exp y+ animation

g[y_] :=  
      2 ( y  - 0.5  - Floor[y - 0.5]) - 1

Nmax = 18;
yym = 1;
Plot[{ g[y]}, {y, -yym, 4 yym}, 
      PlotRange -> {{-yym,  2  yym}, {-1, 
            1.3}}]


a = 
      Table[ Pi/2/yym  NIntegrate[
            g[y]    Cos[ Pi/2 (2  k - 1)  y/yym], {y, 0, 
              yym}] , {k, 1, Nmax}]

Do[
      f =   Sum[ 
          N[ 4/Pi   a [[k]]  ] 
            Cos[N[Pi/2 (2  k - 1)   y/yym]], {k, 1, 
            Ni}]; 
Plot[{f  , 
          g[y], (a[[Ni]] Cos[N[Pi/2 (2  k - 1)   y/yym]]) //. 
            k -> Ni
}, {y, -yym, 4 yym}, 
        PlotRange -> {{-0,  2  yym}, {-1, 
              1.3}}, 
PlotStyle -> {RGBColor[0, 0, 1], 
            RGBColor[0, 1, 0], RGBColor[1, 0, 0]}], 
{Ni, 
        1, 15}]