1

作者: theagao | 来源:发表于2018-09-13 21:53 被阅读0次

    1 load wavefile之后 进行归一化

    import scipy.io.wavfile as wav

    Fs, data = wav.read(inputAudioFile)

    # data = np.double(data) /  32768.0 # makes data vary from -1 to 1

    scaleData = 1.2 * data.max() # to rescale the data.

    data = np.double(data) / scaleData # makes data vary from -1 to 1

    ==============================================================

    2. hanming window

    def sinebell(lengthWindow):

    """

    window = sinebell(lengthWindow)

    Computes a "sinebell" window function of length L=lengthWindow

    The formula is:

    window(t) = sin(pi * t / L), t = 0..L-1

    """

            window = np.sin((np.pi * (np.arange(lengthWindow))) / (1.0 * lengthWindow))

    return window

    "sinebell" window  with win_len=2048

    相关文章

      网友评论

          本文标题:1

          本文链接:https://www.haomeiwen.com/subject/lniwgftx.html