     
     func resetWindow() {
         windowType.createWindow(window, len: length)
-        
-        var s = Float(scaleInputBy)
-        vDSP_vsmul(window, 1, &s, window, 1, vDSP_Length(length))
     }
     
     func appendData(data: UnsafeMutablePointer<Float>, withSamples numSamples: Int) {

        var scale: Float = 2.0 // 2.0 * sqrt(Float(length))
        vDSP_vsdiv(&output, 1, &scale, &output, 1, UInt(halfLength))
        
        // TODO: add appropriate scaling based on window
        
        return output
    }
}

        // free the FFT setup
        vDSP_destroy_fftsetup(fftSetup)
        
        // free the memory used to store the samples
        samplesWindowed.destroy()
        samplesWindowed.dealloc(length)
        
        // free the window
        window.destroy()
        window.dealloc(length)
