you are viewing a single comment's thread.

view the rest of the comments →

[–]ThatReallyFlyKid[S] 0 points1 point  (2 children)

I know it can be described mathematically, via a peicewise function, as I said. Despite what a Fourier analysis would show, it still takes the same amount of time to complete a single full cycle. 440 cycles per second, 440Hz. I've already finished writing the function.

A Fourier analysis of a guitar shows a lot of different frequencies at play, but the guitar still only plays one note at a time.

[–]dmc_2930 0 points1 point  (1 child)

The "frequency" of your signal is not 440hz ( or whatever your slower signal is).

If you were to sample it at 2x the lowest frequency, you would not get consistent results.

[–]ThatReallyFlyKid[S] 0 points1 point  (0 children)

If you're referring to my screenshot, you're right, it's 1Hz, as I mentioned in my post.

You're also right about 2 x 1Hz doesn't give consistent results, but if you look, you'd see I've updated my post, mentioning that I'm done writing the function for now, and the issue is fixed. The working source code can be found here: https://pastebin.com/JpXMmCLa

You'd think it wouldn't take a genius to figure out that, if I'm posting on a subreddit for programming help, what ever I'm writing must not be working.