# Path: compmusic/extractors/log.py
# class ExtractorAdapter(logging.LoggerAdapter):
#     def set_documentid(self, docid):
#     def set_sourcefileid(self, sfid):
#     def process(self, msg, kwargs):
# def get_logger(modulename, moduleversion=None):


import math
import essentia as es
import essentia.standard as ess
import numpy as np
import scipy.stats as scistats
import parameters as params
from compmusic.extractors import log
    return localscore


##########################################################################################
def hanning(n):
    window = 0.5 - 0.5 * np.cos(2 * math.pi * np.arange(n) / (n - 1));
    return window


###########################################################################################
def normMax(y, alpha=0):
    z = y.copy()
    z = z / (np.max(np.abs(y)) + alpha);
    return z


###########################################################################################
def normalizeFeature(featMat, normP):
    ''' Assuming that each column is a feature vector, the normalization is along the columns  
    '''
    featNorm = np.zeros(featMat.shape).astype(complex)
    T = featMat.shape[1]
    for t in range(T):
        n = np.linalg.norm(featMat[:, t], normP)
        featNorm[:, t] = featMat[:, t] / n
    return featNorm


###########################################################################################
def compute_fourierCoefficients(s, win, noverlap, f, fs):

# Path: compmusic/extractors/log.py
# class ExtractorAdapter(logging.LoggerAdapter):
#     def set_documentid(self, docid):
#     def set_sourcefileid(self, sfid):
#     def process(self, msg, kwargs):
# def get_logger(modulename, moduleversion=None):


# Path: compmusic/extractors/rhythmlib/aksharaPulseTrack.py
import math
import essentia as es
import essentia.standard as ess
import numpy as np
import scipy.stats as scistats
import parameters as params
from compmusic.extractors import log

    return localscore


##########################################################################################
def hanning(n):
    window = 0.5 - 0.5 * np.cos(2 * math.pi * np.arange(n) / (n - 1));
    return window


###########################################################################################
def normMax(y, alpha=0):
    z = y.copy()
    z = z / (np.max(np.abs(y)) + alpha);
    return z


###########################################################################################
def normalizeFeature(featMat, normP):
    ''' Assuming that each column is a feature vector, the normalization is along the columns  
    '''
    featNorm = np.zeros(featMat.shape).astype(complex)
    T = featMat.shape[1]
    for t in range(T):
        n = np.linalg.norm(featMat[:, t], normP)
        featNorm[:, t] = featMat[:, t] / n
    return featNorm


###########################################################################################
def compute_fourierCoefficients(s, win, noverlap, f, fs):

    logger = log.get_logger("rhythm")