Deploy Smart Speaker Simulink® Model with Speech Command Recognition AI to Qualcomm® Hexagon™ NPU
This example shows you how to deploy a Simulink® model designed as smart speaker system on Hexagon eNPU using Embedded Coder® Support Package for Hexagon Processors.
This Simulink model comprises two main parts:
- An audio input path, representing microphone processing. This path has preprocessing followed by the speech command recognizer.
- An audio output path, representing loudspeaker output processing. This path has preprocessing for audio playback stream and applies an action to the playback.
Objective
Through the MathWorks and Qualcomm Technologiescollaboration, we seek to lower the barrier of entry to Qualcomm® hardware with a hardware support package. This support package allows those with no prior knowledge of Qualcomm hardware to build optimized C code and deploy it to the Hexagon NPU from Simulink.
To demonstrate this increase ease of use we developed this example that helps customers install, set up, and deploy AI to the Hexagon NPU or simulator. With is example, we hope to help companies large and small accelerate their time to market and simplify deployment to Hexagon hardware.
Materials Required / Parts List / Tools
MATLAB R25a or newer |
https://www.mathworks.com/company/aboutus/contact_us/req_quote.html?s_eid=QCprojectpage |
Simulink |
https://www.mathworks.com/company/aboutus/contact_us/req_quote.html?s_eid=QCprojectpage |
Embedded Coder |
https://www.mathworks.com/company/aboutus/contact_us/req_quote.html?s_eid=QCprojectpage |
MATLAB Coder |
https://www.mathworks.com/company/aboutus/contact_us/req_quote.html?s_eid=QCprojectpage |
Embedded Coder Support Package for Hexagon NPU Download Link |
https://www.mathworks.com/hardware-support/qualcomm-hexagon.html?s_eid=QCprojectpage |
Audio Toolbox |
https://www.mathworks.com/company/aboutus/contact_us/req_quote.html?s_eid=QCprojectpage |
Hexagon NPU |
Any Qualcomm board supplier |
Qualcomm® SDK |
Qualcomm Package Manager |
LPAI Addon |
Qualcomm Package Manager |
Source Code / Source Examples / Application Executable
Deploy Smart Speaker Model on Hexagon NPU Example Page |
https://www.mathworks.com/help/ecoder/qualcommhexagon/ug/deploy-smart-speaker-model-qualcomm-hexagon-dsp.html?s_eid=QCprojectpage |
Additional Resources
Hexagon Support Package Installation and Setup Guide |
https://www.mathworks.com/help/ecoder/qualcomm-setup-and-configuration.html?s_eid=QCprojectpage |
Build / Assembly Instructions
Sample outline:
- Download Qualcomm® Package Manager
- Download supported Hexagon SDK
- Download supported LPAI SDK Addon
- Download Android Debug Bridge if using hardware
- Download the Embedded Coder® Support Package for Hexagon Processors
Project Walkthrough
Sample outline:
openExample('qualcommhexagon/DeploySmartSpeakerModelOnQualcommHexagonDSPExample')open_system('SmartSpeakerHexagon');sim('SmartSpeakerHexagon',SimulationMode='normal');4. Configure Model for Optimized Code Generation
You can configure the model using either the Interactive Approach (Configuration Parameters in Simulink) or the Programmatic Approach (MATLAB programming interface). We will describe the interactive approach here.
Interactive Approach
To set the HVX ISE, under Code Generation > Interface > Optimization, select HVX for Leverage target hardware instruction set extensions parameter. Also, select the parameters Optimize reductions and FMA (Fused Multiply Add) to include the specific SIMD instructions.
5. Generate Code
You can now use the model to run the Smart Speaker model on the target.
Press Ctrl+B or go to Embedded Coder App and click Build.
6. To perform numerical accuracy verification of the generated code against the simulation output, use the SIL/PIL Manager App.
Go to SIL/PIL Manager, Set Mode to Automated Verification, Set the SIL/PIL Mode to Processor-in-loop (PIL), Click Run Verification.
Usage Instructions
Sample outline:
- Install and set up hardware support package
- Open pre-built Simulink model
- Configure Simulink model for hardware deployment or simulator deployment
- Generate C code
- Verify performance on target using Software-in-the-Loop or Processor-in-the-Loop Manager
- Compare software vs hardware deployment performance
Contributor(s) Info
Name |
Title Company |
Reed Axman
|
Senior Partner Business Manager |
