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
1. Install CML library with instructions at the top of [```octave/ldpc.m```](octave/ldpc.m)
127
-
128
126
1. To build and run the tests:
129
127
```
130
128
cd ~/codec2
131
129
rm -Rf build_linux && mkdir build_linux
132
130
cd build_linux
133
-
cmake -DCMAKE_BUILD_TYPE=Debug ..
134
-
make all test
131
+
cmake -DUNITTEST=1 ..
132
+
make
135
133
```
136
134
137
135
1. To just run tests without rebuilding:
@@ -154,6 +152,13 @@ CTest is used as a test framework, with support from [GNU Octave](https://www.gn
154
152
ctest -N
155
153
```
156
154
155
+
1. Many Octave scripts rely on the CML LDPC library. To run these from the Octave CLI, you need to set
156
+
the `CML_PATH` environment variable. A convenient way to do this is using a `.octaverc` file
157
+
in your `codec/octave` directory. For example on a Linux machine, create a `.octaverc` file:
158
+
```
159
+
setenv("CML_PATH","../build_linux/cml")
160
+
```
161
+
157
162
## Directories
158
163
```
159
164
cmake - cmake support files
@@ -236,6 +241,43 @@ Codec 2 can be added to the project in the following way.
236
241
237
242
1. Add Codec 2 to the target_link_libraries in the same file.
238
243
244
+
## Building Codec 2 for Microcontrollers
245
+
246
+
Codec 2 requires a hardware Floating Point Unit (FPU) to run in real time.
247
+
248
+
Two build options have been added to support building on microcontrollers:
249
+
1. Setting the `cmake` variable MICROCONTROLLER_BUILD disables position independent code (-fPIC is not used). This was required for the IMRT1052 used in Teensy 4/4.1).
250
+
251
+
1. On ARM machines, setting the C Flag \_\_EMBEDDED\_\_ and linking with the ARM CMSIS library will improve performance on ARM-based microcontrollers. \_\_REAL\_\_ and FDV\_ARM\_MATH are additional ARM-specific options that can be set to improve performance if required, especially with OFDM modes.
252
+
253
+
A CMakeLists.txt example for a microcontroller is below:
Try adjusting `--clip` and third argument of `cohpsk_ch` (noise level) for different modes. Note the SNR estimates returned from `freedv_data_raw_rx` compared to the SNR from the channel simulator `cohpsh_ch`. You will notice clipping also increases the RMS power and reduces the PER for a given noise level.
Copy file name to clipboardExpand all lines: README_freedv.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,6 +34,8 @@ The current demo programs are as follows:
34
34
|[freedv_700d_rx.py](demo/freedv_700d_rx.py)| Receive a voice signal using the FreeDV API in Python |
35
35
|[freedv_datac1_tx.c](demo/freedv_datac1_tx.c)| Transmit raw data frames using the FreeDV API |
36
36
|[freedv_datac1_rx.c](demo/freedv_datac1_rx.c)| Receive raw data frames using the FreeDV API |
37
+
|[freedv_datac0c1_tx.c](demo/freedv_datac0c1_tx.c)| Transmit two types of raw data frames using the FreeDV API |
38
+
|[freedv_datac0c1_rx.c](demo/freedv_datac0c1_rx.c)| Receive two types of raw data frames using the FreeDV API |
37
39
38
40
So also [freedv_api.h](src/freedv_api.h) and [freedv_api.c](src/freedv_api.c) for the full list of API functions. Only a small set of these functions are needed for basic FreeDV use, please see the demo programs for minimal examples.
Adjust `--clip [0|1]` and 3rd argument of `cohpsk_ch` to obtain a PER of just less than 0.1, and note the SNR and PAPR reported by `cohpsk_ch`. The use of the `ve9qrp` samples makes the test run for a few minutes, in order to get reasonable multipath channel results.
0 commit comments