[LAD] Determining Phase

2011-06-25 Thread pshirkey
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.


Cheers

--
Patrick Shirkey
Boost Hardware Ltd
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Tascam US-1641?

2011-06-25 Thread Emanuel Rumpf
2011/6/22 Jeremy Jongepier autosta...@gmail.com:

 The US-1641 still appears to be unsupported.
 http://www.google.com/search?q=tascam+1641+site:mailman.alsa-project.org


Also it appears superseded by Tascam US-1800
http://tascam.com/product/us-1800/
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Jörn Nettingsmeier

On 06/25/2011 04:23 PM, pshir...@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


talking about the phase at some particular point in time doesn't make 
sense. first you would have to do an fft (whose resolution is bound by 
the window size), and then you'd have to look at each frequency bin 
separately, because they will all be at different relative phase.


when you talk directly into my ear, the voice/ear system will be roughly 
zero phase. when i move away even a few inches, there will be a linear 
phase distortion due to the fact that i'm now one wavelength away at 
some mid frequency, but several wavelengths at high frequencies.


so phase is not really a meaningful thing unless you are talking about 
recombination of strongly correlated signals.


another example: if your sample consists of a sine at 100hz and one at 
200hz, after 10ms the first component will be at 0° while the second is 
at 180°, iff both started at 0° in the first place. but why would anyone 
care? with real-life sounds, this whole exercise becomes meaningless.


what are you trying to accomplish?

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Gabriel M. Beddingfield
On Saturday, June 25, 2011 09:23:29 am 
pshir...@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
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Fons Adriaensen
On Sat, Jun 25, 2011 at 04:23:29PM +0200, pshir...@boosthardware.com wrote:

 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.

phase can mean a lot of things, and there is no such
thing as the phase of a waveform. Maybe you could 
explain what you want to do.

Ciao,

-- 
FA

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Fons Adriaensen
On Sat, Jun 25, 2011 at 01:55:05PM -0500, Gabriel M. Beddingfield wrote:
 
 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)

And what if the phase is  -pi/2 or  +pi/2 ?

-- 
FA

___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Gabriel M. Beddingfield
On Saturday, June 25, 2011 02:49:39 pm Fons Adriaensen 
wrote:
p is the phase of the wave in radians (-pi/2 = p =
pi/2)
 
 And what if the phase is  -pi/2 or  +pi/2 ?

then you set phasers to stun. :-p

Hey, at least I pointed out the limitation

-gabriel
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Emanuel Rumpf
2011/6/25 Fons Adriaensen f...@linuxaudio.org:
 On Sat, Jun 25, 2011 at 01:55:05PM -0500, Gabriel M. Beddingfield wrote:

 Do you mean... for a very simple sine wave?

 Assuming yes:

   p = asin( x / A )

 Where:

   A is the amplitude of the sine wave

you mean the maximal amplitude (-MAX = x = +MAX) , I guess ?

   x is the value of the sample (-A = x = A)
   p is the phase of the wave in radians (-pi/2 = p = pi/2)

 And what if the phase is  -pi/2 or  +pi/2 ?

since x = A (always), that result is not possible

-- 
E.R.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Jörn Nettingsmeier

On 06/26/2011 12:04 AM, Emanuel Rumpf wrote:

2011/6/25 Fons Adriaensenf...@linuxaudio.org:

On Sat, Jun 25, 2011 at 01:55:05PM -0500, Gabriel M. Beddingfield wrote:


Do you mean... for a very simple sine wave?

Assuming yes:

   p = asin( x / A )

Where:

   A is the amplitude of the sine wave


you mean the maximal amplitude (-MAX= x= +MAX) , I guess ?


   x is the value of the sample (-A= x= A)
   p is the phase of the wave in radians (-pi/2= p= pi/2)


And what if the phase is  -pi/2 or  +pi/2 ?


since x= A (always), that result is not possible



?!

it seems you have just proven that the maximum duration of any pure tone 
is 1/f. that is quite extraordinary. might it even be the explanation of 
the almost mythical 1/f noise? all those tones suddenly realizing they 
have to stop or violate rumpf's lemma :-D


sorry, couldn't resist...

but seriously, it does make a lot of sense to talk about arbitrarily 
large phase angles. take a look at a real-life speaker system: it's not 
uncommon for the HF to lag behind the subs several complete cycles after 
passing through the crossover.


even a perfectly phase-linear theoretical speaker exhibits them:
in fact, if you stand 3.4m away from a speaker, the phase angle of a 
100hz tone at your ear will be 360° relative to the membrane, while a 
200hz tone will be at 720°, and so on.
that's where delay becomes group delay, i.e. the same constant time 
delay implies different phase angles depending on frequency, pretty much 
arbitrarily large as the frequency rises.








___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Emanuel Rumpf
2011/6/26 Emanuel Rumpf xb...@web.de:

 since x = A (always),

better:
abs( x ) = abs( A )

 that result is not possible,

with that function at least
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Folderol
On Sun, 26 Jun 2011 00:22:58 +0200
Jörn Nettingsmeier netti...@folkwang-hochschule.de wrote:
 that's where delay becomes group delay, i.e. the same constant time 
 delay implies different phase angles depending on frequency, pretty much 
 arbitrarily large as the frequency rises.

Bingo!

Which is why it is quite insane for people to worry about phase shift in
amplifiers. As long as all channels are the same so there is no phase
*difference* it's quite irrelevant.

