mtspec icon indicating copy to clipboard operation
mtspec copied to clipboard

Auto-Coherence Error

Open akhambhati opened this issue 10 years ago • 3 comments

On occasion I experience the following crash-error: "Auto-coherence not applicable."

Reproduced via the coherence estimation below: out = mt_coherence(1.0/fs, signal[:, ix], signal[:, iy], NW, k, int(n_sample_win/2), 0.95, iadapt=1,
cohe=True, freq=True)

For most signals the coherence estimate works fine, but on occasion I experience the above crash-error. I'm not sure how to error handle this.

akhambhati avatar Mar 30 '15 18:03 akhambhati

Apologies, I discovered that my data had a dead" channel with zero signal amplitude.

akhambhati avatar Mar 30 '15 18:03 akhambhati

Might still be worth to handle this. Also anybody else hitting this issue might profit from this report. So no need to apologize at all. :)

megies avatar Mar 30 '15 19:03 megies

I just came across this same issue. The code doesn't compute the coherence estimate for two data series with the same amplitude which should normally be 1. I checked in the mt_cohe.f90 subroutine at lines 184-187, there is a condition that prevents the code from computing the auto-coherence estimate.

if (all(xi==xj)) then
write(6,'(a)') 'Auto-coherence not applicable' stop

I don't understand the reason for such a condition since the autocoherence should be approximately 1. Any clue?

flominT avatar Sep 11 '18 16:09 flominT