fourier3

mdhelper.fit.fourier.fourier3(x: ndarray, a0: float, a1: float, b1: float, a2: float, b2: float, a3: float, b3: float, omega: float) ndarray[source]

Convenience function for the fourier3 model from MATLAB.

\[y=a_0+a_1\cos{(\omega x)}+b_1\sin{(\omega x)} +a_2\cos{(2\omega x)}+b_2\sin{(2\omega x)} +a_3\cos{(3\omega x)}+b_3\sin{(3\omega x)}\]
Parameters:
xnumpy.ndarray

\(x\)-values.

a0float

Constant (intercept) term \(a_0\) for the \(k=0\) cosine term.

a1float

Coefficient \(a_1\) for the first \(\cos\) term.

b1float

Coefficient \(b_1\) for the first \(\sin\) term.

a2float

Coefficient \(a_2\) for the second \(\cos\) term.

b2float

Coefficient \(b_2\) for the second \(\sin\) term.

a3float

Coefficient \(a_3\) for the third \(\cos\) term.

b3float

Coefficient \(b_3\) for the third \(\sin\) term.

omegafloat

Fundamental frequency \(\omega\) of the signal.

Returns:
fitnumpy.ndarray

Fitted \(y\)-values.