clear[n];
clear[a];
Clear["Global`*"]
tau=200×(10^(-6));
T=2*tau;
omega0=2*Pi/T;
Nterm=100
a0=tau/T;
a[n_]:=(2/Pi)*(1/n)*Sin[n*omega0*tau/2];
s[t_]:=a0+Sum[a[k]*Cos[k*omega0*t],{k,1,Nterm}];
Plot[{a0,a[1]Cos[omega0*t],a[3]*Cos[3*omega0*t],a[5]Cos[5*omega0*t],a[7]Cos[7*omega0*t],a[9]Cos[9*omega0*t],a[11]Cos[11*omega0*t],
a[13]Cos[13*omega0*t],a[15]Cos[15*omega0*t]},{t,-T,T},PlotRange->{-1.5,1.5}]

Plot[s[t],{t,-T,T},PlotRange->{-0.5,1.5}]

res=310;
Lind=0.01;
cap=4.7×(10^(-9));
cap2=47×(10^(-9));

HC[k_]:=1/(I*k*omega0*cap*res-(((k*omega0))^2)*Lind*cap+1);
Sout[t_]:=a0*Abs[HC[0]]+Sum[Abs[HC[k]]*a[k]*Cos[k*2*Pi*t/T+Arg[HC[k]]],{k,1,Nterm}];
LogLinearPlot[Abs[HC[k]],{k,0.1,150},PlotRange->{0,5.5}]
Plot[{Abs[HC[0]]*a0,Abs[HC[1]]*a[1]Cos[omega0*t+Arg[HC[1]]],Abs[HC[3]]a[3]*Cos[3*omega0*t+Arg[HC[3]]],Abs[HC[5]]*a[5]Cos[5*omega0*t+Arg[HC[5]]],Abs[HC[7]]*a[7]Cos[7*omega0*t+Arg[HC[7]]],Abs[HC[9]]*a[9]Cos[9*omega0*t+Arg[HC[9]]],Abs[HC[11]]*a[11]Cos[11*omega0*t+Arg[HC[11]]],Abs[HC[13]]*a[13]Cos[13*omega0*t+Arg[HC[13]]],Abs[HC[15]]*a[15]Cos[15*omega0*t+Arg[HC[15]]]},{t,-T,T},PlotRange->{-1.,1.5}]
Plot[Sout[t],{t,-T,T},PlotRange->{-1,3.}]

HR[k_]:=I*k*omega0*cap*res/(I*k*omega0*cap*res-(((k*omega0))^2)*Lind*cap+1);
LogLinearPlot[Abs[HR[k]],{k,0.1,150},PlotRange->{0,1}]
Plot[{Abs[HR[0]]*a0,Abs[HR[1]]*a[1]Cos[omega0*t+Arg[HR[1]]],Abs[HR[3]]*a[3]Cos[3*omega0*t+Arg[HR[3]]],Abs[HR[5]]*a[5]Cos[5*omega0*t+Arg[HR[5]]],Abs[HR[7]]*a[7]Cos[7*omega0*t+Arg[HR[7]]],Abs[HR[9]]*a[9]Cos[9*omega0*t+Arg[HR[9]]],Abs[HR[11]]*a[11]Cos[11*omega0*t+Arg[HR[11]]],Abs[HR[13]]*a[13]Cos[13*omega0*t+Arg[HR[13]]],Abs[HR[15]]*a[15]Cos[15*omega0*t+Arg[HR[15]]]},{t,-T,T},PlotRange->{-.5,.5}]
Sout[t_]:=a0*Abs[HR[0]]+Sum[Abs[HR[k]]*a[k]*Cos[k*2*Pi*t/T+Arg[HR[k]]],{k,1,Nterm}];
Plot[Sout[t],{t,-T,T},PlotRange->{-.5,.5}]

