1
$\begingroup$

Suppose I have two time series (measuring the gyroscope data from two body sensors — A and B).

I somehow need to evaluate whether the signal B is "following" the signal A — that is, how similar it is.

Is there any measure that is used in signal processing for this sort of task?

For instance, I'm thinking about some kind of comparison algorithm that can indicate whether a signal follows another one or something along those lines...

Thank you!

$\endgroup$
1
  • 1
    $\begingroup$ do you mean "correlation"? $\endgroup$ Aug 9, 2021 at 20:28

4 Answers 4

3
$\begingroup$

Instead of using the raw gyroscope measurements, I would recommend processing/converting the raw measurements into roll, pitch, and yaw angles. Conversion helps with the interpretation. You can try eyeballing the results and check if $A \rightarrow B$.

If you're looking for a mathematically rigorous approach to test if there is a causal relationship between the two sensors, then try Granger causality. Since these are time-series data, you can compute Granger causality for roll, pitch, and yaw, separately, or compute multivariate Granger causality.

$\endgroup$
2
1
$\begingroup$

You'd need to examine the cross-correlation between the two signals, say $x_{A}[k]$, $x_{B}[k]$.

From the cross-correlation sequence $R_{_{AB}}$ given by the expression

$R_{_{AB}}[n] \triangleq \sum\limits_{k=-\infty}^{+\infty} x_{A}[n]x_{B}[k+n]$

you can determine the amount of $n$ you need to shift $x_{B}$ in the time axis to get the maximum $R_{_{AB}}$ which is where it matches with $x_{A}$ "the most".

You can use scipy.signal.correlate in Python or if you're using MATLAB, the command xcorr to calculate the correlation sequence. Both documentations provide excellent examples for what you're trying to achieve.

$\endgroup$
1
$\begingroup$

You can use normalized cross correlation to find similarity between two signal

$\endgroup$
1
$\begingroup$

Assuming you have pre-processed the signals to get time alignment and filled in missing samples etc., Spearman rank correlation would be a choice: https://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient

It's standard in Python numpy/scipy.

Qualitatively, it will help you track if X and Y fall/rise together.

Of course, good old Pearson correlation (as described in the answers above) would work as well.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.