fourier7

mdhelper.fit.fourier.fourier7(x: ndarray, a0: float, a1: float, b1: float, a2: float, b2: float, a3: float, b3: float, a4: float, b4: float, a5: float, b5: float, a6: float, b6: float, a7: float, b7: float, omega: float) ndarray[source]

Convenience function for the fourier7 model from MATLAB.

y=a0+a1cos(ωx)+b1sin(ωx)+a2cos(2ωx)+b2sin(2ωx)++a7cos(7ωx)+b7sin(7ωx)
Parameters:
xnumpy.ndarray

x-values.

a0float

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

a1float

Coefficient a1 for the first cos term.

b1float

Coefficient b1 for the first sin term.

a2float

Coefficient a2 for the second cos term.

b2float

Coefficient b2 for the second sin term.

a3float

Coefficient a3 for the third cos term.

b3float

Coefficient b3 for the third sin term.

a4float

Coefficient a4 for the fourth cos term.

b4float

Coefficient b4 for the fourth sin term.

a5float

Coefficient a5 for the fifth cos term.

b5float

Coefficient b5 for the fifth sin term.

a6float

Coefficient a6 for the sixth cos term.

b6float

Coefficient b6 for the sixth sin term.

a7float

Coefficient a7 for the seventh cos term.

b7float

Coefficient b7 for the seventh sin term.

omegafloat

Fundamental frequency ω of the signal.

Returns:
fitnumpy.ndarray

Fitted y-values.