[LAD] Determining Phase
Gabriel M. Beddingfield
gabrbedd at gmail.com
Sat Jun 25 18:55:05 UTC 2011
On Saturday, June 25, 2011 09:23:29 am
pshirkey at boosthardware.com wrote:
> Hi,
>
> Can anyone point me to a simple code example for how to
> determine the phase at a specific time in a waveform?
>
> ex. if I have a sample that is 5 seconds long and want to
> know the phase at 2.5 seconds
>
> I'm open to code in any language or a scripted example if
> such a tool exists. If there is an ui which has that
> feature I am also interested.
Do you mean... for a very simple sine wave?
Assuming yes:
p = asin( x / A )
Where:
A is the amplitude of the sine wave
x is the value of the sample (-A <= x <= A)
p is the phase of the wave in radians (-pi/2 <= p <= pi/2)
If not this... then... "what Jörn said!" :-)
-gabriel
More information about the Linux-audio-dev
mailing list