Propeller Demo: Frequency Phase Detector
Beau Schwabe
Posts: 6,568
Here is something that I am using for a differential sensor idea that I thought might be helpful to others.
Honestly by itself the demo isn't very exciting, but it provides a nice building block for other applications
to exploit.
A couple of examples that a Frequency Phase Detector could be used for...
1) Communication using constellation techniques (Receiver end)
2) Quadrature Encoder (direction and speed)
3) High Speed Event timing from point A to point B
4) Theremin? (try connecting a 3 inch piece of wire across the input pins and just wave your hand near the wire 'loop' - interesting results)
5) Myo-Electric sensor possibilities
Basically the DEMO is capable of taking two input signals of the SAME frequency with different phase
relationships to one another... the returned result is equal to 1/2 of the input frequency Period and can
be computed as...
HalfPeriod = System_Clock_Speed / ( Input_Frequency x 2 )
Since the input frequencies are the same, the furthest phase difference between the two inputs can only
be +/-180 Deg apart so the resulting range is +/- HalfPeriod
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 7/8/2007 1:56:51 PM GMT
Honestly by itself the demo isn't very exciting, but it provides a nice building block for other applications
to exploit.
A couple of examples that a Frequency Phase Detector could be used for...
1) Communication using constellation techniques (Receiver end)
2) Quadrature Encoder (direction and speed)
3) High Speed Event timing from point A to point B
4) Theremin? (try connecting a 3 inch piece of wire across the input pins and just wave your hand near the wire 'loop' - interesting results)
5) Myo-Electric sensor possibilities
Basically the DEMO is capable of taking two input signals of the SAME frequency with different phase
relationships to one another... the returned result is equal to 1/2 of the input frequency Period and can
be computed as...
HalfPeriod = System_Clock_Speed / ( Input_Frequency x 2 )
Since the input frequencies are the same, the furthest phase difference between the two inputs can only
be +/-180 Deg apart so the resulting range is +/- HalfPeriod
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 7/8/2007 1:56:51 PM GMT
Comments
Another cool audio application would be to make a 5 channel audio delay box, 4 mics positioned where your ears would be, and using this code to provide measurement data to a parent object that would calculate left/right front/back phase differences and adjust the delay box accordingly. You could even add some more code that would adjust each channels volume, so that when it hits your ears one channel won't wash out the others.
I would definitely be interested in how one would go about making an audio delay with the prop, that would probably be the most difficult part.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
E3 = Thought
http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! The average PC while browsing the internet typically uses less than 30% of it's potential, why not donate a portion of the rest for cancer resaerch?
RinksCustoms,
You already can... I played around with Chip's microphone to headphone object and did something just like that.· I think I was able to get almost 1/4 a second delay.
·
Edit....
What you will experience with any audio, is that the Phase delay idea that you propose will only work for ONE frequency and any multiple harmonic of that frequency.· Different frequencies will have different Phase delays and while you can "tune" a specific resonate frequency (<--essentially what you are doing), it will not encompass the audio range that you are looking for.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Post Edited (Beau Schwabe (Parallax)) : 7/9/2007 2:16:29 AM GMT
Your description of this phase detector object made me think of that. By outputting a test tone of a fixed freq on any two channels - assuming they're in phase - would hit your ear ( or mics) at slightly different times allowing you to measure the sonic differential distance between the two speakers. I'm not exactly sure how pioneer managed a digital audio delay on 5 channels in a car stereo at what sounds like at least 48KHz sampling, that's gotta be alot of memory, grant it that the delays needed for a car would likely be much shorter than those needed for a home studio/theatre setup.
But perhaps this code would be useful as a tool for tunning my studio surround. I'm sure it could be done with a few mics and a·VGA screen or something for a readout.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
E3 = Thought
http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! The average PC while browsing the internet typically uses less than 30% of it's potential, why not donate a portion of the rest for cancer resaerch?