@staticmethod
    def pre_calculate(win, win_shape, pre=True):
        var = {
            'WL': win,
            'W': win_shape(win)}
        #
        if pre:
            arr = 2. * numpy.pi * numpy.arange(win) / win
            PRE = numpy.array([var['W'] * (numpy.cos(arr*k) - numpy.sin(arr*k)*1j) \
                    for k in xrange(win/2+1)])
            var['PRE'] = PRE
        #
        return type('variables', (object,), var)
dataset/ETHPy150Open dongying/dear/dear/spectrum/dft.py/Spectrum.pre_calculate/original