             let a = Float(arc4random_uniform(100))
             buf.push(a)
             let signals = buf.signals
-            print(a)
-            print(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")
     }

    
    
    // 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)
    }
    
    

    
    
    // Mean value
    var mean: Float {
        return dsbuffer_mean(self.buffer)
    }
    
    
    // Vector length
    var length: Float {
        return dsbuffer_length(self.buffer)
    }
    
    
    // Remove mean value (centralize)
    func centralized() -> [Float] {
        var result = [Float](count: self.size, repeatedValue: 0.0)
        dsbuffer_remove_mean(self.buffer, &result)
        return result
