Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QAM16 C port #47

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b6faec2
first pass at datac14, 5 byte, < 1s signalling mode
drowe67 Mar 27, 2024
babaecc
tweaks to reduce duration to 0.69s including pre/postamble
drowe67 Mar 27, 2024
3c76146
work out packet duration including pre/postamble
drowe67 Mar 27, 2024
2ee2989
ofdm_mod/ofdm_demod working with datac14
drowe67 Mar 28, 2024
3b9037c
datac14 freedv_api port
drowe67 Mar 28, 2024
23a7d60
put snr_curve.sh system back in from codec2-dev, curves for datac14
drowe67 Mar 29, 2024
735d788
WIP freedv API support for custom raw data modes
drowe67 Apr 3, 2024
cf069d2
demo custom mode
drowe67 Apr 3, 2024
1de1b46
ctest for custom mode
drowe67 Apr 3, 2024
e02ef2c
EsNo supplied to LDPC dec now a config param
drowe67 Apr 3, 2024
6a5687c
removed unused EsNo_est_all_symbols
drowe67 Apr 3, 2024
4726a97
WIP qam16c2, ofdm_mod runs but doesn't decode in Octave
drowe67 Apr 3, 2024
10d344c
uncoded C tx works with Octave rx
drowe67 Apr 4, 2024
31d8044
WIP qam demod
drowe67 Apr 4, 2024
2841e6c
non-table driven interleaver b
drowe67 Apr 4, 2024
2607516
Merge branch 'dr-freedata-001' into dr-qam16-cport
drowe67 Apr 4, 2024
1079f80
ofdm_demod uncoded demods qam16c2
drowe67 Apr 4, 2024
73482ea
uncoded BER 0 with ofdm_mod/ofdm_demod, LDPC decode not working yet
drowe67 Apr 5, 2024
c0821c8
refactoring to support QAM16 LDPC decode
drowe67 Apr 5, 2024
1b2a4a7
first pass LDPC decoder working with QAM16
drowe67 Apr 5, 2024
2e5f845
adjusted UW thresh and EsNo for LDPC decoder - PER < 0.1 with 100 pac…
drowe67 Apr 5, 2024
82546c4
qam16c2 FreeDV API support
drowe67 Apr 5, 2024
43388dd
qam16 ctests and README_data.md
drowe67 Apr 5, 2024
1fd68ac
attempt to fix stm32 build issues
drowe67 Apr 5, 2024
ffd020c
freedv 2020 build issue
drowe67 Apr 5, 2024
15f565e
fix stm32 build ...
drowe67 Apr 5, 2024
7f6188c
adjusted clipper in C & octave, regerenerated curves
drowe67 May 1, 2024
d321ccf
Merge branch 'dr-datac14' into dr-freedata-001
drowe67 May 1, 2024
6aeb1f5
Merge branch 'dr-freedata-001' into dr-qam16-cport
drowe67 May 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 58 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ endif()

add_test(NAME test_OFDM_modem_octave_qam16_uncoded
COMMAND sh -c "cd ${CMAKE_CURRENT_SOURCE_DIR}/octave;
echo \"ofdm_tx('test_qam16.raw','qam16c1',3,12,'awgn','bursts',3); ofdm_rx('test_qam16.raw','qam16c1', 'passber', 0.05, 'packetsperburst', 1); quit\" |
echo \"ofdm_tx('test_qam16.raw','qam16c2',1,12,'awgn','bursts',3); ofdm_rx('test_qam16.raw','qam16c2', 'passber', 0.05, 'packetsperburst', 1); quit\" |
DISPLAY=\"\" octave-cli")
set_tests_properties(test_OFDM_modem_octave_qam16_uncoded PROPERTIES PASS_REGULAR_EXPRESSION "Pass")

