Skip to content

Commit 35e4ffb

Browse files
committed
changed a bunch of 'cohpsk_ch' text to 'ch'
1 parent 500c86f commit 35e4ffb

9 files changed

+43
-43
lines changed

README_cohpsk.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
1. BER test in AWGN channel with just less that 2% average bit error rate:
88

99
```
10-
$ ./cohpsk_get_test_bits - 5600 | ./cohpsk_mod - - | ./cohpsk_ch - - -30 | ./cohpsk_demod - - | ./cohpsk_put_test_bits -
10+
$ ./cohpsk_get_test_bits - 5600 | ./cohpsk_mod - - | ./ch - - --No -30 --Fs 7500 | ./cohpsk_demod - - | ./cohpsk_put_test_bits -
1111
<snip>
1212
SNR3k(dB): 3.41 C/No: 38.2 PAPR: 8.1
1313
BER: 0.017 Nbits: 5264 Nerrors: 92
@@ -18,7 +18,7 @@
1818

1919
```
2020
$ cd build_linux/src
21-
$ ./cohpsk_get_test_bits - 5600 | ./cohpsk_mod - - | ./cohpsk_ch - - -40 -f -20 | ./cohpsk_demod -o cohpsk_demod.txt - - | ./cohpsk_put_test_bits -
21+
$ ./cohpsk_get_test_bits - 5600 | ./cohpsk_mod - - | ./ch - - --No -40 -f -20 --Fs 7500 | ./cohpsk_demod -o cohpsk_demod.txt - - | ./cohpsk_put_test_bits -
2222
$ cd ../../octave
2323
$ octave --no-gui
2424
$ cohpsk_demod_plot("../build_linux/src/cohpsk_demod.txt")

