Skip to content

Commit 5a44936

Browse files
rangulisilseva
authored andcommitted
Update Linux testing instructions to include decimation step for raw samples
1 parent 71f3ac7 commit 5a44936

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

4.8 KB
Loading

linux.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,42 @@ The `tests/unit/assets` directory contains the following baseband recordings:
1919
| `M17_test_baseband.raw` | Runtime demodulation; src callsign only |
2020
| `M17_test_baseband_dc.raw` | Runtime demodulation; src callsign only |
2121

22+
**Note:** These test samples have a sample rate of 48kHz, and must be decimated to 24kHz before they can be demodulated with OpenRTX on Linux. See [below](#decimation) for details.
2223

2324
### Demodulating a raw baseband file with OpenRTX Linux
2425

25-
The Linux build uses a file source driver that reads, on loop, a raw 16-bit, little-endian, mono, 24 kHz file from `/tmp/baseband.raw`. Simply place the sample file in this location and launch the application in order for it to demodulate. Note that since the linux build has no audio driver, it is not expected that received audio can be heard.
26+
The Linux build uses a file source driver that reads, on loop, a raw 16-bit, little-endian, mono, 24 kHz file from `/tmp/baseband.raw`.
27+
28+
#### Decimation
29+
30+
The OpenRTX M17 modulator works at a sample rate of 48 kHz, but the demodulator works at a sample rate of 24 kHz. Because the sample baseband files have a sample rate of 48 kHz, they must be decimated to 24 kHz first in order to be demodulated. This can be done easily using the `sox` audio utility, available in most packagers. To decimate a sample baseband file, run:
31+
32+
```bash
33+
# Convert the sample baseband recording from 48 kHz to 24 kHz
34+
sox -r 48000 -e signed-integer -b 16 -c 1 tests/unit/assets/M17_test_baseband.raw \
35+
-r 24000 -e signed-integer -b 16 -c 1 M17_test_baseband_24k.raw \
36+
rate -v
37+
```
38+
39+
Simply move the decimated file to `/tmp/baseband.raw` and launch the application in order for it to demodulate. Alternatively, you can set the output file path in `sox` to `/tmp/baseband.raw` directly and skip the copy step.
2640

2741
```bash
2842
# Copy the sample to the path the file-source driver reads from:
29-
cp tests/unit/assets/M17_test_baseband.raw /tmp/baseband.raw
43+
cp M17_test_baseband_24k.raw /tmp/baseband.raw
44+
3045
# Build
3146
meson setup build_linux
3247
meson compile -C build_linux openrtx_linux
48+
3349
# Launch
3450
./build_linux/openrtx_linux
3551
```
3652

37-
In this example, a receive screen with callsign OPNRTX is expected.
53+
In this example, a receive screen with callsign OPNRTX is expected:
54+
55+
![Example demodulation](../_media/linux_emulator_baseband_demod.png)
56+
57+
**Note:** Since the Linux build has no audio driver, it is not expected that received audio can be heard.
3858

3959
### Going Further
4060

0 commit comments

Comments
 (0)