Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: DSP Instructions

  1. #1

    DSP Instructions

    Hi,

    I'm trying to code a hilbert transform in DSP, to implement a single-signal direct conversion receiver. This seems to be within the realm of the possible on the Teensy 3.2 ... IF I can use DSP instructions (not the pre-built library calls). Are these available? I guess I don't fully understand the development framework for the ARM architecture. I'm trying to relate using the AVR's as an example and something's not clicking.

    Thanks
    Gary Tennyson

  2. #2
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    Not sure about GCC (Arduino) using DSP instructions, or by default, versus other compilers like IAR, Keil.
    If you use floating point, the current Teensy's don't have that ARM feature. Next one will. May not matter to your app.
    Don't most such transforms use a lot of transcendental functions?

    AVR... well, that's a light-year away from ARMs.
    Last edited by stevech; 05-30-2016 at 01:27 AM.

  3. #3
    Senior Member
    Join Date
    Nov 2012
    Posts
    1,155
    Some of the functions in the Audio library use DSP functions. These inline functions are defined in dspinst.h which is in arduino-1.6.9\hardware\teensy\avr\libraries\Audio\utility\ .
    The synth_sine.cpp file in the audio library, for example, uses functions such as multiply_32x32_rshift32_rounded() and multiply_accumulate_32x32_rshift32_rounded(). Each of these is defined in dspinst.h and each usually compiles down to one DSP instruction and all DSP instructions execute in a single cycle.
    There's a PDF document which describes these instructions but, inevitably, I can't find it right now.
    Try this link: http://infocenter.arm.com/help/index.../CIHJJEIH.html
    Select Multiply and Divide Instructions.


    Pete

  4. #4
    Senior Member adrian's Avatar
    Join Date
    Oct 2015
    Location
    Wellington, NZ
    Posts
    504
    I thought an older version of the CMSIS DSP library ran on teensy 3.x ... for example that is where the heavy lifting for the FFT routine originates from in the audio library ...

  5. #5
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,347
    Quote Originally Posted by garytennyson View Post
    Hi,

    I'm trying to code a hilbert transform in DSP, to implement a single-signal direct conversion receiver. This seems to be within the realm of the possible on the Teensy 3.2 ... IF I can use DSP instructions (not the pre-built library calls). Are these available? I guess I don't fully understand the development framework for the ARM architecture. I'm trying to relate using the AVR's as an example and something's not clicking.

    Thanks
    Gary Tennyson
    first question: how do you like to do the Hilbert transform? (FFT or FIR). I would suggest FFT, as it is then trivial, especially if you combine with bandpass filter.

    FFT implementation is build in. However, due to fixed point DSP scaling is somewhat tricky fot FFT-IFFT combo and need some experiments.

    second question: are you happy with 16 bit? then Teensy 3.2 has optimized DSP instructions. If not, depending in your timing requirements T3.2 may be too slow (multi-MHz direct conversion may be too much, but I have not done the Maths)

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,606
    This thread is a perfect example of why you ought to explain your project and goals, rather than just ask a narrow tech question.

    But to answer your specific question "can use DSP instructions.... Are these available?", yes, they are available. This message has more info about how to really use them.

    https://forum.pjrc.com/threads/26767...ll=1#post58616

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •