accelerate-framework

Matlab FFT (Fast Fourier Transform) function of non log-base2 numbers

点点圈 提交于 2019-12-11 11:55:51
问题 I have an app that I am developing that utalizes Apple's Accelerate Framework FFT function and I am trying to make it mimic the functionality of Matlab's FFT function. I have my current code set up to output exactly the same way as I am doing so in matlab. The only time that it doesn't output identically is when the number of elements in the data array are != a logarithm of base 2 (technically necessary for an FFT). I was wondering if anyone knew how the Matlab Function handled this case. If

Accelerate framework vDSP, FFT framing

懵懂的女人 提交于 2019-12-11 07:15:52
问题 I'm trying to implement FFT calculation, using Apple's vDSP, on a recorded audio file (let's assume it's a mono PCM). I've did a research here and I've found following topics quite useful: Using the apple FFT and accelerate Framework Extracting precise frequencies from FFT Bins using phase change between frames Reading audio with Extended Audio File Services (ExtAudioFileRead) For example, we configured FFT with frame_size N = 1024 samples, log2n=10: m_setupReal = vDSP_create_fftsetup(LOG_2N,

Fast Fourier Transform results: frequency axis scale?

只谈情不闲聊 提交于 2019-12-10 11:43:48
问题 I successfully implemented code that takes array data and runs a fast fourier transform on it, using Apple's Accelerate Framework (performed on iOS device). My question now is what is the scale of the frequency axis? The results have peaks as expected in certain frequency ranges, but I'm not sure what the frequency should be. The Accelerate Framework's FFT functions take in an array and spit out an array with the same (or more) number of data points. Does it assume that all those points are

On iOS how to quickly convert RGB24 to BGR24?

无人久伴 提交于 2019-12-08 17:54:38
问题 I use vImageConvert_RGB888toPlanar8 and vImageConvert_Planar8toRGB888 from Accelerate.framework to convert RGB24 to BGR24, but when the data need to transform is very big, such as 3M or 4M, the time need to spend on this is about 10ms. So some one know some fast enough idea?.My code like this: - (void)transformRGBToBGR:(const UInt8 *)pict{ rgb.data = (void *)pict; vImage_Error error = vImageConvert_RGB888toPlanar8(&rgb,&red,&green,&blue,kvImageNoFlags); if (error != kvImageNoError) { NSLog(@

Linear resampling datapoints captured at fluctuating time intervals, to flxed time intervals, in swift

早过忘川 提交于 2019-12-08 04:32:46
问题 I want to linearly interpolate some metrics that are captured at times that fluctuate, to fixed timing intervals. let original_times:[Double] = [0.0,1.3,2.2,3.4,4.2,5.5,6.6,7.2,8.4,9.5,10.0] let metric_1:[Double] = [4,3,6,7,4,5,7,4,2,7,2] let wanted_times:[Double] = [0,1,2,3,4,5,6,7,8,9,10] //linearly resample metric_1 (with corresponding sampling times 'original_times') to fixed time interval times 'wanted_times' Accelerate offers vDSP_vlint but I'm struggling to figure out how to implement

How-to convert an iOS camera image to greyscale using the Accelerate Framework?

守給你的承諾、 提交于 2019-12-07 01:58:29
问题 It seems like this should be simpler than I'm finding it to be. I have an AVFoundation frame coming back in the standard delegate method: - (void)captureOutput:(AVCaptureOutput *)captureOutput didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer fromConnection:(AVCaptureConnection *)connection where I would like to convert the frame to greyscale using the Accelerate.Framework . There is a family of conversion methods in the framework, including vImageConvert_RGBA8888toPlanar8() , which looks

Linear resampling datapoints captured at fluctuating time intervals, to flxed time intervals, in swift

北慕城南 提交于 2019-12-07 00:17:26
I want to linearly interpolate some metrics that are captured at times that fluctuate, to fixed timing intervals. let original_times:[Double] = [0.0,1.3,2.2,3.4,4.2,5.5,6.6,7.2,8.4,9.5,10.0] let metric_1:[Double] = [4,3,6,7,4,5,7,4,2,7,2] let wanted_times:[Double] = [0,1,2,3,4,5,6,7,8,9,10] //linearly resample metric_1 (with corresponding sampling times 'original_times') to fixed time interval times 'wanted_times' Accelerate offers vDSP_vlint but I'm struggling to figure out how to implement it for my application. func vDSP_vlint(_ __A: UnsafePointer<Float>, _ __B: UnsafePointer<Float>, _ __IB

Fast Fourier Transform results: frequency axis scale?

天大地大妈咪最大 提交于 2019-12-06 15:38:11
I successfully implemented code that takes array data and runs a fast fourier transform on it, using Apple's Accelerate Framework (performed on iOS device). My question now is what is the scale of the frequency axis? The results have peaks as expected in certain frequency ranges, but I'm not sure what the frequency should be. The Accelerate Framework's FFT functions take in an array and spit out an array with the same (or more) number of data points. Does it assume that all those points are equally spaced in time? It doesn't take the sampling frequency or time variable as input. Is the scale

Symmetric Matrix Inversion in C using CBLAS/LAPACK

徘徊边缘 提交于 2019-12-06 11:18:44
问题 I am writing an algorithm in C that requires Matrix and Vector multiplications. I have a matrix Q (W x W) which is created by multiplying the transpose of a vector J (1 x W) with itself and adding Identity matrix I , scaled using scalar a . Q = [(J^T) * J + aI]. I then have to multiply the inverse of Q with vector G to get vector M . M = (Q^(-1)) * G. I am using cblas and clapack to develop my algorithm. When matrix Q is populated using random numbers (type float) and inverted using the

Drawing histogram of CGImage in Swift 3

拟墨画扇 提交于 2019-12-05 16:32:07
I have a problem with vImageHistogramCalculation_ARGB8888 method while trying to convert library from Swift 2 to Swift 3 version. The problem is that the method accepts "histogram" argument only as UnsafeMutablePointer<UnsafeMutablePointer<T>?> but Swift 3 construction let histogram = UnsafeMutablePointer<UnsafeMutablePointer<vImagePixelCount>>(mutating: rgba) return unwrapped value, so I can't cast it to properly type. The compiler error is: : Cannot invoke initializer for type 'UnsafeMutablePointer?>' with an argument list of type '(mutating: [UnsafeMutablePointer])' Have you some ideas? I