Skip to content

Commit 5c025e2

Browse files
committed
re-arranged and edited README_freedv.md, added some supporting comments to freedv_api.h and demo programs
1 parent 850ecda commit 5c025e2

File tree

4 files changed

+58
-48
lines changed

4 files changed

+58
-48
lines changed

README_freedv.md

Lines changed: 54 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,41 @@ This document gives an overview of the technology inside FreeDV, and some additi
1010

1111
![FreeDV mode knob](http://www.rowetel.com/images/codec2/mode_dv.jpg)
1212

13-
## Reading Further
13+
## FreeDV API
1414

15-
1. [FreeDV web site](http://freedv.org)
16-
1. [FreeDV GUI User Manual](https://github.com/drowe67/freedv-gui/blob/master/USER_MANUAL.md)
17-
1. [Codec 2](http://rowetel.com/codec2.html)
18-
1. FreeDV can also be used for data [README_data](https://github.com/drowe67/codec2/blob/master/README_data.md)
19-
1. [FreeDV 1600 specification](https://freedv.org/freedv-specification)
20-
1. [FreeDV 700C blog post](http://www.rowetel.com/wordpress/?p=5456)
21-
1. [FreeDV 700D Released blog post](http://www.rowetel.com/wordpress/?p=6103)
22-
1. [FreeDV 2020 blog post](http://www.rowetel.com/wordpress/?p=6747)
23-
1. [FreeDV 2400A blog post](http://www.rowetel.com/?p=5119)
24-
1. [FreeDV 2400A & 2400B](http://www.rowetel.com/?p=5219)
25-
1. Technical information on various modem waveforms in the [modem codec frame design spreadsheet](https://github.com/drowe67/codec2/blob/master/doc/modem_codec_frame_design.ods)
26-
1. [Modems for HF Digital Voice Part 1](http://www.rowetel.com/wordpress/?p=5420)
27-
1. [Modems for HF Digital Voice Part 2](http://www.rowetel.com/wordpress/?p=5448)
28-
1. [FDMDV modem README](README_fdmdv.md)
29-
1. [OFDM modem README](README_ofdm.md)
30-
1. Many blog posts in the [rowetel.com blog archives](http://www.rowetel.com/?page_id=6172)
15+
The general programming model is:
16+
```
17+
speech samples -> FreeDV encode -> modulated samples (send over radio) -> FreeDV decode -> speech samples
18+
```
19+
20+
The `codec2/demo` directory provides simple FreeDV API demo programs written in C and Python to help you get started, for example:
21+
22+
```
23+
cd codec2/build_linux
24+
cat ../raw/ve9qrp_10s.raw | ./demo/freedv_700d_tx | ./demo/freedv_700d_rx | aplay -f S16_LE
25+
```
26+
27+
The current demo programs are as follows:
28+
29+
| Program | Description |
30+
| --- | --- |
31+
| [c2demo.c](demo/c2demo.c) | Encode and decode speech with Codec 2 |
32+
| [freedv_700d_tx.c](demo/freedv_700d_tx.c) | Transmit a voice signal using the FreeDV API |
33+
| [freedv_700d_rx.c](demo/freedv_700d_rx.c) | Receive a voice signal using the FreeDV API |
34+
| [freedv_700d_rx.py](demo/freedv_700d_rx.py) | Receive a voice signal using the FreeDV API in Python |
35+
| [freedv_datac1_tx.c](demo/freedv_datac1_tx.c) | Transmit raw data frames using the FreeDV API |
36+
| [freedv_datac1_rx.c](demo/freedv_datac1_rx.c) | Receive raw data frames using the FreeDV API |
37+
38+
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.
39+
40+
The full featured command line demo programs [freedv_tx.c](src/freedv_tx.c) & [freedv_rx.c](src/freedv_rx.c) demonstrate many features of the API:
41+
42+
```
43+
$ ./freedv_tx 1600 ../../raw/hts1.raw - | ./freedv_rx 1600 - - | aplay -f S16_LE
44+
$ cat freedv_rx_log.txt
45+
```
46+
47+
Speech samples are input to the API as 16 bit signed integers. Modulated samples can be in real 16 bit signed integer or complex float. The expected sample rates can be found with `freedv_get_speech_sample_rate()` and `freedv_get_modem_sample_rate()`. These are typically 8000 Hz but can vary depending on the current FreeDV mode.
3148

3249
## FreeDV HF Modes
3350

@@ -80,34 +97,6 @@ These modes use constant amplitude modulation like FSK or FM, and are designed f
8097

8198
The FSK_LDPC mode is used for data, and has user defined bit rate and a variety of LDPC codes available. It is discussed in [README_data](README_data.md)
8299

83-
## FreeDV API
84-
85-
The `codec2/demo` directory provides simple FreeDV API demo programs written in C and Python to help you get started, for example:
86-
87-
```
88-
cd codec2/build_linux
89-
cat ../raw/ve9qrp_10s.raw | ./demo/freedv_700d_tx | ./demo/freedv_700d_rx | aplay -f S16_LE
90-
```
91-
92-
The current demo programs are as follows:
93-
94-
| Program | Description |
95-
| --- | --- |
96-
| c2demo | Demonstrates usage of the codec2_* function calls. |
97-
| freedv_700d_rx | Demonstrates how to receive a FreeDV voice signal. |
98-
| freedv_700d_tx | Demonstrates how to transmit a FreeDV voice signal. |
99-
| freedv_datac1_rx | Demonstrates how to receive a FreeDV data signal. |
100-
| freedv_datac1_tx | Demonstrates how to transmit a FreeDV data signal. |
101-
102-
See also [freedv_api.h](src/freedv_api.h) and [freedv_api.c](src/freedv_api.c), and the full featured command line demo programs [freedv_tx.c](src/freedv_tx.c) & [freedv_rx.c](src/freedv_rx.c):
103-
104-
```
105-
$ ./freedv_tx 1600 ../../raw/hts1.raw - | ./freedv_rx 1600 - - | aplay -f S16_LE
106-
$ cat freedv_rx_log.txt
107-
```
108-
109-
Note that FreeDV expects and outputs 16-bit integer samples at one of two rates: freedv_get_modem_sample_rate() for transmit output/receive input and freedv_get_speech_sample_rate() for transmit input/receive output. These are typically 8000 Hz but can vary depending on the current FreeDV mode.
110-
111100
## FreeDV 2400A and 2400B modes
112101

113102
FreeDV 2400A and FreeDV 2400B are modes designed for VHF radio. FreeDV 2400A is designed for SDR radios (it has a 5 kHz RF bandwidth), however FreeDV 2400B is designed to pass through commodity FM radios.
@@ -204,3 +193,23 @@ $ ./src/freedv_tx 700D ../raw/ve9qrp.raw - --clip 0 --testframes | ./src/cohpsk_
204193
```
205194

206195
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.
196+
197+
## Reading Further
198+
199+
1. [FreeDV web site](http://freedv.org)
200+
1. [FreeDV GUI User Manual](https://github.com/drowe67/freedv-gui/blob/master/USER_MANUAL.md)
201+
1. [Codec 2](http://rowetel.com/codec2.html)
202+
1. FreeDV can also be used for data [README_data](https://github.com/drowe67/codec2/blob/master/README_data.md)
203+
1. [FreeDV 1600 specification](https://freedv.org/freedv-specification)
204+
1. [FreeDV 700C blog post](http://www.rowetel.com/wordpress/?p=5456)
205+
1. [FreeDV 700D Released blog post](http://www.rowetel.com/wordpress/?p=6103)
206+
1. [FreeDV 2020 blog post](http://www.rowetel.com/wordpress/?p=6747)
207+
1. [FreeDV 2400A blog post](http://www.rowetel.com/?p=5119)
208+
1. [FreeDV 2400A & 2400B](http://www.rowetel.com/?p=5219)
209+
1. Technical information on various modem waveforms in the [modem codec frame design spreadsheet](https://github.com/drowe67/codec2/blob/master/doc/modem_codec_frame_design.ods)
210+
1. [Modems for HF Digital Voice Part 1](http://www.rowetel.com/wordpress/?p=5420)
211+
1. [Modems for HF Digital Voice Part 2](http://www.rowetel.com/wordpress/?p=5448)
212+
1. [FDMDV modem README](README_fdmdv.md)
213+
1. [OFDM modem README](README_ofdm.md)
214+
1. Many blog posts in the [rowetel.com blog archives](http://www.rowetel.com/?page_id=6172)
215+

demo/freedv_700d_rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
AUTHOR......: David Rowe
55
DATE CREATED: April 2021
66
7-
Demo receive program for FreeDV API 700D mode, see freedv_700d_tx.c for
7+
Demo receive program for FreeDV API (700D mode), see freedv_700d_tx.c for
88
instructions.
99
1010
\*---------------------------------------------------------------------------*/

demo/freedv_700d_tx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
AUTHOR......: David Rowe
55
DATE CREATED: April 2021
66
7-
Demo transmit program for FreeDV API 700D functions.
7+
Demo transmit program using the FreeDV API (700D mode).
88
99
usage:
1010

src/freedv_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
1010
1. README_freedv.md
1111
2. Notes on function use in freedv_api.c
12-
3. The sample freedv_tx.c and freedv_rx.c programs
12+
3. Simple demo programs in the "demo" directory
13+
4. The full featured command line freedv_tx.c and freedv_rx.c programs
1314
1415
\*---------------------------------------------------------------------------*/
1516

0 commit comments

Comments
 (0)