Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Guidance on how to implement an fft using renderscript

I am looking into using Renderscript to perform an FFT on a large complex input array. The FFT is fairly standard in that it involves three loops, but with the inner loop performing the arithmetic for the butterflys in the FFT. Because each butterfly uses different sections of the array, there isn't an obvious easy method for partitioning the elements in the input allocation.

So, my two questions are:

  1. Does it make sense to put the whole FFT algorithm into a Renderscript with the input allocation being individual elements of the array?
  2. If the answer to (1) is no, what is the best way to partition the elements, i.e. should I perform some pre-processing outside of renderscript to create array elements that are in essence the individual elements of a butterfly.

I have working code in C, but have not yet started to implement the renderscript version, so do not have any code to post as yet.

Thanks in advance for any help.

like image 911
AJR Avatar asked Nov 01 '22 04:11

AJR


1 Answers

  1. Yes it's a programming language and if you need to go faster doing a critical section in renderscript is an acceptable thing to do. See example here:

https://github.com/nesl/renderScriptFFT

2) NA, processing the data in renderscript will almost always be faster, even if you have to go in order and don't need to do the various things at the same time you still escape the array size checks.

like image 188
Tatarize Avatar answered Nov 04 '22 06:11

Tatarize