B4R Question Converting "C" FFT to B4R

Discussion in 'B4R Questions' started by canalrun, Feb 11, 2019.

  1. canalrun

    canalrun Well-Known Member Licensed 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.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    canalrun likes this.
  3. kolbe

    kolbe Active Member Licensed 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: Feb 12, 2019
    canalrun likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice