(See the README.md file in the upper level 'examples' directory for more information about examples.)
This example demonstrates how to use basic math functions from esp-dsp library. Example does the following steps:
This example does not require any special hardware, and can be run on any common development board.
Under Component Config ---> DSP Library ---> DSP Optimization, it's possible to choose either the optimized or ANSI implementation, to compare them.
Build the project and flash it to the board, then run monitor tool to view serial output (replace PORT with serial port name):
Plaintext
idf.py -p PORT flash monitor
(To exit the serial monitor, type Ctrl-]
.)
See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.
Here is an typical example console output.
Bash
I (132) main: *** Start Example. ***
I (132) main: *** Multiply tone signal with Hann window by standard C loop. ***
I (152) view: Data min[432] = -173.749878, Data max[205] = 23.849705
________________________________________________________________
0 | |
1 | |
2 | |
3 || |
4 | | |
5 || | |
6 ||| || |
7 ||||| |||| |
8||||||||||||||| |||||| |
9 |||||||||||||||||||||||||
0123456789012345678901234567890123456789012345678901234567890123
I (162) view: Plot: Length=512, min=-120.000000, max=40.000000
I (162) main: *** Multiply tone signal with Hann window by esp-dsp basic math functions. ***
I (162) view: Data min[432] = -173.749878, Data max[205] = 23.849705
________________________________________________________________
0 | |
1 | |
2 | |
3 || |
4 | | |
5 || | |
6 ||| || |
7 ||||| |||| |
8||||||||||||||| |||||| |
9 |||||||||||||||||||||||||
0123456789012345678901234567890123456789012345678901234567890123
I (172) view: Plot: Length=512, min=-120.000000, max=40.000000
I (172) main: *** End Example. ***
To create a project from this example, run:
idf.py create-project-from-example "espressif/esp-dsp=1.4.4:basic_math"