diff --git a/brainStates/SleepScoreMaster/PickSWTHChannel_km.m b/brainStates/SleepScoreMaster/PickSWTHChannel_km.m index 8e70179..39a3115 100644 --- a/brainStates/SleepScoreMaster/PickSWTHChannel_km.m +++ b/brainStates/SleepScoreMaster/PickSWTHChannel_km.m @@ -497,6 +497,9 @@ specdt = mode(diff(t_FFT)); thFFTspec = (abs(thFFTspec)); +% if thFFTspec is zero, log will make inf, so add eps +thFFTspec(thFFTspec == 0) = eps; + [zFFTspec, mu, sig] = zscore(log10(thFFTspec)'); thfreqs = find(thFFTfreqs >= f_theta(1) & thFFTfreqs <= f_theta(2));