     }
     
     
+    // Buffer size
+    var bufferSize: Int {
+        return self.size
+    }
+    
+    
     // Dump as array
     var signals: [Float] {
         var dumpedSignal = [Float](count: self.size, repeatedValue: 0.0)

    
    
    // normalize vector to have unit length
    func normalizeToUnitLength(centralized: Bool) -> [Float] {
        var result = [Float](count: self.size, repeatedValue: 0.0)
        dsbuffer_normalize_to_unit_length(self.buffer, centralized, &result)
        return result
    }
    
    
    func dotProduct(withVector: [Float]) -> Float {
        assert(self.size == withVector.count)
        return dsbuffer_dot_product(self.buffer, withVector)
    }
    
    

            let a = Float(arc4random_uniform(100))
            buf.push(a)
            let signals = buf.signals
//            print(a)
//            print(signals)
            assert(signals[size-1] == a)
        }
        
        
        let norm = buf.normalizedToUnitLength(true)
        let coeff = vDotProduct(norm, v2: norm)
        print("coeff: %.2f\n", coeff)
        
        print("\nDSBuffer test OK:\n\n")
    }
