Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ok. I'll check it and I got for $a_0 = 1/4$ and $a_n = \frac{1-cos(\pi n)}{2\pi ^2 n^2}$. Is this better? By the way, I computed this with the separate formulas for $a_0$, $a_n$. But when I used the general formula $c_n$ I got the previous result, why am I not getting the $1/4$ when using the latter?
Thank you very much, that helped a lot. So, the values of $n$ have to be always integers right? As for the coefficients' formula, I checked it twice and I don't see any error but I do see that $\hat f_0$ becomes undefined... I checked also the fourier transform of a triangle signal and it is $sinc(w)^2$ which will explain the undefined value at 0, apart from that I can't see other errors.