Hi Tim,

Thank you for your response.

Do you mean it is different than Spike2's initial guess, or than the fitted data co-efficients which Spike2 generates?

Yes, my initial estimate of phase using first peak, or first level crossing seems to be far different than Spike2's (see attached images) and I had initial thought if I could replicate how spike2 was performing this initial estimate I could increase the reliability of my fitting.

However, after trying to fit other data sections I realise that my other coefficient guesses fall short of spike2's which leads me to more questions about how spike2 performs initial estimates for the other three coefficients - if you dont mind me expanding the scope of this thread...

For a3 (or DC offset estimate) I just take the mean of the entire fit section - this guess is most consistent with spike2.

For a0 (or amplitude) I take max-min/2 - my guess is typically always higher than spike2.

And finally for a1 I take a fast fft and extract the strongest peak but due to the number of data points per typical fit and sample rate I have a resolution of only 10Hz - Spike2 seems to have a much better resolution here so I am considering using a slower temporal method (ie how many cycles/time unit).

If you are able to share any more information about how spike2 performs these initial guesses on all the coefficients I would be more appreciative.

- Spike2 initial guess at coefficients

- R phase estimate using first level crossing and other coefficients estimates from spike2