Expand Down Expand Up @@ -662,6 +662,20 @@ endif()
cd ${CMAKE_CURRENT_BINARY_DIR}/src;
cat test.raw | ./ofdm_demod --mode datac13 --out /dev/null --testframes --ldpc --verbose 2 --packetsperburst 1")

# DATAC14 Octave Tx, C Rx, burst mode
add_test(NAME test_OFDM_modem_datac14_octave
COMMAND sh -c "cd ${CMAKE_CURRENT_SOURCE_DIR}/octave;
DISPLAY=\"\" octave-cli -qf --eval 'ofdm_ldpc_tx(\"${CMAKE_CURRENT_BINARY_DIR}/src/test.raw\",\"datac14\",1,3,\"awgn\",\"bursts\",5)';
cd ${CMAKE_CURRENT_BINARY_DIR}/src;
cat test.raw | ./ofdm_demod --mode datac14 --out /dev/null --testframes --ldpc --verbose 2 --packetsperburst 1")

# QAM16C2 Octave Tx, C Rx, burst mode
add_test(NAME test_OFDM_modem_qam16c2_octave
COMMAND sh -c "cd ${CMAKE_CURRENT_SOURCE_DIR}/octave;
DISPLAY=\"\" octave-cli -qf --eval 'ofdm_ldpc_tx(\"${CMAKE_CURRENT_BINARY_DIR}/src/test.raw\",\"qam16c2\",1,10,\"awgn\",\"bursts\",2)';
cd ${CMAKE_CURRENT_BINARY_DIR}/src;
cat test.raw | ./ofdm_demod --mode qam16c2 --out /dev/null --testframes --ldpc --verbose 2 --packetsperburst 1")

# DATAC4 C Tx, C Rx, burst mode
add_test(NAME test_OFDM_modem_datac4_ldpc_burst
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
Expand All @@ -676,7 +690,21 @@ endif()
./ch - - --No -17 |
./ofdm_demod --mode datac13 --out /dev/null --testframes --ldpc --verbose 2 --packetsperburst 1")

# -------------------------------------------------------------------------
# DATAC14 C Tx, C Rx, burst mode
add_test(NAME test_OFDM_modem_datac14_ldpc_burst
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
./ofdm_mod --mode datac14 --in /dev/zero --testframes 1 --verbose 1 --ldpc --bursts 10 |
./ch - - --No -17 |
./ofdm_demod --mode datac14 --out /dev/null --testframes --ldpc --verbose 2 --packetsperburst 1")

# QAM16C2 C Tx, C Rx, burst mode
add_test(NAME test_OFDM_modem_qam16c2_ldpc_burst
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
./ofdm_mod --mode qam16c2 --in /dev/zero --testframes 1 --verbose 1 --ldpc --bursts 10 |
./ch - - --No -30 |
./ofdm_demod --mode qam16c2 --out /dev/null --testframes --ldpc --verbose 2 --packetsperburst 1")

# -------------------------------------------------------------------------
# LDPC
# -------------------------------------------------------------------------

Expand Down Expand Up @@ -1064,6 +1092,12 @@ if (NOT APPLE)
./freedv_data_raw_tx --testframes 10 DATAC13 /dev/zero /dev/null")
set_tests_properties(test_memory_leak_FreeDV_DATAC13_tx PROPERTIES PASS_REGULAR_EXPRESSION "ERROR SUMMARY: 0 errors")

add_test(NAME test_memory_leak_FreeDV_DATAC14_tx
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes \
./freedv_data_raw_tx --testframes 10 DATAC14 /dev/zero /dev/null")
set_tests_properties(test_memory_leak_FreeDV_DATAC14_tx PROPERTIES PASS_REGULAR_EXPRESSION "ERROR SUMMARY: 0 errors")

add_test(NAME test_memory_leak_FreeDV_700E_tx
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes \
Expand Down Expand Up @@ -1271,6 +1305,12 @@ endif(NOT APPLE)
./freedv_data_raw_rx --framesperburst 2 --testframes DATAC0 - /dev/null --vv")
set_tests_properties(test_freedv_data_raw_ofdm_datac0_burst PROPERTIES PASS_REGULAR_EXPRESSION "Coded FER: 0.0000 Tfrms: 6 Tfers: 0")

add_test(NAME test_freedv_data_raw_ofdm_data_custom
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
./freedv_data_raw_tx --bursts 3 --testframes 3 custom /dev/zero - |
./freedv_data_raw_rx --testframes custom - /dev/null --vv")
set_tests_properties(test_freedv_data_raw_ofdm_data_custom PROPERTIES PASS_REGULAR_EXPRESSION "Coded FER: 0.0000 Tfrms: 3 Tfers: 0")

# Burst mode with data file I/O:
add_test(NAME test_freedv_data_raw_ofdm_datac0_burst_file
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
Expand Down Expand Up @@ -1307,6 +1347,20 @@ endif(NOT APPLE)
./freedv_data_raw_rx DATAC13 - binaryOut.bin -v;
diff binaryIn.bin binaryOut.bin")

add_test(NAME test_freedv_data_raw_ofdm_datac14_burst_file
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
head -c $((3*10)) </dev/urandom > binaryIn.bin;
./freedv_data_raw_tx DATAC14 binaryIn.bin - --bursts 10 |
./freedv_data_raw_rx DATAC14 - binaryOut.bin -v;
diff binaryIn.bin binaryOut.bin")

add_test(NAME test_freedv_data_raw_ofdm_qam16c2_burst_file
COMMAND sh -c "cd ${CMAKE_CURRENT_BINARY_DIR}/src;
head -c $((1213*10)) </dev/urandom > binaryIn.bin;
./freedv_data_raw_tx qam16c2 binaryIn.bin - --bursts 10 |
./freedv_data_raw_rx qam16c2 - binaryOut.bin -v;
diff binaryIn.bin binaryOut.bin")

# FSK LDPC default 100 bit/s 2FSK, enough noise for several % raw BER to give
# FEC/acquisition a work out, bursts of 1 frame as that stresses acquisition
add_test(NAME test_freedv_data_raw_fsk_ldpc_100
Expand Down Expand Up @@ -1392,6 +1446,8 @@ endif(NOT APPLE)
test_OFDM_modem_datac3_octave
test_OFDM_modem_datac4_octave
test_OFDM_modem_datac13_octave
test_OFDM_modem_datac14_octave
test_OFDM_modem_qam16c2_octave
test_fsk_lib_4fsk_ldpc
test_OFDM_modem_datac0_compression
PROPERTIES
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Feature Requests can be submitted via GitHub Issues.
Before writing any code or submitting a PR - **please discuss** the PR with developers by raising a GitHub Issue. We have many years of experience and a carefully considered plan for Codec 2 development, and can guide you on work that will most benefit this project.

Some key guidelines about the code in the `codec2` repo:
1. Code that is required to build libcodec2, or to test libcodec2 goes in codec2.
1. Only code that is required to build, test, or document libcodec2 goes in codec2.
2. Experimental work, code used for algorithm development, should probably go into some other repo.
3. Only widely used “production” code goes in codec2. If it has an user base of < 2 (e.g. personal projects, early R&D) - it should probably be application code or a fork.

Expand Down
4 changes: 3 additions & 1 deletion README_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ These modes use an OFDM modem with powerful LDPC codes and are designed for send
| DATAC3 | 500 | 321 | 126 | (2048,1024) | 3.19 | 74/100 at 0dB | Forward link data (low SNR) |
| DATAC4 | 250 | 87 | 56 | (1472,448) | 5.17 | 90/100 at -4dB | Forward link data (low SNR) |
| DATAC13 | 200 | 64 | 14 | (384,128) | 2.0 | 90/100 at -4dB | Reverse link ACK packets (low SNR) |
| DATAC14 | 250 | 58 | 3 | (112,56) | 0.69 | 90/100 at -2dB | Reverse link ACK packets (low SNR) |
| QAM16C2 | 2100 | 3100 | 1213 | (16200,9720) | 3.2 | 90/100 at 15dB | Forward link data (high SNR) |

Notes:
1. 16 bits (2 bytes) per frame are reserved for a 16 bit CRC, e.g. for `datac3` we have 128 byte frames, and 128-2=126 bytes/frame of payload data.
Expand Down Expand Up @@ -245,7 +247,7 @@ This command line demonstrates the effect:
```
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 channel noise power. CPAPR will also reduce with clipping enabled.

The following plots illustrate the SNR estimates versus actual channel SNR with and without compression (clipping). Not that even with the uncompressed waveform there is a small offset of around 1dB, possibly due to modem implementation loss or noise in the frequency, phase, or timing estimators.
The following plots illustrate the SNR estimates versus actual channel SNR with and without compression (clipping). Note that even with the uncompressed waveform there is a small offset of around 1dB, possibly due to modem implementation loss or noise in the frequency, phase, or timing estimators.

![](doc/snrest_snr_ctx.png)
![](doc/snrest_snr_ctxc.png)
Expand Down
Binary file modified doc/c_tx_comp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/c_tx_comp_thruput.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified doc/modem_codec_frame_design.ods
Binary file not shown.
29 changes: 21 additions & 8 deletions octave/gp_interleaver.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,31 @@

1;

% return 1 if prime
function ret = is_prime(x)
for i=2:x-1
if mod(x,i) == 0
ret = 0;
return;
end
end
ret = 1;
end

function x = next_prime(x)
x++;
while is_prime(x) == 0
x++;
end
end

% Choose b for Golden Prime Interleaver. b is chosen to be the
% closest integer, which is relatively prime to N, to the Golden
% section of N.

function b = choose_interleaver_b(Nbits)

p = primes(Nbits);
i = 1;
while(p(i) < Nbits/1.62)
i++;
end
b = p(i);
b = floor(Nbits/1.62);
b = next_prime(b);
assert(gcd(b,Nbits) == 1, "b and Nbits must be co-prime");
end

Expand All @@ -36,7 +49,7 @@

function frame = gp_deinterleave(interleaved_frame)
Nbits = length(interleaved_frame);
b = choose_interleaver_b(Nbits);
b = choose_interleaver_b(Nbits);
frame = zeros(1,Nbits);
for i=1:Nbits
j = mod((b*(i-1)), Nbits);
Expand Down
3 changes: 2 additions & 1 deletion octave/ofdm_helper.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function print_config(states)
printf("Nc=%d Ts=%4.3f Tcp=%4.3f Ns: %d Np: %d\n", Nc, 1/Rs, Tcp, Ns, Np);
printf("Nsymperframe: %d Nbitsperpacket: %d Nsamperframe: %d Ntxtbits: %d Nuwbits: %d Nuwframes: %d\n",
Ns*Nc, Nbitsperpacket, Nsamperframe, Ntxtbits, Nuwbits, Nuwframes);
printf("uncoded bits/s: %4.1f\n", Nbitsperpacket*Fs/(Np*Nsamperframe));
printf("uncoded bits/s: %4.1f Duration (incl post/preamble): %4.2f s\n",
Nbitsperpacket*Fs/(Np*Nsamperframe), (Np+2)*Ns*(Tcp+1/Rs));
end

%-----------------------------------------------------------------------
Expand Down
14 changes: 6 additions & 8 deletions octave/ofdm_lib.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
bad_uw_errors = config.bad_uw_errors;
amp_scale = config.amp_scale;
amp_est_mode = config.amp_est_mode;
EsNo_est_all_symbols = config.EsNo_est_all_symbols;
EsNodB = config.EsNodB;
state_machine = config.state_machine;
edge_pilots = config.edge_pilots;
Expand All @@ -74,10 +73,10 @@
states.Nsampersymbol = states.M+states.Ncp; % number of samples in a single symbol
states.Nsamperframe = Ns*states.Nsampersymbol; % number of samples in a modem frame
states.qam16 = [
1 + j, 1 + j*3, 3 + j, 3 + j*3;
1 - j, 1 - j*3, 3 - j, 3 - j*3;
-1 + j, -1 + j*3, -3 + j, -3 + j*3;
-1 - j, -1 - j*3, -3 - j, -3 - j*3]/3;
1 + j, 1 + j*3, 3 + j, 3 + j*3, ...
1 - j, 1 - j*3, 3 - j, 3 - j*3, ...
-1 + j, -1 + j*3, -3 + j, -3 + j*3, ...
-1 - j, -1 - j*3, -3 - j, -3 - j*3];
rms = sqrt(states.qam16(:)'*states.qam16(:)/16);% set average Es to 1
states.qam16 /= rms;
states.qam16 *= exp(-j*pi/4); % same rotation as QPSK constellation
Expand Down Expand Up @@ -128,7 +127,7 @@
states.uw_ind = [states.uw_ind bps*ind_sym-b]; % bit index
end
end

% how many of the first few frames have UW symbols in them
Nsymsperframe = states.Nbitsperframe/states.bps;
states.Nuwframes = ceil(states.uw_ind_sym(end)/Nsymsperframe);
Expand Down Expand Up @@ -275,7 +274,6 @@

% Es/No (SNR) est states

states.EsNo_est_all_symbols = EsNo_est_all_symbols;
states.clock_offset_est = 0;

% pre-amble for data modes
Expand Down Expand Up @@ -1254,7 +1252,7 @@ Can be used for acquisition (coarse timing), and fine timing. Tends
% with acquisition
function [rx delay_samples] = ofdm_rx_filter(states, mode, rx)
delay_samples = 0;
if strcmp(mode,"datac4") || strcmp(mode,"datac13")
if strcmp(mode,"datac4") || strcmp(mode,"datac13") || strcmp(mode,"datac14")
w_centre = mean(states.w); centre_norm = w_centre/(2*pi);
n_coeffs = 100;
cutoff_Hz = 400; cutoff_norm = cutoff_Hz/states.Fs;
Expand Down
29 changes: 24 additions & 5 deletions octave/ofdm_mode.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
config.bad_uw_errors = 3;
config.amp_scale = 245E3;
config.amp_est_mode = 0;
config.EsNo_est_all_symbols = 1;
config.EsNodB = 3;
config.state_machine = "voice1";
config.edge_pilots = 1;
Expand Down Expand Up @@ -59,12 +58,12 @@
config.bps=4; config.Ntxtbits = 0; config.Nuwbits = 15*4; config.bad_uw_errors = 5;
config.state_machine = "data";
config.ftwindow_width = 32; config.amp_scale = 132E3;
config.EsNo_est_all_symbols = 0; config.amp_est_mode = 1; config.EsNodB = 10;
config.amp_est_mode = 1; config.EsNodB = 10;
elseif strcmp(mode,"qam16c2")
Ns=5; config.Np=31; Tcp = 0.004; Ts = 0.016; Nc = 33; config.data_mode = "streaming";
config.bps=4; config.Ntxtbits = 0; config.Nuwbits = 42*4; config.bad_uw_errors = 15;
config.bps=4; config.Ntxtbits = 0; config.Nuwbits = 42*4; config.bad_uw_errors = 50;
config.ftwindow_width = 80; config.amp_scale = 135E3; config.state_machine = "data";
config.EsNo_est_all_symbols = 0; config.amp_est_mode = 1; config.EsNodB = 10;
config.amp_est_mode = 1; config.EsNodB = 10;
config.tx_uw = zeros(1,config.Nuwbits = 42*4);
config.tx_uw(1:24) = [1 1 0 0 1 0 1 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0];
config.tx_uw(end-24+1:end) = [1 1 0 0 1 0 1 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0];
Expand Down Expand Up @@ -134,6 +133,18 @@
config.state_machine = "data";
config.amp_scale = 2.5*300E3; config.clip_gain1 = 1.2; config.clip_gain2 = 1.0;
config.txbpf_width_Hz = 400;
elseif strcmp(mode,"datac14")
Ns=5; config.Np=4; Tcp = 0.005; Ts = 0.018; Nc = 4; config.data_mode = "streaming";
config.edge_pilots = 0;
config.Ntxtbits = 0; config.Nuwbits = 32; config.bad_uw_errors = 12;
config.ftwindow_width = 80; config.timing_mx_thresh = 0.45;
config.tx_uw = zeros(1,config.Nuwbits);
config.tx_uw(1:24) = [1 1 0 0 1 0 1 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0];
config.tx_uw(end-24+1:end) = [1 1 0 0 1 0 1 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0];
config.amp_est_mode = 1; config.EsNodB = 3;
config.state_machine = "data";
config.amp_scale = 2*300E3; config.clip_gain1 = 2; config.clip_gain2 = 1;
config.txbpf_width_Hz = 400;
elseif strcmp(mode,"1")
Ns=5; config.Np=10; Tcp=0; Tframe = 0.1; Ts = Tframe/Ns; Nc = 1;
else
Expand Down Expand Up @@ -231,9 +242,17 @@
code_param.coded_bits_per_frame = code_param.data_bits_per_frame + code_param.ldpc_parity_bits_per_frame;
code_param.coded_syms_per_frame = code_param.coded_bits_per_frame/code_param.bits_per_symbol;
end
if strcmp(mode, "datac14")
load HRA_56_56.txt
code_param = ldpc_init_user(HRA_56_56, modulation, mod_order, mapping);
code_param.data_bits_per_frame = 40;
code_param.coded_bits_per_frame = code_param.data_bits_per_frame + code_param.ldpc_parity_bits_per_frame;
code_param.coded_syms_per_frame = code_param.coded_bits_per_frame/code_param.bits_per_symbol;
end
if strcmp(mode, "datac0") || strcmp(mode, "datac1") || strcmp(mode, "datac3") ...
|| strcmp(mode, "datac4") || strcmp(mode, "qam16c1") ...
|| strcmp(mode, "qam16c2") || strcmp(mode, "datac5") || strcmp(mode, "datac13")
|| strcmp(mode, "qam16c2") || strcmp(mode, "datac5") || strcmp(mode, "datac13") ...
|| strcmp(mode, "datac14")
printf("ldpc_data_bits_per_frame = %d\n", code_param.ldpc_data_bits_per_frame);
printf("ldpc_coded_bits_per_frame = %d\n", code_param.ldpc_coded_bits_per_frame);
printf("ldpc_parity_bits_per_frame = %d\n", code_param.ldpc_parity_bits_per_frame);
Expand Down
4 changes: 3 additions & 1 deletion octave/ofdm_rx.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ function ofdm_rx(filename, mode="700D", varargin)
Nerrs = 0; rx_uw = zeros(1,states.Nuwbits);

% main loop ----------------------------------------------------------------


rx = ofdm_rx_filter(states, mode, rx);

f = 1;
while(prx < Nsam)

Expand Down
2 changes: 1 addition & 1 deletion octave/qam16.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function test_qam16_mod_demod(constellation)
for decimal=0:15
tx_bits = zeros(1,4);
for i=1:4
tx_bits(1,5-i) = bitand(bitshift(decimal-1,1-i),1);
tx_bits(1,5-i) = bitand(bitshift(decimal,1-i),1);
end
symbol = qam16_mod(constellation, tx_bits);
rx_bits = qam16_demod(constellation,symbol);
Expand Down
Loading
Loading