kissfft icon indicating copy to clipboard operation
kissfft copied to clipboard

About implementation in swift

Open muga87 opened this issue 4 years ago • 0 comments

Hi there, I need to calculate fft in my iOS project using byte array which from sound record. I can able to integrate kissfft in my project. As per documentation to calculate fft, I have used like this.

for init 
let kissFT = kiss_fft_alloc(Int32(sampleRate), 0, nil,nil)
for calculating cpx_in and cpx_out I have tried like this, but I could not ale to find the method
 let cpx_in = kiss_fft_cpx(r: <#T##Float#>, i: <#T##Float#>)

Here I have to pass ‘r’ and ‘i’ values. But I am not understanding what values I have to pass. Can you please help me.

Where in android I am using like this using DoubleFFt_1D java class.

DoubleFFT_1D fft_1d = new DoubleFFT_1D(windowSize); double[] rowFFT = new double[2 * windowSize];   for (int win = 0; win < windowSize; win++) { rowFFT[win * 2] = sample[win + time * (windowSize - overlap)] * windowing[win]; rowFFT[win * 2 + 1] = 0; }

muga87 avatar Jul 06 '21 09:07 muga87