CONAN.utils.sinusoid#
- CONAN.utils.sinusoid(x, A=0, x0=None, P=None, n=1, trig='sin')#
Calculate the sinusoidal function y = A*sin(2*pi*(x-x0)/P) or y = A*cos(2*pi*(x-x0)/P) given the parameters.
- Parameters:
x (array-like) – x values
A (float) – amplitude of the sinusoid
x0 (float) – phase offset of the sinusoid
P (float) – period of the sinusoid
trig (str) – trigonometric function to use. Default is “sin”. Options are “sin”, “cos”, “sincos”
- Returns:
y – sinusoidal function
- Return type:
array-like