-- 
Will J Godfrey
http://www.musically.me.uk
Say you have a poem and I have a tune.
Exchange them and we can both have a poem, a tune, and a song.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Rui Nuno Capela

On Sat, 25 Jun 2011 16:23:29 +0200 (CEST), pshir...@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.



in general, theory i mean, phase equals delay; it can be computed 
deterministically iif the signal is a pure tone (sinusoidal) otherwise 
you must have a reference signal and referring to its fundamental 
frequency (1st order harmonic) or, when in-the-field, you can pick one 
conventional signal tone (i've been told that a 1khz is a usual choice:) 
and compare to that.


if you are to compare two known signals (often input vs. output of some 
lti transformation, eg. filter), than the computation to do is 
correlation. well, you should use fft for that, but i'm sure you know that:)


cheers
--
rncbc aka Rui Nuno Capela
rn...@rncbc.org
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Emanuel Rumpf
2011/6/26 Gabriel M. Beddingfield gabrb...@gmail.com:

 *headdesk*.  Yes... should have been the half-amplitude of
 the signal...   p = asin( 2*x / A )
 I.e. MAX = A/2 and MIN = -A/2


?

Try with

φ = ∆t * f * 2π(rad)
--

φ = 1s * 1Hz * 2π  = 2π (rad)

φ = 0.5s * 1Hz * 2π  = 1π (rad)

φ = 0.25s * 1Hz * 2π  = 0.5π (rad) = 90 (deg)

φ = 0.125s * 1Hz * 2π  = 1/4π (rad) = 45 (deg)


-- 
E.R.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


[LAD] Yoshimi Midi Learn: 1st testing release

2011-06-25 Thread louis cherel

Hello everyone,

Every one knows Yoshimi, the fork of ZynAddSubFx.
One thing was lacking to yoshimi to be perfect: to be nearly fully
controlled by midi controls ( no OSC, sorry ).
ZynAddSubFx had possibilities to control a few parameters with
complicated NRPN, Yoshimi recently had ( in the test versions ) some
features too.
But now I'm proud to announce you the work of licnep ( not me, I'm just
a bug reporter ) who made the midiLearn function for yoshimi. It's not
stable for now because it's recent, and not full, but here are the
present features:

* Control System effects, Part Insert Effects
* Master/Part Volume, Pan, System Effect Sends
* Most of ADsynth parameters
* Add/Remove controller
* detect the channel and the number
* reset the knob ( its position )
I think it's a feature that's very useful and could help many
yoshimi/zyn users.

To use it, that's simple: connect your controller to yoshimi,
right-click on a blue knob ( yellow are ones which are not supported for
now ) and click midi Learn move your controller, it detects
automatically the controller.
To see and modify controllers, go to the Yoshimi MIDI controllers menu.
To erase midi control of a knob, simply right click on it and click on
remove midi control

Here is the gitHub repository: https://github.com/licnep/yoshimi

To download and install it, follow the explications link ( gitHub ):
https://github.com/licnep/yoshimi/wiki/How-to

A light page to understand how to control others not implemented
controllers:
https://github.com/licnep/yoshimi/wiki/Source-code

Pages to follow the news of the project:
Facebook: https://www.facebook.com/pages/Yoshimi-midi-learn/224823617534934
Twitter: http://twitter.com/#!/YoshimiMIDI

So if you're interrested, all bug requests are deeply recommended.

Cheers,
Louis CHEREL.
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Fons Adriaensen
On Sun, Jun 26, 2011 at 12:22:58AM +0200, Jörn Nettingsmeier wrote:

 it seems you have just proven that the maximum duration of any pure tone  
 is 1/f. that is quite extraordinary.

0.5 / f actually, which is extraextraordinary.

Both Joern and I have invited the original poster to
explain more clearly what he wants to achieve. Because
as it stands his question doesn't make sense and can't
be answered. 

If the purpose of this list is to let people help each
other with audio software related problems, then the
other replies so far are, to put it gently, 'unfortunate'. 

To put some things right:

- Absolute phase response *does* matter. It's quite
easy to create e.g. a filter that has a perfectly flat
amplitude response, modifies only the phase, and sounds
as a e.g. a resonance or even a reverb. You won't hear
the relatively harmless phase response of a tyipcal amp,
but that doesn't mean you can't hear phase errors in
general.

- Phase is related to delay but it is not the same thing. 
Group delay is again something different. Mixing up all
these is not going to help anyone understand things any
better.


Ciao,

-- 
FA


___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


Re: [LAD] Determining Phase

2011-06-25 Thread Duncan Gray
From the long list of answers, I see lots of speculation about Mr. 
Shirkey's question. Some time back he approached me on the work that had 
been done a very long time ago on phase-modulation to achieve panning. 
He never replied to my subsequent information or queries. I suspect that 
this question is really all about the phase of the signal being 
transported through any given audio driver, ALSA, JACK or whatever, so 
the analysis is somewhat germane.


I think that a phase demod analyzer might be his attempt to solve his 
real problem. I speculate that Patrick didn't actually ask his real 
question.


So, perhaps any Haas-effect plugin would satisfy Patrick's needs.

Other than that, I'd make a really cool spectrum analyzer that ran the 
Fourier analysis on two channels, correlated their phases then made a 
+/- line vs. frequency for all to see so that the phase of the 
components of the spectrum could be watched for phase relationships.


Suggestions?

On 06/25/2011 09:23 AM, pshir...@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.


Cheers

--
Patrick Shirkey
Boost Hardware Ltd
___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev


___
Linux-audio-dev mailing list
Linux-audio-dev@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-dev