Python Forum
What am I doing wrong with this FFT?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What am I doing wrong with this FFT?
#3
(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
Reply


Messages In This Thread
What am I doing wrong with this FFT? - by pyhill00 - Jul-27-2022, 09:50 PM
RE: What am I doing wrong with this FFT? - by pyhill00 - Jul-28-2022, 09:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Am I wrong or is Udemy wrong? String Slicing! Mavoz 3 3,027 Nov-05-2022, 11:33 AM
Last Post: Mavoz
  python gives wrong string length and wrong character thienson30 2 3,170 Oct-15-2019, 08:54 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020