1.. _zdsp_api:
2
3Digital Signal Processing (DSP)
4###############################
5
6.. contents::
7    :local:
8    :depth: 2
9
10The DSP API provides an architecture agnostic way for signal processing.
11Currently, the API will work on any architecture but will likely not be
12optimized. The status of the various architectures can be found below:
13
14============ =============
15Architecture Status
16============ =============
17ARC          Optimized
18ARM          Optimized
19ARM64        Optimized
20MIPS         Unoptimized
21NIOS2        Unoptimized
22POSIX        Unoptimized
23RISCV        Unoptimized
24RISCV64      Unoptimized
25SPARC        Unoptimized
26X86          Unoptimized
27XTENSA       Unoptimized
28============ =============
29
30Using zDSP
31**********
32
33zDSP provides various backend options which are selected automatically for the
34application. By default, including the CMSIS module will enable all
35architectures to use the zDSP APIs. This can be done by setting::
36
37	CONFIG_CMSIS_DSP=y
38
39If your application requires some additional customization, it's possible to
40enable :kconfig:option:`CONFIG_DSP_BACKEND_CUSTOM` which means that the
41application is responsible for providing the implementation of the zDSP
42library.
43
44Optimizing for your architecture
45********************************
46
47If your architecture is showing as ``Unoptimized``, it's possible to add a new
48zDSP backend to better support it. To do that, a new Kconfig option should be
49added to :file:`subsys/dsp/Kconfig` along with the required dependencies and the
50``default`` set for ``DSP_BACKEND`` Kconfig choice.
51
52Next, the implementation should be added at ``subsys/dsp/<backend>/`` and
53linked in at :file:`subsys/dsp/CMakeLists.txt`. To add architecture-specific attributes,
54its corresponding Kconfig option should be added to :file:`subsys/dsp/Kconfig` and use
55them to update ``DSP_DATA`` and ``DSP_STATIC_DATA`` in :file:`include/zephyr/dsp/dsp.h`.
56
57API Reference
58*************
59
60.. doxygengroup:: math_dsp
61
62.. _subsys/dsp/Kconfig: https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/dsp/Kconfig
63.. _subsys/dsp/CMakeLists.txt: https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/dsp/CMakeLists.txt
64.. _include/zephyr/dsp/dsp.h: https://github.com/zephyrproject-rtos/zephyr/blob/main/include/zephyr/dsp/dsp.h
65