From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Signal Conditioning

cancel
Showing results for 
Search instead for 
Did you mean: 

Percentage of similarity between two signals_ PCA & Covariance Matrix

I have a problem in the calculation of the percentage of similarity between two EEG signals which were acquired by the different type of electrodes by using correlation technique. I tried averaging the data 500Khz (Actual Sampling rate) at 1000 samples also. I believe that I am not getting the correct value of percentage. I tried auto-correlating the reference signal and maximum of autocorrelation was found out. similarly, I tried cross-correlating the reference signal with the test signal and finding out the maximum, from those two values I am trying to find out the percentage of similarity.., is it a correct approach?? Please look into the attached VI.

Labview TSA user manual it was mentioned that we can find our signal similarity by using PCA, Covariance matrix gives the signal similarity. But I could not find any example for this. Could you give me some idea on this?

 

Download All
0 Kudos
Message 1 of 7
(5,427 Views)

Do have a simulator ?

How do you make shure they get the same signal?

 

Before testing with real signals, I would test my vi with known signals .. 

and how does a 0% similarity look like??

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 7
(5,400 Views)

Hi Henrik,

 

The data is not from the simulator. Signals are acquired from prototype EEG board.

Both the electrodes were closely placed together. I believed that both the electrodes were acquiring same signals but there is a slight difference in amplitude levels and may be in the phase also Smiley Indifferent

I plotted them together, those two are similar to each other. But I would like to quantify the similarity between them.

As you said I should test it with known signalsSmiley Tongue. You are rightSmiley Happy

EEge.PNG

 

This is how the two signals appear on the graph (100kHz Sampling, 256Hz down sampled), peaks are eye blink artefacts...I believe that there is some correlation between them.

 

0 Kudos
Message 3 of 7
(5,396 Views)

I tried giving simulated known signals as input. Two sinusoidal waves mixed with difference noise and little bit phase difference & bias voltages.

It seems it is giving the correct value for raw data.

Simu_Xcorr.PNG

I still have a doubt that whether this technique is correct or not?

 

 

 

 

0 Kudos
Message 4 of 7
(5,385 Views)

If you use two pairs of sensors in parallel  in a

xo

ox

 

orientation you might get even more identical values.

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 5 of 7
(5,382 Views)

My father had a EEG (he was pediatrist and a specialist for EEG, so I had fun spending some time on it 😉 )

If you look at the XY graph and fit a line you get a slope and an intercept (offset)

Ignoring the offset (different galvanic??),  the slope is an indicator for the sensitivity of the electrodes. (comparing both , if equal the slope should be 1 🙂 )

 

But since the electrodes have a quite complex impedance to the skin I had a look in the frequency domain.

To get rid of some noise I used the octave band analyses and had a look from 10mHz to 100Hz

(Some of the differences could be of your DAQ... differences in the filters.. etc.  It's up to you to check it 😉 )

The slope is about 0.64  indicating that the red trace has a higher sensitivity.

This also shows in the frequency domain for frequencies higher than 5 Hz

However the sensitivity in the lower frequency range flips or is about equal....  it up to you to interpret that 😄

FP.png

 

I don't know if the signal at 0.13 Hz is noise or of interest, but if it's of interest: The swapping of the sensitivity could be an indicator for some sort of electrochemical?? limit in the signal slope of the white eletrode ....  but I'm no expert in that 😉

 

The joy of engineering is to find a strait line in a double logarithmic scale 😄

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 6 of 7
(5,367 Views)

Hi Henrik,

Thank you for your reply.

Generally, the frequency of interest for EEG signal will be in the range of 0.5Hz to 40Hz for most of the brain-computer interfacing applications. The suggested octave analysis is depicting the amplitude variation of two signals in the interested frequency range. That's really helpful make out the amplitude characteristics with respect to frequency.Smiley Happy

 

Here, my aim to is to find out the similarity between the signals with respect to their frequency domain characteristics irrespective of amplitudes. The amplitudes could be low for an electrode due to its low sensitivity/less skin-electrode impedance matching but it also acquires a similar signal when compared to highly sensitive electrodes. So, I believe that the frequency domain characteristics would be more similar to such kind of signalsSmiley Indifferent

I could not able to get any information about PCA based covariance matrix calculation as mentioned in the LabVIEW TSA guide as attached above. Even I don't have the clear idea about that technique whether it calculates the percentage of similarity based on time domain characteristics or frequency domain characteristics?Smiley Embarassed

If you have any alternative idea please suggest me. 

 

 

 

0 Kudos
Message 7 of 7
(5,277 Views)