cnCreneau[n_]:=-I/(n*Pi)*(1-(-1)^n);

plotSpectre[cn_, nmax_] := Module[{spectre},
    	spectre = Table[Line[{{n, -80}, {n,20*Log[10,Abs[cn[n]]+10^(-4)]}}], {n, 1, nmax}];
    	Return[Graphics[{RGBColor[1, 0, 0],spectre},Frame->True,AspectRatio->0.7,
        PlotRange -> {{0, nmax},{-80,0}}, FrameLabel -> {"n", "20*log(|cn|)"}]];
    ]
            
Show[plotSpectre[cnCreneau,50]]
serie[cn_,nmax_,t_]:=Sum[2*Re[cn[n]*Exp[I*2*Pi*n*t]],{n,1,nmax}];
Plot[serie[cnCreneau,20,t],{t,0,1},AxesLabel->{"t","u"}]
Plot[serie[cnCreneau,100,t],{t,0,1},AxesLabel->{"t","u"}]
h[f_]:=1/(1+I*f/10);
cnSortie[n_]:=cnCreneau[n]*h[n]; 
            
Show[plotSpectre[cnSortie,50]]
Plot[serie[cnSortie,100,t],{t,0,1},AxesLabel->{"t","u"}]
h[f_]:=1/(1+I*f/0.1);
cnSortie[n_]:=cnCreneau[n]*h[n];
            
Plot[serie[cnSortie,100,t],{t,0,1},AxesLabel->{"t","u"}]
