| Author |
Message |
Anonymous
Joined: Jan 13, 2005 Posts: 29
|
Posted: Jun 21, 2005 2:50 AM Post subject: complex cross correlation |
|
Jarek, What does this design measure?
Thank you in advance, wak |
|
 |
Jarek Foltynski
Joined: Jan 13, 2005 Posts: 62
|
Posted: Jun 30, 2005 7:37 PM Post subject: |
|
BioEra can process stream of vectors, therefore it is possible to calculate correlation not only between 2 scalar streams, but also between 2 vector streams. In such case each vector field is calculated separately just like scalar stream.
One particular use of calculating cross correlation between two vector streams can be to show how two signals are correlated in frequency domain. If the source of vector stream is FFT (that contains whole range of frequencies) being done periodically (for example 10 times per second), then correlation can show how those 2 streams are correlated in frequency range. For example how similar are alpha changes in two points.
The above is the most obvious example, but in fact any vector stream can be correlated. For example a picture stored as a vector etc.
Jarek |
|
 |
wak
Joined: Sep 14, 2006 Posts: 5
|
Posted: Jul 16, 2007 3:04 PM Post subject: |
|
[quote:e8ed59b777=\"Jarek Foltynski\"]BioEra can process stream of vectors, therefore it is possible to calculate correlation not only between 2 scalar streams, but also between 2 vector streams. In such case each vector field is calculated separately just like scalar stream.
One particular use of calculating cross correlation between two vector streams can be to show how two signals are correlated in frequency domain. If the source of vector stream is FFT (that contains whole range of frequencies) being done periodically (for example 10 times per second), then correlation can show how those 2 streams are correlated in frequency range. For example how similar are alpha changes in two points.
The above is the most obvious example, but in fact any vector stream can be correlated. For example a picture stored as a vector etc.
Jarek[/quote:e8ed59b777]
Jarek, Is there a simple way to get extract whether two frequencies have amplitude that are in phase? |
|
 |
Jarek Foltynski
Joined: Jan 13, 2005 Posts: 62
|
Posted: Jul 16, 2007 5:17 PM Post subject: |
|
Hi,
it is possible to measure phase. The FFT2Transform element provides two output vector streams, one contain real and other imaginary vector. The phase is the angle between those two. There is no element specifically for phase at this moment, but it should be easy to use ExpressionEvaluator to calculate the difference using trigonometric functions.
Jarek |
|
 |
wak
Joined: Sep 14, 2006 Posts: 5
|
Posted: Jul 19, 2007 10:52 PM Post subject: |
|
[quote:d0bcb5da2b=\"Jarek Foltynski\"]Hi,
it is possible to measure phase. The FFT2Transform element provides two output vector streams, one contain real and other imaginary vector. The phase is the angle between those two. There is no element specifically for phase at this moment, but it should be easy to use ExpressionEvaluator to calculate the difference using trigonometric functions.
Jarek[/quote:d0bcb5da2b] Jarek, I am not an engineer or programmer, but do you think the following equations could be used to get a sum/difference signal, where synchrony of the sum of both channels is on one 3d time, frequency, amplitude display and a second channel difference shows lack of synchrony of the eeg ? When two channels are highly synchronous then the difference channel display would show very low energy between two electrode pairs.
Real = 1/nSum(X1(k)X2(k) + Y1(k)Y2(k)) Imaginary = 1/nSum(X2(k)Y1(k) - X1( k)Y2(k)) n is the number of times the sum/difference is computed
The phase angle is computed by: gamma = Tan-1(Imaginary/Real)
How hard would this be to implement, if I have the correct equations? When will Bioera become available again?
Thank you. |
|
 |
Jarek Foltynski
Joined: Jan 13, 2005 Posts: 62
|
Posted: Jul 20, 2007 8:32 PM Post subject: |
|
Hi,
I do not fully understand all your equations, for example what is X1, what is k?
But here is my idea. Assuming Re1, Im1 are the vectors (outputs from FFT2Transform) from the first channel, and Re2, Im2 from the second channel. Each vector contains n frequencies, assume the same parameters of FFT for both channels.
Then the Phase for any `k` frequency (where 0<=k<n) in such vector is the angle between Re[k] and Im[k]. Like you said:
Phase1 = Tan-1(Im1[k]/Re1[k]) Phase2 = Tan-1(Im2[k]/Re2[k]) And the phase difference = Phase1 - Phase2
(Note: this math is simplified, better description is here: http://www.euclideanspace.com/maths/algebra/vectors/angleBetween/index.htm)
The above calculation is only for one frequency. To present all frequency phase differences is another topic, it could be shown as vector (in time, using Vector3Ddisplay), so that all of them are visible at once. Or take a mean from all and present as scalar value.
Hope this helps.
Jarek |
|
 |
wak
Joined: Sep 14, 2006 Posts: 5
|
Posted: Jul 20, 2007 10:46 PM Post subject: |
|
[quote:ca8a6aff70=\"Jarek Foltynski\"]Hi,
I do not fully understand all your equations, for example what is X1, what is k?
But here is my idea. Assuming Re1, Im1 are the vectors (outputs from FFT2Transform) from the first channel, and Re2, Im2 from the second channel. Each vector contains n frequencies, assume the same parameters of FFT for both channels.
Then the Phase for any `k` frequency (where 0<=k<n) in such vector is the angle between Re[k] and Im[k]. Like you said:
Phase1 = Tan-1(Im1[k]/Re1[k]) Phase2 = Tan-1(Im2[k]/Re2[k]) And the phase difference = Phase1 - Phase2
(Note: this math is simplified, better description is here: http://www.euclideanspace.com/maths/algebra/vectors/angleBetween/index.htm)
The above calculation is only for one frequency. To present all frequency phase differences is another topic, it could be shown as vector (in time, using Vector3Ddisplay), so that all of them are visible at once. Or take a mean from all and present as scalar value.
Hope this helps.
Jarek[/quote:ca8a6aff70]
Thanks Jarek. My maths is limited to vector calculus. No ordinary differential equations.
What I am looking for is explained here, although the math is not included. My question is, is it possible to do the channel sum and difference described in Bioera. If it is and I can get it to work then I want to buy it.
http://www.brainmaster.com/tfc/index_files/Publications/2chanbrainscapes.pdf |
|
 |
Jarek Foltynski
Joined: Jan 13, 2005 Posts: 62
|
Posted: Jul 21, 2007 4:11 AM Post subject: |
|
Hi,
I can`t really give any answer here because I do not know what exactly is happening there. Before you start using any tool, BioEra or other, you need to know first exactly the method. I am pretty sure it should be possible in BioEra because it allows virtually unlimited flexibility, but the mathematics must come first.
Jarek |
|