(Jul-28-2022, 07:56 AM)Gribouillis Wrote:(Jul-27-2022, 09:50 PM)pyhill00 Wrote: I would have figured, that the FFT would be just 4 spikes but not something like this.It seems to me the FFT of a cosine is a spike only if the cosine has the form cos(2 pi k / N) where N is the number of samples and k is an integer. For other cosines, there must be some diffusion in the discrete Fourier transform and the curve is smoother than a spike. So your results don't seem so bad to me. Try to study the FFT of a single cosine when the frequency varies.
Ok thats a really good point and I agree. Do you know by chance why the FFT amplitudes are the not the same for the four? Even when I do more cosines I get an oscillating pattern of the amplitudes: https://imgur.com/a/grjt4fS