Questions tagged [vdsp]

vDSP is the (vector) digital signal processing portion of Apple’s Accelerate framework.

vDSP is the (vector) digital signal processing portion of Apple’s Accelerate framework, part of OS X and iOS. It provides a variety of vector and array functions for signal processing and other applications. vDSP uses hardware features such as SIMD (Single Instruction Multiple Data) to provide high performance.

121 questions
1
vote
2 answers

How to sort the indices of Slice> using vDSP?

I’m using buffer in many other vDSP operations before the code below. To those operations it is naturally a contiguous piece of memory, and that’s handy as there are vastly reduced number of calls to vDSP. // […] many operations with buffer…
oxygen
  • 5,891
  • 6
  • 37
  • 69
1
vote
1 answer

Deinterlace a vector using vDSP

Let's say I have a vector: let input: [Float] = [1, 2, 3, 4, 5, 6, 7, 8, ...] What I'd like to do is deinterlace this vector by selecting every other value to produce 2 new vectors as output, as follows: [1, 3, 5, 7, ...] [2, 4, 6, 8, ...] What's…
Jonathan Ellis
  • 5,221
  • 2
  • 36
  • 53
1
vote
1 answer

Fast UInt to Float conversion in Swift

I am doing some realtime image analysis on a live videostream. I am using vImage to calculate histograms and vDSP for some further processing. I have Objective-C code that has been working well over the years. I am now about to convert it to Swift.…
Sten
  • 3,624
  • 1
  • 27
  • 26
1
vote
1 answer

vDSP.DCT unwraps to nil

When I execute this line of code: self.forwardDCTSetup = vDSP.DCT(count: 40, transformType: vDSP.DCTTransformType.II)! I get: Fatal error: Unexpectedly found nil while unwrapping an Optional value I am following this tutorial almost exactly:…
Syllabear
  • 193
  • 5
1
vote
1 answer

vDSP_zrvmul not returning any results (or all zeros)

I have tidied my code up and condensed it to make it readable, as per another users comments. I have a complexFloatArray class, to store arrays of Complex vectors class complexFloatArray { var reals: [Float] var imaginaries: [Float] …
samp17
  • 547
  • 1
  • 4
  • 16
1
vote
2 answers

Averaging the color of pixels with Accelerate

Yes, I know about using CIAreaAverate CIFilter to get the average color of pixels. I am trying to create some alternative using Accelerate Framework to see if I can come with something faster. I am rendering a CIImage to a context. For that purpose…
Duck
  • 34,902
  • 47
  • 248
  • 470
1
vote
2 answers

Converting an array of Floats to an array of UnsafePointer

I have this array of floats created like this var myArray : [Float] = [] This array has 256 elements, the real part. All imaginary parts are zero. I need to do a vDSP_ctoz(anArray, 2, &output, 1, vDSP_Length(n/2)) but this API requires…
Duck
  • 34,902
  • 47
  • 248
  • 470
1
vote
1 answer

Accelerate framework - vDSP_zvmags - Swift 4.2

In Swift 4.0 Xcode 9.4.1 using the vDSP_zvmags function and passing an inout float array variable works however in Swift 4.2 Xcode 10.1 complains that one cannot pass an array parameter when a expecting a float type. //Class variable private var…
Alexander
  • 1,424
  • 18
  • 23
1
vote
1 answer

UnsafeMutablePointer returned by vDSP_fft_zip being overwritten immediately

In Swift 4 I'm creating a DSPSplitComplex to use in vDSP_fft_zip(), but it's being immediately overwritten the next time I create another DSPSplitComplex. ( DSPSplitComplex structure has 2 UnsafeMutablePointer ) //--Create the DSPSplitComplex…
Joey FourSheds
  • 479
  • 1
  • 7
  • 18
1
vote
1 answer

How to run Apple Accelerate fft algorithms with data length, which is not power of 2?

I want to port an algorithm from Android to iOS written in C. For Android I use fftw3 library. And it is able to run the algorithm on input data with any size. For example the size I see in debug is 14996. And It's pretty efficient. And when I read…
Semyon Tikhonenko
  • 3,872
  • 6
  • 36
  • 61
1
vote
1 answer

Segmentation fault using Swift Accelerate vDSP_ctoz

I'm trying to convert an interleaved DSPComplex vector to a DSPSplitComplex vector, using vDSP_ctoz from the Swift Accelerate library. The last line of the code below produces the error Segmentation fault: 11 I don't understand why vDSP_ctoz would…
ASDFQWERTY
  • 399
  • 4
  • 8
1
vote
0 answers

Comparing two arrays with vDSP

I need to do comparison operations on two arrays using vDSP. I don't see any direct functions to do that. //....sourceArray is filled up with data float sourceArray = new float[arrayLength]; //....destArray is filled up with data float destArray =…
kid.abr
  • 320
  • 5
  • 14
1
vote
1 answer

Ignoring an output parameter from vDSP

When using vDSP to perform some speedy calculations, I often don't care about one of the output parameters. Let's say I'm finding the index of an array's maximum value: var m:Float = 0 var i:vDSP_Length = 0 vDSP_maxvi(&array, 1, …
Rogare
  • 3,234
  • 3
  • 27
  • 50
1
vote
1 answer

How to realize the FFT/IFFT with complex numbers

I have seen many examples of vDSP that realize the FFT / IFFT with real numbers but I have not seen any event that realizes the FFT / IFFT with complex numbers. Can you indicate the direction I should take? Thank's you in advance.
Jorge OM
  • 79
  • 7
1
vote
0 answers

how to use vDSP_vswmax to get the maximum value in a sliding window?

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, …
masaldana2
  • 635
  • 9
  • 20
1 2 3
8 9