rouncer at September 22nd, 2008 19:47 — #1
Can someone help me with this problem?
say ive got a sine wave written into a buffer of samples.
i know the frequency, all i need to do is calculate the amplitude of it and the phase from the start of the buffer.
thanks if someone cares...
reedbeta at September 22nd, 2008 19:55 — #2
Try scanning the buffer for the first maximum and the first minimum. That should give you the crest and trough of one cycle of the wave. Then you can find the amplitude as half the difference between those two, and you can calculate the phase by how far into the buffer the first maximum is, compared to the frequency.
rouncer at September 22nd, 2008 20:22 — #3
oh shit... i shouldve thought more...