You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-20Lines changed: 3 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,28 +16,11 @@ We have some zephyr rtos projects under zephyr_projects. To build/develop them y
16
16
### Arduino
17
17
We have some arduino projects, under arduino_firmware.
18
18
19
-
### common libraries
20
-
Under common_libs/ we have our common libraries. These should be hardware agnostic, modular and testable.
19
+
### Common Libraries
20
+
Under common_libraries/ we have our common libraries. These should be hardware agnostic, modular and testable.
21
21
We have an example here, that shows the general workflow for creating a common library module, including Catch2 testing.
22
22
23
-
#### Low Pass FIR Filter
24
-
This is an FIR filter that can be used on any unsigned 32-bit integers. You can specify the order (AKA. the number of previous data points the algorithm considers) when creating an instance of LowPassFIRFilter (default order of 1). The following example filters incoming data with an order of 1:
25
-
```cpp
26
-
#include<low_pass_fir_filter.hpp>
27
-
28
-
LowPassFIRFilter filter;
29
-
30
-
voidprocess_incoming_data(unsigned int input) {
31
-
unsigned int filtered_input = filter.update(input);
32
-
send_filtered_data_to_arm(filtered_input);
33
-
}
34
-
```
35
-
36
-
1. Constructor: defaults to order of 1
37
-
2. Buffer: used to store previous data points
38
-
3. Update function:
39
-
- Fills the entire buffer with the first input to simplify the algorithm (otherwise cases for when the buffer is not full yet have to be handled differently).
40
-
- Uses sliding window to calculate the average of the correct set of data points.
23
+
1.[Low pass FIR filter](common_libraries/low_pass_fir_filter/README.md)
41
24
42
25
### Testing
43
26
We use Catch2 for testing cpp and c code. It's an easy to use, and easy to integrate tool for cpp unit tests.
This is an FIR filter that can be used on any unsigned 32-bit integers. You can specify the order (AKA. the number of previous data points the algorithm considers) when creating an instance of LowPassFIRFilter (default order of 1). The following example filters incoming data with an order of 1:
3
+
```cpp
4
+
#include<low_pass_fir_filter.hpp>
5
+
6
+
LowPassFIRFilter filter;
7
+
8
+
voidprocess_incoming_data(unsigned int input) {
9
+
unsigned int filtered_input = filter.update(input);
10
+
send_filtered_data_to_arm(filtered_input);
11
+
}
12
+
```
13
+
14
+
1. Constructor: defaults to order of 1
15
+
2. Buffer: used to store previous data points
16
+
3. Update function:
17
+
- Fills the entire buffer with the first input to simplify the algorithm (otherwise cases for when the buffer is not full yet have to be handled differently).
18
+
- Uses sliding window to calculate the average of the correct set of data points.
0 commit comments