How to save Fourier series approximated signal to a WAV file
OK, after digging the case by myself I managed to generate square wave files for both cases. Updated the source code found in my opening post.
In case of combined Fourier Series and Fejér taper approximations of square wave signal, result looks like this (plot done with Audacity):

and spectrum like this (Plot done with Octave):

(green = w_sqr, black dotted = Ffej, fc=1230Hz, fs=44100Hz, w_sqr and Ffej are data holders from source code)