- minimize RAM usage of all components - use both IRAM and DRAM in player component so we can buffer up to 1s on modules without SPI RAM - support fragemented pcm chunks so we can use all available RAM if there isn't a big enough block available but still enough HEAP - reinclude all components from jorgen's master branch - add custom i2s driver to get a precise timing of initial sync - change wrong usage of esp_timer for latency measurement of snapcast protocol - add player component
51 lines
1.5 KiB
Markdown
51 lines
1.5 KiB
Markdown
# Dot Product Calculation Example
|
|
|
|
(See the README.md file in the upper level 'examples' directory for more information about examples.)
|
|
|
|
This example demonstrates how to use dotprod dsps_dotprod_f32 from esp-dsp library. Example does the following steps:
|
|
|
|
1. Initialize the input arrays
|
|
2. Calculate dot product of two arrays
|
|
3. Compare results and calculate execution time in cycles.
|
|
|
|
## How to use example
|
|
|
|
### Hardware required
|
|
|
|
This example does not require any special hardware, and can be run on any common development board.
|
|
|
|
### Configure the project
|
|
|
|
If using Make based build system, run `make menuconfig` and set serial port under Serial Flasher Options.
|
|
If using CMake based build system, no configuration is required.
|
|
Also, under Component Config/DSP Library/Optimization for ESP32, it's possible to select optimized or ansi implementation to compare.
|
|
|
|
### Build and flash
|
|
|
|
Build the project and flash it to the board, then run monitor tool to view serial output:
|
|
|
|
```
|
|
make -j4 flash monitor
|
|
```
|
|
|
|
Or, for CMake based build system (replace PORT with serial port name):
|
|
|
|
```
|
|
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.
|
|
|
|
## Example output
|
|
|
|
Here is an typical example console output.
|
|
|
|
```
|
|
I (55) main: Start Example.
|
|
I (55) main: The sum of 101 elements from 0..100 = 5050.000000
|
|
I (55) main: Operation for 101 samples took 1381 cycles
|
|
I (65) main: End Example.
|
|
```
|