Accelerate vDSP FFT resulting in NaN under demanding scenario -
i'm using vdsp framework real-time audio application based on fft computation.
after having lots of problems trying figure out why algorithm producing incorrect results, found out following comment on official vdsp fft code (demonstratefft.c, lines 242, 416, 548)
/* 0 signal before timing because repeated ffts on non-zero data can cause abnormalities such infinities, nans, , subnormal numbers. */
in order reproduce error, comment line 247 (no 0 signal) , add similar following line @ line 273 (just after vdsp_fft_zrip method)
if (isnan(observed.realp[0])) printf("iteration %lu: nan\n",i); // work of components of observed
it interesting observe reducing n (i.e. increasing amount of ffts per time unit) makes zrip algorithm fail before, kinds of makes sense since comment advices performing repeated ffts.
the behavior observed vdsp_fft_zrop algorithm.
i'm wondering what's point performing ffts of "zero data" advised on comment. either i'm missing important, or vdsp framework not suited @ real-time audio processing.
normal 16 , 24-bit "real time" audio samples not see issue.
but benchmarks can create bigger , smaller numbers can exceed range of double precision floats when iterated enough times, , when using many functions, not ffts. try iterating exp() fed itself, blow faster. it's problem 1 encounters using finite precision computer arithmetic (not arm , x86 cpus vdsp uses).
Comments
Post a Comment