Hacker News new | past | comments | ask | show | jobs | submit login

Yup, that's how I usually picture it, change the values to a collection of sin and cos functions.

When I started explaining it to some computer science students, it helped by giving a particular example of its usefulness:

Sound is composed of waves so, when you want to send a music to a friend it's all a bunch of values like [0, 1, 2, 1, 0, -1 , -2, -1, 0, ...]. If you know they're going to look like waves (sinusoidal functions) why not just send your friend how much they look like sin or cos? The values back there were just a 2sin(x) so why not just send them the value [2]?

You could save a lot of bandwidth. You just need to "correlate" sounds with a bunch of sin or cos functions everybody agrees on :)

Bonus: you can add the phase values, 2 sin(x + phase), to get the beats just right.




> Bonus: you can add the phase values, 2 sin(x + phase), to get the beats just right.

Fortunately, you don't need to do so; if the complex number z = A + iB has magnitude r and argument theta, then Acos(t) + Bsin(t) is the same as r*cos(t - theta). That is, combining cosines and sines of the same frequency already accounts for the phase shift.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: