phase and amplitude of sine wave

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 Sep 22, 2008 at 23:47

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…

2 Replies

Please log in or register to post a reply.

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 168 Sep 22, 2008 at 23:55

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.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 104 Sep 23, 2008 at 00:22

oh shit… i shouldve thought more…