B4R Question Converting "C" FFT to B4R

canalrun

Well-Known Member
Licensed User
Longtime User
I have fixed point, uses sin coefficient lookup table, FFT source code written in C that I am converting to B4R.

The nice thing about this implementation is that it is Fast. Not nice is that it uses tricks that take advantage of the current "state of the art" 16 bit register size - it was written in 1989.

Within innermost loops it uses "a >> 1" several places. This could be translated as bit.ShiftRight(a, 1) or a/2. Is the shift or divide better (faster)? Or, are they the same?

Are all Arduino-type MCUs 32 bit? Or, are some 16 bit?

I'm fairly certain I saw that my WeMos was 32 bit.

Thanks,
Barry.
 

kolbe

Active Member
Licensed User
Longtime User
If I could interject... The >> is 32 bit (works with longs) where as bit.ShiftRitght is only 16 bit (only Uint). I've had to use inline code for this reason before.
 
Last edited:
Upvote 0
Top