Generates a simple trigonometric model based on a sum of sine waves 
    
    Parameters
    ----------
    t: ndarray
        Vector containing the time instants where the model will be sampled
    f0: float
        Fundamental frequency of the model
    A: ndarray 
        Vector containing the amplitudes of the harmonics in the model. 
        The lenght of A defines the number of harmonics
        
    Returns
    -------
    y: ndarray
        Trigonometric model based
    var_y: float
        Analytical variance of the trigonometric model
        
    Example
    -------
    Assumming a time vector t has already been specified
    
    >>> import P4J
    >>> y_clean = P4J.trigonometric_model(t, f0=2.0, A=[1.0, 0.5, .25])

def trigonometric_model(t, f0, A):
    """
    Generates a simple trigonometric model based on a sum of sine waves 
    
    Parameters
    ----------
    t: ndarray
        Vector containing the time instants where the model will be sampled
    f0: float
        Fundamental frequency of the model
    A: ndarray 
        Vector containing the amplitudes of the harmonics in the model. 
        The lenght of A defines the number of harmonics
        
    Returns
    -------
    y: ndarray
        Trigonometric model based
    var_y: float
        Analytical variance of the trigonometric model
        
    Example
    -------
    Assumming a time vector t has already been specified
    
    >>> import P4J
    >>> y_clean = P4J.trigonometric_model(t, f0=2.0, A=[1.0, 0.5, .25])
    
    """
    y = 0.0
    M = len(A)
    var_y = 0.0
    for k in range(0, M):
        y += A[k]*np.sin(2.0*np.pi*t*f0*(k+1))
        var_y += 0.5*A[k]**2
    return y, var_y