def compute(self):
        mat = self.get_input("Signal")
        
        sr = self.get_input("Sampling Rate")
        if self.has_input("Window Size"):
            window = self.get_input("Window Size")
        else:
            window = sr

        if self.has_input("Stride"):
            stride = self.get_input("Stride")
        else:
            stride = int(sr / 2)

        
        signal_array = mat.matrix.toarray().ravel()

        # We now have a 1-D array that we can have good indexing into
        pad = signal_array[0:int(window/2)]
        signal_array = numpy.concatenate((pad,signal_array))
        win_low = 0
        win_hi = window - 1
        phasors = fftpack.fft(signal_array[win_low:win_hi])
        out_array = phasors.ravel()

        win_low += stride
        win_hi += stride

        while win_hi < signal_array.shape[0]:
            phasors = fftpack.fft(signal_array[win_low:win_hi])
            win_low += stride
            win_hi += stride
            out_array = numpy.vstack([out_array, phasors.ravel()])

        out = SparseMatrix()
        out.matrix = sparse.csc_matrix(out_array)
        self.set_output("FFT Output", out)
dataset/ETHPy150Open VisTrails/VisTrails/contrib/SciPy/DSP.py/WindowedFourierTransform.compute/original