README_data.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -213,23 +213,23 @@ The default is 100 bits/s 2FSK. The (512,256) code sends 256 data bits (32 bytes
213213

214214
In real world operation, 16 of the data bits are reserved for a CRC, leaving 240 payload data bits per frame. Taking into account the overhead of the UW, CRC, and parity bits, we send 240 payload data bits for every out of 544, so the payload data rate in this example is (240/512)*(100 bits/s) = 44.1 bits/s.
215215

216-
We can add some channel noise using the `cohpsk_ch` tool and see how it performs:
216+
We can add some channel noise using the `ch` tool and see how it performs:
217217
```
218218
$ ./freedv_data_raw_tx --testframes 1 --bursts 10 FSK_LDPC /dev/zero - |
219-
./cohpsk_ch - - -5 --Fs 8000 --ssbfilt 0 |
219+
./ch - - --No -5 --ssbfilt 0 |
220220
./freedv_data_raw_rx --testframes -v FSK_LDPC - /dev/null
221221
<snip>
222222
frames processed: 336 output bytes: 320 output_packets: 10
223223
BER......: 0.0778 Tbits: 5440 Terrs: 423
224224
SNR3k(dB): -13.00 C/No: 21.8 PAPR: 7.5
225225
Coded BER: 0.0000 Tbits: 2560 Terrs: 0
226226
```
227-
The `cohpsk_ch` stderr reporting is mixed up with the testframes results but we can see that over a channel with a -13dB SNR, we obtained a raw bit error rate of 0.0778 (nearly 8%). However the LDPC code cleaned that up nicely and still received all 10 packets with no errors.
227+
The `ch` stderr reporting is mixed up with the testframes results but we can see that over a channel with a -13dB SNR, we obtained a raw bit error rate of 0.0778 (nearly 8%). However the LDPC code cleaned that up nicely and still received all 10 packets with no errors.
228228

229229
Here is an example running 4FSK at 20000 bits/s (10000 symbols/s), at a sample rate of 200 kHz:
230230
```
231231
$./freedv_data_raw_tx -m 4 --Fs 200000 --Rs 10000 --tone1 10000 --shift 10000 --testframes 100 --bursts 10 FSK_LDPC /dev/zero - |
232-
./cohpsk_ch - - -12 --Fs 8000 --ssbfilt 0 |
232+
./ch - - --No -12 --ssbfilt 0 |
233233
./freedv_data_raw_rx -m 4 --testframes -v --Fs 200000 --Rs 10000 FSK_LDPC --mask 10000 - /dev/null
234234
<snip>
235235
frames processed: 5568 output bytes: 30144 output_packets: 942
@@ -240,7 +240,7 @@ Some notes on this example:
240240
1. We transmit 10 bursts, each of 100 frames in length, 1000 packets total. There are a couple of frames silence between each burst. This gives the acquisition algorithms a good work out.
241241
1. Only 942 packets make it though this rather noisy channel, a 6% Packet Error Rate (PER). In a real world application, a higher protocol layer would need to detect this, and arrange for re-transmission of missing packets. If the SNR was a few dB better, all 1000 packets would likely make it through. If it was 1dB worse, nothing would get through; LDPC codes have a very sharp "knee" in the PER versus SNR curve.
242242
1. Our first tone `--tone` is at 10kHz, and each tone is spaced `--shift` by 10kHz, so we have FSK tones at 10,20,30, and 40 kHz. For good performance, FSK tones must be spaced by at least the symbol rate Rs.
243-
1. Although the `cohpsk_ch` utility is designed for 8kHz sample rate operation, it just operates on sampled signals, so it's OK to use at higher sample rates. It does have some internal filtering so best to keep your signal well away from 0 and (sample rate)/2. The SNR measurement is calibrated to a 3000 Hz noise bandwidth, so won't make much sense at other sample rates. The third argument `-12` sets the noise level of the channel.
243+
1. Although the `ch` utility is designed for 8kHz sample rate operation, it just operates on sampled signals, so it's OK to use at higher sample rates. It does have some internal filtering so best to keep your signal well away from 0 and (sample rate)/2. The SNR measurement is calibrated to a 3000 Hz noise bandwidth, so won't make much sense at other sample rates. The third argument `-12` sets the noise level of the channel.
244244
1. The `--mask` frequency offset algorithm is used, which gives better results on noisy channels, especially for 4FSK.
245245

246246
### Reading Further
@@ -287,17 +287,17 @@ Coded PER: 0.0000 Tpkts: 6 Tpers: 0
287287
Lets add some noise and a 20 Hz frequency offset:
288288
```
289289
./src/freedv_data_raw_tx --framesperburst 2 --bursts 3 --testframes 6 DATAC0 /dev/zero - |
290-
./src/cohpsk_ch - - -20 --Fs 8000 -f 20 |
290+
./src/ch - - --No -20 -f 20 |
291291
./src/freedv_data_raw_rx --framesperburst 2 --testframes DATAC0 - /dev/null --vv
292292
<snip>
293293
marks:space: 0.83 SNR offset: -0.79
294-
cohpsk_ch: SNR3k(dB): -0.36 C/No....: 34.42
294+
ch: SNR3k(dB): -0.36 C/No....: 34.42
295295
<snip>
296296
BER......: 0.0195 Tbits: 1536 Terrs: 30
297297
Coded BER: 0.0000 Tbits: 768 Terrs: 0
298298
Coded PER: 0.0000 Tpkts: 6 Tpers: 0
299299
```
300-
We still received 6 frames OK (Tpkts field), but in this case there was a raw BER of about 2% which the FEC cleaned up nicely (Coded BER 0.0). Just above that we can see the "SNR offset" and "cohpsk_ch: SNR3k" fields. In the silence between bursts the modem signal has zero power, which biases the SNR measured by the `conhpsk_ch` channels simulation tool. This bias is the "SNR offset". So the true SNR for this test is actually:
300+
We still received 6 frames OK (Tpkts field), but in this case there was a raw BER of about 2% which the FEC cleaned up nicely (Coded BER 0.0). Just above that we can see the "SNR offset" and "ch: SNR3k" fields. In the silence between bursts the modem signal has zero power, which biases the SNR measured by the `ch` channels simulation tool. This bias is the "SNR offset". So the true SNR for this test is actually:
301301
```
302302
SNR = -0.36 - (-0.79) = 0.43 dB
303303
```
@@ -336,9 +336,9 @@ Clipping works by introducing controlled distortion, which affects the SNR estim
336336

337337
This command line demonstrates the effect:
338338
```
339-
./src/freedv_data_raw_tx datac3 /dev/zero - --testframes 10 --bursts 10 --clip 1 | ./src/cohpsk_ch - - -100 --fading_dir unittest --Fs 8000 | ./src/freedv_data_raw_rx datac3 - /dev/null --testframes --framesperburst 1 -v
339+
./src/freedv_data_raw_tx datac3 /dev/zero - --testframes 10 --bursts 10 --clip 1 | ./src/ch - - --No -100 --fading_dir unittest | ./src/freedv_data_raw_rx datac3 - /dev/null --testframes --framesperburst 1 -v
340340
```
341-
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.
341+
Try adjusting `--clip` and `No` argument of `ch` (noise level) for different modes. Note the SNR estimates returned from `freedv_data_raw_rx` compared to the SNR from the channel simulator `ch`. You will notice clipping also increases the RMS power and reduces the PER for a given noise level.
342342

343343
## Reading Further
344344

README_freedv.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,27 +174,27 @@ $ ./freedv_tx 2020 ~/LPCNet/wav/all.wav - --testframes | ./freedv_rx 2020 - /dev
174174

175175
Simulated HF slow fading channel, 10.8dB SNR:
176176
```
177-
$ ./freedv_tx 2020 ~/LPCNet/wav/all.wav - | ./cohpsk_ch - - -30 --Fs 8000 --slow | ./freedv_rx 2020 - - | aplay -f S16_LE -r 16000
177+
$ ./freedv_tx 2020 ~/LPCNet/wav/all.wav - | ./ch - - --No -30 --slow | ./freedv_rx 2020 - - | aplay -f S16_LE -r 16000
178178
```
179179
It falls down quite a bit with fast fading (--fast):
180180

181181
AWGN (noise but no fading) channel, 2.8dB SNR:
182182
```
183-
$ ./freedv_tx 2020 ~/LPCNet/wav/all.wav - | ./cohpsk_ch - - -22 --Fs 8000 | ./freedv_rx 2020 - - | aplay -f S16_LE -r 16000
183+
$ ./freedv_tx 2020 ~/LPCNet/wav/all.wav - | ./ch - - --No -22 | ./freedv_rx 2020 - - | aplay -f S16_LE -r 16000
184184
```
185185

186186
## Command lines for PER testing 700D/700E PER with clipper
187187

188188
AWGN:
189189
```
190-
$ ./src/freedv_tx 700D ../raw/ve9qrp.raw - --clip 0 --testframes | ./src/cohpsk_ch - - -16 --Fs 8000 | ./src/freedv_rx 700D - /dev/null --testframes
190+
$ ./src/freedv_tx 700D ../raw/ve9qrp.raw - --clip 0 --testframes | ./src/ch - - --No -16 | ./src/freedv_rx 700D - /dev/null --testframes
191191
```
192192
MultiPath Poor (MPP):
193193
```
194-
$ ./src/freedv_tx 700D ../raw/ve9qrp.raw - --clip 0 --testframes | ./src/cohpsk_ch - - -24 --mpp --fading_dir unittest --Fs 8000 | ./src/freedv_rx 700D - /dev/null --testframes
194+
$ ./src/freedv_tx 700D ../raw/ve9qrp.raw - --clip 0 --testframes | ./src/ch - - --No -24 --mpp --fading_dir unittest| ./src/freedv_rx 700D - /dev/null --testframes
195195
```
196196

197-
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.
197+
Adjust `--clip [0|1]` and `No` argument of `ch` to obtain a PER of just less than 0.1, and note the SNR and PAPR reported by `ch`. The use of the `ve9qrp` samples makes the test run for a few minutes, in order to get reasonable multipath channel results.
198198

199199
## Reading Further
200200

README_fsk.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ The Octave version of the modem was developed by David Rowe. Brady O'Brien port
4949

5050
1. Lets add some channel noise:
5151
```
52-
$ ./fsk_get_test_bits - 10000 | ./fsk_mod 2 8000 100 1200 100 - - | ./cohpsk_ch - - -26 --Fs 8000 | ./fsk_demod 2 8000 100 - - | ./fsk_put_test_bits -b 0.015 -
52+
$ ./fsk_get_test_bits - 10000 | ./fsk_mod 2 8000 100 1200 100 - - | ./ch - - --No -26 | ./fsk_demod 2 8000 100 - - | ./fsk_put_test_bits -b 0.015 -
5353
<snip>
5454
SNR3k(dB): -5.76 C/No: 29.0 PAPR: 3.0
5555
[0099] BER 0.010, bits tested 9900, bit errors 103
5656
PASS
5757
```
58-
The cohpsk_ch utility takes the FSK modulator signal, and adds calibrated noise to it (the -26 value specifies the noise). Try changing the noise level, and note how the Bit Error Rate (BER) changes. The BER is 0.01, which is right on theory for this sort of FSK demodulator at this SNR (2FSK non-coherent demodulator Eb/No=9dB).
58+
The `ch` utility takes the FSK modulator signal, and adds calibrated noise to it (the `--No -26` value specifies the noise). Try changing the noise level, and note how the Bit Error Rate (BER) changes. The BER is 0.01, which is right on theory for this sort of FSK demodulator at this SNR (2FSK non-coherent demodulator Eb/No=9dB).
5959

6060
The SNR is calculated using the signal power divided by the noise power in 3000 Hz. The C/No value is the same thing, but uses a noise bandwidth of 1 Hz. There is less noise power when you look at just 1Hz, so C/No is higher. Peak to Average Power ratio (PAPR) is 3dB as a FSK signal is just a single sine wave, and a sine wave peak is 3dB higher than it's average.
6161

@@ -77,7 +77,7 @@ The Octave version of the modem was developed by David Rowe. Brady O'Brien port
7777
$ cd ~/codec2/build_linux/src
7878
$ ./ldpc_enc /dev/zero - --code H_256_512_4 --testframes 200 |
7979
./framer - - 512 5186 | ./fsk_mod 4 8000 100 1000 100 - - |
80-
./cohpsk_ch - - -24 --Fs 8000 |
80+
./ch - - --No -24 |
8181
./fsk_demod -s 4 8000 100 - - |
8282
./deframer - - 512 5186 |
8383
./ldpc_dec - /dev/null --code H_256_512_4 --testframes

README_ofdm.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,36 +79,36 @@ Built as part of codec2-dev, see [README](README.md) for build instructions.
7979

8080
1. Listen to signal through simulated fading channel in C:
8181
```
82-
build_linux/src$ ./c2enc 700C ../../raw/ve9qrp_10s.raw - --bitperchar | ./ofdm_mod --ldpc | ./cohpsk_ch - - -20 --Fs 8000 --slow -f -5 | aplay -f S16
82+
build_linux/src$ ./c2enc 700C ../../raw/ve9qrp_10s.raw - --bitperchar | ./ofdm_mod --ldpc | ./ch - - --No -20 --mpg -f -5 | aplay -f S16
8383
```
8484

8585
1. Run test frames through simulated channel in C:
8686
```
87-
build_linux/src$ ./ofdm_mod --in /dev/zero --ldpc --testframes 20 | ./cohpsk_ch - - -24 --Fs 8000 -f -10 --fast | ./ofdm_demod --out /dev/null --testframes --verbose 1 --ldpc
87+
build_linux/src$ ./ofdm_mod --in /dev/zero --ldpc --testframes 20 | ./ch - - --No -24 -f -10 --mpp | ./ofdm_demod --out /dev/null --testframes --verbose 1 --ldpc
8888
```
8989

9090
1. Run codec voice through simulated fast fading channel, just where it starts to fall over:
9191
```
92-
build_linux/src$ ./c2enc 700C ../../raw/ve9qrp.raw - --bitperchar | ./ofdm_mod --ldpc | ./cohpsk_ch - - -24 --Fs 8000 -f -10 --fast | ./ofdm_demod --ldpc --verbose 1 | ./c2dec 700C - - --bitperchar | aplay -f S16
92+
build_linux/src$ ./c2enc 700C ../../raw/ve9qrp.raw - --bitperchar | ./ofdm_mod --ldpc | ./ch - - --No -24 -f -10 --mpp | ./ofdm_demod --ldpc --verbose 1 | ./c2dec 700C - - --bitperchar | aplay -f S16
9393
```
9494

9595
1. FreeDV 1600 on the same channel conditions, roughly same quality at 8dB higher SNR:
9696
```
97-
build_linux/src$ ./freedv_tx 1600 ../../raw/ve9qrp_10s.raw - | ./cohpsk_ch - - -30 --Fs 8000 -f -10 --fast | ./freedv_rx 1600 - - | aplay -f S16
97+
build_linux/src$ ./freedv_tx 1600 ../../raw/ve9qrp_10s.raw - | ./ch - - --No -30 -f -10 --mpp | ./freedv_rx 1600 - - | aplay -f S16
9898
```
9999

100100
1. Using FreeDV API test programs:
101101
```
102102
build_linux/src$ ./freedv_tx 700D ../../raw/hts1a.raw - --testframes | ./freedv_rx 700D - /dev/null --testframes
103103
build_linux/src$ ./freedv_tx 700D ../../raw/hts1a.raw - | ./freedv_rx 700D - - | aplay -f S16
104-
build_linux/src$ ./freedv_tx 700D ../../raw/ve9qrp.raw - | ./cohpsk_ch - - -26 --Fs 8000 -f -10 --fast | ./freedv_rx 700D - - | aplay -f S16
104+
build_linux/src$ ./freedv_tx 700D ../../raw/ve9qrp.raw - | ./ch - - --No -26 -f -10 --mpp | ./freedv_rx 700D - - | aplay -f S16
105105
```
106106

107107
## FreeDV 2020 extensions
108108

109109
1. 20.5ms symbol period, 31 carrier waveform, (504,396) code, but only 312 data bits used, so we don't send unused data bits. This means we need less carriers (so more power per carrier), and code rate is increased slightly:
110110
```
111-
build_linux/src$ ./ofdm_mod --in /dev/zero --testframes 300 --mode 2020 --ldpc 1 --verbose 1 -p 312 | ./cohpsk_ch - - -22 --Fs 8000 -f 10 --ssbfilt 1 | ./ofdm_demod --out /dev/null --testframes --mode 2020 --verbose 1 --ldpc -p 312
111+
build_linux/src$ ./ofdm_mod --in /dev/zero --testframes 300 --mode 2020 --ldpc 1 --verbose 1 -p 312 | ./ch - - --No -22 -f 10 --ssbfilt 1 | ./ofdm_demod --out /dev/null --testframes --mode 2020 --verbose 1 --ldpc -p 312
112112
113113
SNR3k(dB): 2.21 C/No: 37.0 PAPR: 9.6
114114
BER......: 0.0505 Tbits: 874020 Terrs: 44148
@@ -156,7 +156,7 @@ Here are some useful tests for the LDPC coded C version of the modem, useful to
156156
157157
1. AWGN channel, -2dB:
158158
```
159-
./ofdm_mod --in /dev/zero --ldpc --testframes 60 --txbpf | ./cohpsk_ch - - -20 --Fs 8000 -f -10 | ./ofdm_demod --out /dev/null --testframes --verbose 1 --ldpc
159+
./ofdm_mod --in /dev/zero --ldpc --testframes 60 --txbpf | ./ch - - --No -20 -f -10 | ./ofdm_demod --out /dev/null --testframes --verbose 1 --ldpc
160160

161161
SNR3k(dB): -1.85 C/No: 32.9 PAPR: 9.8
162162
BER......: 0.0815 Tbits: 98532 Terrs: 8031
@@ -165,7 +165,7 @@ Here are some useful tests for the LDPC coded C version of the modem, useful to
165165
166166
1. Fading HF channel:
167167
```
168-
./ofdm_mod --in /dev/zero --ldpc --testframes 60 --txbpf | ./cohpsk_ch - - -24 --Fs 8000 -f -10 --fast | ./ofdm_demod --out /dev/null --testframes --verbose 1 --ldpc
168+
./ofdm_mod --in /dev/zero --ldpc --testframes 60 --txbpf | ./ch - - --No -24 -f -10 --fast | ./ofdm_demod --out /dev/null --testframes --verbose 1 --ldpc
169169

170170
SNR3k(dB): 2.15 C/No: 36.9 PAPR: 9.8
171171
BER......: 0.1015 Tbits: 88774 Terrs: 9012
@@ -181,7 +181,7 @@ The OFDM modem can also support datac1/datac2/datac3 modes for packet data. The
181181
Here is an example of running the datac3 mode in a low SNR AWGN channel:
182182
183183
```
184-
./src/ofdm_mod --mode datac3 --ldpc --in /dev/zero --testframes 60 --verbose 1 | ./src/cohpsk_ch - - -20 --Fs 8000 | ./src/ofdm_demod --mode datac3 --ldpc --out /dev/null --testframes -v 1
184+
./src/ofdm_mod --mode datac3 --ldpc --in /dev/zero --testframes 60 --verbose 1 | ./src/ch - - --No -20 | ./src/ofdm_demod --mode datac3 --ldpc --out /dev/null --testframes -v 1
185185
<snip>
186186
SNR3k(dB): -3.54 C/No: 31.2 PAPR: 10.4
187187
BER......: 0.1082 Tbits: 36096 Terrs: 3905 Tpackets: 47
@@ -200,7 +200,7 @@ Note despite the raw BER of 10%, 47/50 packets are received error free.
200200
| ofdm_demod | OFDM demodulator command line program, supports uncoded (raw) and LDPC coded test frames, LDPC decoding of codec data, and can output LLRs to external LDPC decoder |
201201
| ofdm_put_test_bits | Measure BER in OFDM test frames |
202202
| unittest/tofdm | Run C port of modem to compare with octave version (see octave/tofdm) |
203-
| cohpsk_ch | From COHPSK modem development, useful C channel simulator |
203+
| ch | C channel simulator |
204204
205205
# Octave Scripts
206206

octave/cohpsk_demod_plot.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
% when errors hit the system
66

77
#{
8-
$ ./cohpsk_get_test_bits - 5600 | ./cohpsk_mod - - | ./cohpsk_ch - - -40 | ./cohpsk_demod - - -o cohpsk_demod.txt | ./cohpsk_put_test_bits -
8+
$ ./cohpsk_get_test_bits - 5600 | ./cohpsk_mod - - | ./ch - - --No -40 | ./cohpsk_demod - - -o cohpsk_demod.txt | ./cohpsk_put_test_bits -
99
octave> cohpsk_demod_plot("../build_linux/src/cohpsk_demod.txt")
1010
#}
1111

octave/fsk_demod_file.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
Same thing but complex (single sided):
1616

17-
$ ./fsk_get_test_bits - 1000 | ./fsk_mod 2 8000 100 1000 1000 - - | ./cohpsk_ch - fsk.cs16 -100 --Fs 8000 --complexout
17+
$ ./fsk_get_test_bits - 1000 | ./fsk_mod 2 8000 100 1000 1000 - - | ./ch - fsk.cs16 --complexout
1818
octave:2> fsk_demod_file("fsk.cs16",format="cs16",8000,100,2)
1919
#}
2020

octave/make_ssbfilt.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% make_ssbfilt.m
22
% David Rowe May 2015
33
%
4-
% Creates low pass filter coeff used to implement a SSB filter in cohpsk_ch
4+
% Creates low pass filter coeff used to implement a SSB filter in ch
55

66
graphics_toolkit ("gnuplot");
77

0 commit comments

Comments
 (0)