HL[k_]:=-(((k*omega0))^2)*cap*Lind/(I*k*omega0*cap*res-(((k*omega0))^2)*Lind*cap+1);
LogLinearPlot[Abs[HL[k]],{k,0.1,150},PlotRange->{0,5.5}]
Plot[{Abs[HL[0]]*a0,Abs[HL[1]]*a[1]Cos[omega0*t+Arg[HL[1]]],Abs[HL[3]]a[3]*Cos[3*omega0*t+Arg[HL[3]]],Abs[HL[5]]*a[5]Cos[5*omega0*t+Arg[HL[5]]],Abs[HL[7]]*a[7]Cos[7*omega0*t+Arg[HL[7]]],Abs[HL[9]]*a[9]Cos[9*omega0*t+Arg[HL[9]]],Abs[HL[11]]*a[11]Cos[11*omega0*t+Arg[HL[11]]],Abs[HL[13]]*a[13]Cos[13*omega0*t+Arg[HL[13]]],Abs[HL[15]]*a[15]Cos[15*omega0*t+Arg[HL[15]]]},{t,-T,T},PlotRange->{-1,1}]
Sout[t_]:=a0*Abs[HL[0]]+Sum[Abs[HL[k]]*a[k]*Cos[k*2*Pi*t/T+Arg[HL[k]]],{k,1,Nterm}];
Plot[Sout[t],{t,-T,T},PlotRange->{-1.,1.}]

HRC[k_]:=1/(1+I(k*omega0*cap2*res));
LogLinearPlot[Abs[HRC[k]],{k,0.1,150},PlotRange->{0,1}]
Sout[t_]:=a0*Abs[HRC[0]]+Sum[Abs[HRC[k]]*a[k]*Cos[k*2*Pi*t/T+Arg[HRC[k]]],{k,1,Nterm}];
Plot[{Abs[HRC[0]]*a0,Abs[HRC[1]]*a[1]Cos[omega0*t+Arg[HRC[1]]],Abs[HRC[3]]a[3]*Cos[3*omega0*t+Arg[HRC[3]]],Abs[HRC[5]]*a[5]Cos[5*omega0*t+Arg[HRC[5]]],Abs[HRC[7]]*a[7]Cos[7*omega0*t+Arg[HRC[7]]],Abs[HRC[9]]*a[9]Cos[9*omega0*t+Arg[HRC[9]]],Abs[HRC[11]]*a[11]Cos[11*omega0*t+Arg[HRC[11]]],Abs[HRC[13]]*a[13]Cos[13*omega0*t+Arg[HRC[13]]],Abs[HRC[15]]*a[15]Cos[15*omega0*t+Arg[HRC[15]]]},{t,-T,T},PlotRange->{-1,1}]
Plot[Sout[t],{t,-T,T},PlotRange->{0,1.5}]

HCR[k_]:=I(k*omega0*cap2*res)/(1+I(k*omega0*cap2*res));LogLinearPlot[Abs[HCR[k]],{k,0.1,150},PlotRange->{0,1}]
Sout[t_]:=a0*Abs[HCR[0]]+Sum[Abs[HCR[k]]*a[k]*Cos[k*2*Pi*t/T+Arg[HCR[k]]],{k,1,Nterm}];
Plot[{Abs[HCR[0]]*a0,Abs[HCR[1]]*a[1]Cos[omega0*t+Arg[HCR[1]]],Abs[HCR[3]]a[3]*Cos[3*omega0*t+Arg[HCR[3]]],Abs[HCR[5]]*a[5]Cos[5*omega0*t+Arg[HCR[5]]],Abs[HCR[7]]*a[7]Cos[7*omega0*t+Arg[HCR[7]]],Abs[HCR[9]]*a[9]Cos[9*omega0*t+Arg[HCR[9]]],Abs[HCR[11]]*a[11]Cos[11*omega0*t+Arg[HCR[11]]],Abs[HCR[13]]*a[13]Cos[13*omega0*t+Arg[HCR[13]]],Abs[HCR[15]]*a[15]Cos[15*omega0*t+Arg[HCR[15]]]},{t,-T,T},PlotRange->{-.5,.5}]
Plot[Sout[t],{t,-T,T},PlotRange->{-1.,1.}]