I tried and tried to get the maximas but I Cant, the array is big like this:
var testBuff = [Float](repeating: 0.0,
count: Int(testArr.count))
var maxSamplesBuffer = [Float](repeating: 0.0,
count: testArr.count)
vDSP_vabs(testArr, 1, &testBuff, 1, vDSP_Length(testArr.count));//get absolute value array
vDSP_vswmax(testBuff, 1, &maxSamplesBuffer, 1, vDSP_Length(20) , vDSP_Length(30))//Returns: self[i] = max(a[i ..< i+windowLength])
testArr is [422848] samples containing floats. I can get the maximas for small arrays but when it gets big i have trouble.