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

Thread: Teensy 4.0 for Noise & Echo Cancellation Capstone Project

  1. #1
    Junior Member
    Join Date
    Jan 2020
    Posts
    5

    Teensy 4.0 for Noise & Echo Cancellation Capstone Project

    Our team of 4 EEE majors at Arizona State University are working with the Teensy 4.0, with two electret condenser microphones with LM386 amplifiers to line-inputs of the Audio Shield Rev D, to build an affordable noise and echo cancellation system. Two of us have a lifetime of experience wearing hearing aids and have been personally annoyed by persistent problems in noisy environments or with feedback when high gain is required. Hearing aids have come a long way in the last 15 years or so but are currently expensive for most wearers. Our current test setup is shown below:

    Click image for larger version. 

Name:	TeensyTest.jpg 
Views:	8 
Size:	275.3 KB 
ID:	18811

    Our team chose the Teensy 4.0 for a variety of reasons and think it has tremendous potential for our project. We have worked through the Audio Tutorial Workshop to get acquainted with the system, with the help of the Audio System Design Tool and Arduino IDE. This has proven to us that the Teensy 4.0 is likely a great choice, but we have work to do! While these tools are extremely helpful for a variety of projects, we have envisioned from the start (since the beginning of last semester) having algorithms developed in MATLAB/Simulink. We are somewhat biased to use these tools since they are seemingly commonplace these days in the EE field and emphasized throughout our educational training. We have not been successful with a variety of approaches we have tried to integrate the Teensy 4.0 with Simulink. So far, it has been a puzzle for which a variety of components are not well understood by our team.

    Right now, we have divided our algorithm-to-hardware integration into 4 parts:

    • Build a custom target in MATLAB from scratch. We are stuck at the activation of deployment features step.
    • Start from embedded coder add-on by testing integration of Arduino Uno first. The add-on was designed for the Leonardo but is said to be adaptable for other Arduino hardware. If we learn the "tricks," progress here may translate to the Teensy 4.0, but we are not sure.
    • Arm compiler & MATLAB integration. This approach disregards the Teensy 4.0 integration with Arduino IDE and will require ArmDS IDE.
    • Implement CMSIS-DSP using Arduino IDE. This approach would likely move away from the modeling done using Simulink and MATLAB, needing to be coded manually using C++ syntax.

    We think that considering each approach will move us forward, but we prefer focusing our efforts if we can prove any option is not viable. We are at the point that we need help. Has someone attempted any of the above for a similar project? Does anyone know if the Teensy 4.0 can be adapted to be coded with Simulink (ideally in real-time with HIL) and which approach sounds most promising? We appreciate any advice you can give. Thanks for reading this and thanks for your time!

  2. #2
    Junior Member
    Join Date
    Jan 2020
    Posts
    5
    The Embedded Coder Target for Arduino package from Mathworks might be the most promising way to integrate a Teensy 4.0 into MATLAB/Simulink with reasonable effort. This package references and links hardware parameters such as the boards.txt and arm compiler toolchains found in Arduino directories; it was designed for the purpose of creating a custom target for an Arduino platform.

    Problem is, this package is now at least a few years old and for students with limited collective experience for completing the integration without a lot of guesswork, it would help tremendously to know if we’re on the right path and whether additional time spent here may be futile. If someone here was in a similar situation and could advise your less experienced selves, what would you do? What would be the best way to go about noise & echo cancellation development for a Teensy 4.0 with Rev D Audio Shield?

  3. #3
    Junior Member
    Join Date
    Jan 2020
    Posts
    5
    To clarify further, my primary question is what would be the best approach to completing our development work for demonstration by May 2020, given our limited expertise and academic access to tools like MATLAB/Simulink? Note that we have working models in Simulink but have not loaded them to hardware. If MATLAB/Simulink integration is a dead-end, would you suggest another/better option? We assume that the Audio System Design Tools and coding in Arduino IDE will do the job, but we also assume that modelling in Simulink will be useful especially if we can translate the code to the Teensy 4.0 in a straightforward manner without breaking it. We don't know the answer, yet.

  4. #4
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,524
    Quote Originally Posted by fgiuliani View Post
    To clarify further, my primary question is what would be the best approach to completing our development work for demonstration by May 2020, given our limited expertise and academic access to tools like MATLAB/Simulink? Note that we have working models in Simulink but have not loaded them to hardware. If MATLAB/Simulink integration is a dead-end, would you suggest another/better option? We assume that the Audio System Design Tools and coding in Arduino IDE will do the job, but we also assume that modelling in Simulink will be useful especially if we can translate the code to the Teensy 4.0 in a straightforward manner without breaking it. We don't know the answer, yet.
    Not sure if Teensy integration into Matlab is already so smooth and robust to follow that road now. But as you have Simulink model working, maybe it is a worthwhile exercise to see if it can be translated with Audio System design tool into Teensy program. If yes, and I'm confident there are some expert on this forum that can help with details and the rest is then a done deal. In how far, all audio functionality is already working with T4.0 or you have to revert to T3.6+Audioboard V3, is another matter.

  5. #5
    Junior Member
    Join Date
    Jan 2020
    Posts
    5
    You are correct, in that our attempts at integration into MATLAB have not been as smooth as we thought it could be at the start of the project. We think that either we are missing critical information that will help, or that our efforts are futile for a project of this size/scope. Unless we discover a pathway that is better, we will fall back to coding in Arduino IDE. As far as reverting to a T3.6, given preliminary testing, we are hopeful that the T4.0 will do the job. Are there good reasons to be suspicious that the T4.0 will work?

  6. #6
    Senior Member
    Join Date
    Jul 2014
    Posts
    2,524
    Quote Originally Posted by fgiuliani View Post
    Are there good reasons to be suspicious that the T4.0 will work?
    If you wanted to have USB-Audio in your system, then You may have to wait until Paul finds time to implement it on T4.0 (It seems to require different implementation than done for Teensy3)

  7. #7
    Junior Member
    Join Date
    Jan 2020
    Posts
    5
    That would be another great feature of the T4.0, but I don't think it's necessary for our project. We're planning to utilize the 3.5 mm stereo audio jack and line inputs of the Audio Shield Rev D.

Posting Permissions

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