written cosine version of fourier transform