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

Thread: RNNoise porting to Teensy

  1. #1
    Junior Member
    Join Date
    Jul 2019
    Posts
    3

    RNNoise porting to Teensy

    I searched the forum and could not find any references to the open source RNNoise library and was wondering if anyone has attempted to port it to a Teensy. RNNoise is a trainable, "light weight" neural network for noise reduction from the Xiph Foundation (maintainers of Vorbis, FLAC, Speex and Opus codecs) that runs well on a Rasberry Pi with a sampling rate of 48kHz. The demos on the project page are impressive and it uses floating point C code. My coding skills are not quite there yet to tackle porting this to a Teensy 3.6, but I'm curious what you think. The C code is released under a BSD license and the sampling rate should be adjustable to fit in with the Teensy Audio Library.

    DD4WH has done a lot of great work already with the spectral noise reduction mode for the Convolution SDR project. If RNNoise can work on a Teensy it would be another useful code base for embedded noise reduction applications.
    Last edited by clockwork; 07-18-2019 at 07:12 AM.

  2. #2
    There is a lot of development motion right now in Tensorflow Lite for Microcontrollers with both Sparkfun and Adafruit releasing hardware targets for the framework.

    I recently looked into this because I'd love to make physical eurorack versions of the Magenta Studio Tools. Unfortunately there does not seem to be support for even simple RNN operators, let along GRU, or LSTM needed for an algo like RNNoise, or PerformanceRNN

    I am by no means qualified to say this, but if I had to make a guess, I'd say this is due to the memory constraints, after all, it's supposed to run on a microcontroller with kilobytes of RAM. That being said, your best bet will be to follow the development of this framework, as it seems makes good use of the available ARM intrinsics with the cmsis lib, something you'd have to do yourself if you were to try and port RNNoise.

    Independent of the NN implementation, It'd be awesome to see the primitives necessary for a robust signal processing chain to easily extract a cepstrum like MFCC or the Bark(Opus?) scale coefficients for RNNoise integrated in the Audio library similar to the FFT* objects.

  3. #3
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    9,767
    That might be cool - maybe on Pending T4. But even that doesn't have the resources of an rPi

    For Audio on T_3.x's PJRC maintains a customized integer based library utilizing the best features of the ARM core instruction set to provide great general utility with least overhead. Not seen 'noise' come up as a general problem in watching.

  4. #4
    Junior Member
    Join Date
    Jul 2019
    Posts
    3
    You both nailed the memory issue...

    It looks like ARM has released the CMSIS-NN Library which incorporates a lot of optimized NN code for ARM processors including Cortex-M. It appears CMSIS-NN code could be be incorporated into projects to help address excessive memory use:

    Efficient NN kernels are key in enabling inference on Arm Cortex-M based CPUs. CMSIS-NN provides optimized functions to accelerate key NN layers, such as convolution, pooling and activations. In addition, CMSIS-NN also helps to reduce the memory footprint which is key for memory constrained microcontrollers.
    The CMIS-NN library github page has lots of code available

  5. #5
    Junior Member
    Join Date
    Jul 2019
    Posts
    3
    Tensorflow Lite for Microcontrollers looks promising... they claim STM32F103 boards are supported. Even Teensy 3.2 has more RAM than these boards... I'll keep an eye on the framework development

    Quote Originally Posted by recursinging View Post
    it seems makes good use of the available ARM intrinsics with the cmsis lib, something you'd have to do yourself if you were to try and port RNNoise.
    You already mentioned CMSIS-NN, my apologies... I read your post too fast
    Last edited by clockwork; 07-19-2019 at 01:48 AM.

Posting Permissions

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