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
0
votes
2 answers

Convert single-precision, floating-point value to Int 16 using Accelerate framework

How to convert single precision floating-point to int 16 with help of Accelerate framework. Int16 to float: import Accelerate let rr: [Int16] = [ 18, 21, 41, 42, 48, 50, 55, 90] var float = [Float](repeating: 0, count: rr.count) vDSP_vflt16(rr,…
SPatel
  • 4,768
  • 4
  • 32
  • 51
0
votes
1 answer

How can I make this function as fast as the vDSP version?

I have written the function below, which uses vDSP function calls to compute a certain result. I thought it would be faster if I rewrote it using the 128 bit vFloat data type to avoid the vDSP function calls. But my vFloat code is still 2-3 times…
sirhans
  • 26
  • 3
0
votes
1 answer

How I should create complex number from image data for Fast Fourier Transform (fft, swift)?

I have array of grayscale for example [0.0, 0.0, 0.0, 255.0, 255.0, 255.0, 130.0, 130.0, 130.0] 3x3 dimension, I need create array of complex numbers for fft function. How I should convert this array? Im using swift 4 and it is for iOS, but I think…
Arkhyp Koshel
  • 175
  • 11
0
votes
1 answer

Why doesn't vDSP_maxv find the max value in the vector?

vDSP_maxv is not assigning the max value to output in the code below. I expected the last line to print 2, but instead it prints something different each time, usually a very large or small number like 2.8026e-45 I've read this tutorial, the…
0
votes
1 answer

How to port scipy.signal.fftconvolve into swift using accelerate framework?

I am working on a voice pitch identification problem in iOS, For analysis purpose i was using python it gave me appropriate results.... But when I tried to recreate the same thing in iOS using accelerate framework it is giving incorrect or weird…
Ashif Khan
  • 9
  • 1
  • 4
0
votes
0 answers

Making A DCT in a for loop faster

I need to run a DCT on multiple signals (time slices of the same audio signal). My current code looks like this: var ci = Array(stride(from: Float(0), to: Float(y.count), by: Float(p))) var c = Array(repeating:0.0, count:y.count) for…
FerasAS
  • 273
  • 2
  • 14
0
votes
1 answer

How to upsample audio with digital interpolation

I want to take an array with N number of audio data points and upsample it such that there are L*N points. I understand an accurate way to do this is to pad L-1 zero points between each original point and then to low pass the signal. According to…
0
votes
1 answer

Strange values from vDSP_meanD

I am using the vDSP_meanD function to determine the average of a data set (consecutive diferences from an array) The code I am using is below func F(dataAllFrames:[Double],std:Double,medida:String)->Double{ let nframes=dataAllFrames.count …
Dontpanic
  • 1
  • 1
0
votes
1 answer

Reordering with Accelerate framework

I would like to use the Accelerate Framework libraries for sorting data (pairs of x and y values). I used the function vDSP_vsorti to find the vector with the ordering indices of the x data. Now I should reorder the y data accordingly to the x…
galuoises
  • 1
  • 1
0
votes
1 answer

Error of '"_vDSP maxvD", referenced from...' when implementing core-plot

I'm trying to implement this library for creating graphs in my Xcode project. I'm following this tutorial to insert it in my project. When I finish it and compile and run it, I get the following error:
Horray
  • 693
  • 10
  • 25
0
votes
1 answer

Convert SIint16 to float on iPhone4

I am developing an app which uses simple pitch perception and it runs fine in the Xcode Simulator. The app loads in the iPhone 4 and I can navigate the app but no output is shown . I have started to debug and find that when I convert Sint16 to float…
0
votes
2 answers

Perform a FFT of a signal in Objective-C and compare results with MATLAB

I'm trying to perform the FFT of a signal in Objective-C. The signal is composed of 180 samples. The signal is the following: float testFFT [180] = { 0.0000000000, 0.0000432091, 0.0001739833, 0.0003786624, 0.0006653523, 0.0010579729, 0.0015538626,…
Taglia
  • 107
  • 1
  • 10
0
votes
0 answers

How can I invert a Matrix in Objective-C

I am trying to solve a system of equations Ax = b in Objective-C. My A matrix is rectangular by nature so I am trying to find x by doing x = inv(A'*A)*A'*b. I am using vDSP to multiply and transpose the matrices but I need something to invert A'*A…
Blane Townsend
  • 2,888
  • 5
  • 41
  • 55
0
votes
1 answer

vDSP and FFT calculation

I am interesting in audio processing and I want perform FFT calculation. Many sources and tutorials says that vDSP is great. But I don't understand why size of real and imaginary part after calculation is N/2 ? How I can obtain 1024 real and…
vlad.grb
  • 339
  • 4
  • 16
0
votes
1 answer

iOS - Element-wise conditional-bounds for matrices in Accelerate.framework

In my iOS code, I have a matrix (float *) variable that looks something like this: [ 1 2 3 4 5 6 7 8 9 0 1 2 ] I need to build a matrix that has 1's for all the elements equal to a value (let's say 2 for example), and 0's for everything else.…
Brett
  • 11,637
  • 34
  • 127
  • 213
1 2 3
8 9