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

Thread: CMSIS 5.3.0 and CMSIS_DSP 1.7.0 on teensy 4

  1. #1
    Junior Member
    Join Date
    Oct 2019

    CMSIS 5.3.0 and CMSIS_DSP 1.7.0 on teensy 4

    Hi everyone,
    First, thanks to Paul for his work on teensy!

    So, i just get a teensy 4 and try to do experiment with fft.
    I saw than it was possible to do 4096 point fft with the CMSIS_DSP 1.7.0

    Did someone manage to use it with the teensy 4?


  2. #2
    Senior Member DD4WH's Avatar
    Join Date
    Oct 2015
    Central Europe
    Yes, you can find an example here:

    It uses a forward 4096-point-FFT, a complex-multiply with a filter mask and an inverse 4096-point-FFT to filter realtime audio (Fast Convolution Filtering).

    The processor load is about 2.7% on the T4.

    P.S.: I just realized that the DSP version used in the latest Teensyduino is V.1.5.1, NOT 1.7.0

  3. #3
    Junior Member
    Join Date
    Oct 2019
    Hey, Thanks DD4WH!!
    I didn't notice it was this version on teensy 4.
    So i have an other question, (because it was my main goal to do this):
    I try to run the rfft to have just real number, but can't figure out how to do this. When i try this code( i found on the forum, and who is supposed to work), it don't do the Rfft( don't print "q15 real done"), but if i comment the rfft line, the cfft work (print Serial.println "q15 complex done").
    may i have any clues to make it work?

    here is the code
    #include "arm_math.h"
    #define forward    0
    #define bitReverse 1
    #define fftLength  1024
    arm_rfft_instance_q15 rfft_inst;
    arm_cfft_radix4_instance_q15 cfft_inst;
    int16_t rdata[fftLength], rfft_buffer[fftLength];
    int16_t cdata[2*fftLength];
    void setup() {
      arm_rfft_init_q15(&rfft_inst,fftLength, forward, bitReverse);
      arm_cfft_radix4_init_q15(&cfft_inst, fftLength, forward, bitReverse);
    Serial.println("init done");
    void loop() {
      for (int i=0; i<fftLength; i++) {
       rdata[i]     = (int16_t)(20000 + 4096*cos(2*3.1415926*i/16) + 6788*sin(2*3.1415926*i/4));  // real
       cdata[2*i]   = (int16_t)(20000 + 4096*cos(2*3.1415926*i/16) + 6788*sin(2*3.1415926*i/4));  // complex
       cdata[2*i+1] = 0;
      Serial.println("wave generated");
      uint32_t t0 = micros();
      arm_rfft_q15(&rfft_inst, rdata, rfft_buffer);
      Serial.println("q15 real done");
      Serial.print(micros() - t0);
      t0 = micros();
      arm_cfft_radix4_q15(&cfft_inst, cdata);
      Serial.println("q15 complex done");
      Serial.print("\t"); Serial.println(micros() - t0);

Tags for this Thread

Posting Permissions

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