f=@(x) (cos(x)+abs(cos(x)))/2
a=zeros(1,2*N+1);
a(1)=1/pi;a(2)=1/2;
for k=1:N, a(2*k+1)=(2/pi)*(-1)^(k+1)/(4*k^2-1);end
y=part_sum_c(a,0,t);
plot(t,f(t),t,y,'r')