Hi Leonardo,
If there is only one harmonic present in the data at a time, you can try placing a constraint on the parameter p - which seems to be the one that determines the harmonicity in your equation - so that the fitter varies it only within a range of expected values for the harmonic.
If the data contains a mixture of harmonics, you can rewrite the equation, for example, like below: y = M + A1*cos((x-H)/p1)+A2*cos((x-H)/p2)+A3*cos((x-H)/p3); where I am assuming the offset H is same for all three harmonics and just the frequency and amplitudes are different. You can then further place constraints on p1, p2, p3 as well.
To place constraints (upper, lower bounds), go to the Option|Constraints menu item of the NLSF tool.
Easwar OriginLab.
|