Skip to content

Commit e96c320

Browse files
authored
Merge pull request #3111 from madeline-underwood/cmsip
Enhance documentation for CMSIS-DSP Python learning path with improve…
2 parents d251033 + d6ff313 commit e96c320

5 files changed

Lines changed: 11 additions & 9 deletions

File tree

content/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/_index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
title: Getting started with CMSIS-DSP using Python
33

4+
description: Learn how to prototype and port DSP algorithms using the CMSIS-DSP Python package, mapping Python code to efficient C implementations for embedded Cortex-M and Cortex-A platforms.
5+
46
minutes_to_complete: 45
57

68
who_is_this_for: This is an advanced topic for developers looking to integrate the CMSIS-DSP library into their applications using Python.

content/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/how-to-3.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ slices = sliding_window_view(data,winLength)[::winOverlap,:]
7979
slices_q15 = sliding_window_view(dataQ15,winLength)[::winOverlap,:]
8080
```
8181

82-
Refer to the [NumPy documentation](https://numpy.org/doc/stable/reference/generated/numpy.lib.stride_tricks.sliding_window_view.html) for details about `sliding_window_view`. It's not the most efficient function, but it is sufficient for this tutorial. The signal is split into overlapping blocks: each block reuses half of the samples from the previous block as defined by the `winOverlap` variable.
82+
Refer to the [NumPy documentation](https://numpy.org/doc/stable/reference/generated/numpy.lib.stride_tricks.sliding_window_view.html) for details about `sliding_window_view`. It's not the most efficient function, but it's sufficient for this tutorial. The signal is split into overlapping blocks: each block reuses half of the samples from the previous block as defined by the `winOverlap` variable.
8383

8484
By running that last block, you have an audio signal that has been split into overlapping blocks.
8585

content/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/how-to-5.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ layout: learningpathall
88

99
## Understand the mathematics behind noise suppression
1010

11-
In this section, you will learn about the mathematics that serves as a basis for the use case. Then, you will use those principles to create a reference implementation using NumPy.
11+
In this section, you'll learn about the mathematics that serves as a basis for the use case. Then, you'll use those principles to create a reference implementation using NumPy.
1212

1313
### Overlapping windows
1414

15-
The blocks of audio samples you created in the previous steps will be multiplied by a Hanning window function, which you will achieve by running the following in the Jupyter notebook:
15+
The blocks of audio samples you created in the previous steps will be multiplied by a Hanning window function, which you'll achieve by running the following in the Jupyter notebook:
1616

1717
```python
1818
window=dsp.arm_hanning_f32(winLength)
@@ -148,7 +148,7 @@ The constructor for `NoiseSuppressionReference`:
148148

149149
#### Subnoise
150150

151-
Calculates the approximate Wiener gain and it is applied to all frequency bands of the FFT. The `v` argument is a vector. If the gain is negative, it is set to 0. A small value is added to the energy to avoid division by zero.
151+
Calculates the approximate Wiener gain and it's applied to all frequency bands of the FFT. The `v` argument is a vector. If the gain is negative, it's set to 0. A small value is added to the energy to avoid division by zero.
152152

153153
```python
154154
def subnoise(self,v):

content/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/how-to-7.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ layout: learningpathall
88

99
## Converting functions
1010

11-
Now that your Python prototype is verified, it's time to translate the key functions into C using the CMSIS-DSP library. Because the CMSIS-DSP Python API closely mirrors the C API, the conversion is generally straightforward. In this section, you will have a look at two examples to understand how the conversion works.
11+
Now that your Python prototype is verified, it's time to translate the key functions into C using the CMSIS-DSP library. Because the CMSIS-DSP Python API closely mirrors the C API, the conversion is generally straightforward. In this section, you'll have a look at two examples to understand how the conversion works.
1212

1313
### Rescaling
1414

@@ -108,7 +108,7 @@ int16_t signal_energy_q15(q15_t *window,uint32_t nb)
108108
// Fixed point format of result is on 16 bit
109109
// but the specific format has not been identified
110110
// to make this tutorial easier.
111-
// We just know it is not q15
111+
// We just know it's not q15
112112
int16_t dB;
113113

114114
arm_vlog_q15(&energy,&dB,1);
@@ -119,4 +119,4 @@ int16_t signal_energy_q15(q15_t *window,uint32_t nb)
119119
120120
As you can see, a DSP function written in Python using the CMSIS-DSP Python wrappers can be directly mapped to a very similar C function with only minor adjustments. This makes it easy to prototype quickly in Python and then migrate to efficient, production-ready C code for embedded platforms.
121121
122-
In the final section, you will explore some additional resources to learn more and start using CMSIS-DSP in your applications.
122+
In the final section, you'll explore some additional resources to learn more and start using CMSIS-DSP in your applications.

content/learning-paths/embedded-and-microcontrollers/cmsisdsp-dev-with-python/how-to-8.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ While the CMSIS-DSP Python package makes prototyping and conversion to C relativ
2121

2222
- Part of the difficulty in this Learning Path comes from splitting and recombining the signal. Porting the block-handling logic from Python to C introduces additional complexity.
2323

24-
[CMSIS-Stream](https://github.com/ARM-software/CMSIS-Stream) can help with this. It is a platform-independent technology designed to simplify the use of block-processing functions with sample streams.
24+
[CMSIS-Stream](https://github.com/ARM-software/CMSIS-Stream) can help with this. It's a platform-independent technology designed to simplify the use of block-processing functions with sample streams.
2525

26-
If you are planning to deploy your DSP algorithms in streaming, real-time systems, it is worth exploring CMSIS-Stream. It can greatly simplify handling streams of data with block-based processing, offering a clean and efficient way to bridge the gap between theory and deployment.
26+
If you're planning to deploy your DSP algorithms in streaming, real-time systems, it's worth exploring CMSIS-Stream. It can greatly simplify handling streams of data with block-based processing, offering a clean and efficient way to bridge the gap between theory and deployment.
2727

2828
You should now have a better idea of what the CMSIS-DSP Python package is capable of, and how it relates to its C equivalent.

0 commit comments

Comments
 (0)