From: drowe67 Date: Sun, 11 Jun 2017 21:59:06 +0000 (+0000) Subject: added function to generate a C include file of tets bits, just single frame for now X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=39588cc816b2b954764caa5796e55ebaa6120fd1;p=freetel-svn-tracking.git added function to generate a C include file of tets bits, just single frame for now git-svn-id: https://svn.code.sf.net/p/freetel/code@3169 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/octave/ofdm_dev.m b/codec2-dev/octave/ofdm_dev.m index 17e87fb9..f6cd831a 100644 --- a/codec2-dev/octave/ofdm_dev.m +++ b/codec2-dev/octave/ofdm_dev.m @@ -183,6 +183,7 @@ function [sim_out rx states] = run_sim(sim_in) % note for reasons unknown LdpcEncode() returns garbage if we use > 0.5 rather than round() tx_data_bits = round(rand(1,Nbits*rate)); + %test_bits_ofdm_file(tx_data_bits); tx_bits = []; tx_symbols = []; for f=1:Nframes @@ -524,14 +525,14 @@ function run_single(EbNodB = 100, error_pattern_filename); sim_in.Tcp = 0.002; sim_in.Rs = 1/Ts; sim_in.bps = 2; sim_in.Nc = 16; sim_in.Ns = 8; - %sim_in.Nsec = 2*(sim_in.Ns+1)/sim_in.Rs; % one frame - sim_in.Nsec = 50; + sim_in.Nsec = (sim_in.Ns+1)/sim_in.Rs; % one frame, make sure sim_in.interleave_frames = 1 + %sim_in.Nsec = 1; sim_in.EbNodB = EbNodB; - sim_in.verbose = 1; - sim_in.hf_en = 1; + sim_in.verbose = 2; + sim_in.hf_en = 0; sim_in.foff_hz = 0; - sim_in.dfoff_hz_per_sec = 0.02; + sim_in.dfoff_hz_per_sec = 0.00; sim_in.sample_clock_offset_ppm = 0; sim_in.timing_en = 1; @@ -542,7 +543,7 @@ function run_single(EbNodB = 100, error_pattern_filename); sim_in.ldpc_code = HRA_112_112; sim_in.ldpc_en = 1; - sim_in.interleave_frames = 32; + sim_in.interleave_frames = 1; %sim_in.diversity_en = 1; @@ -990,8 +991,8 @@ more off; init_cml('/home/david/Desktop/cml/'); -%run_single(6) -run_curves +run_single(6) +%run_curves %run_curves_estimators %acquisition_histograms %acquisition_test diff --git a/codec2-dev/octave/ofdm_lib.m b/codec2-dev/octave/ofdm_lib.m index 605d6bfe..ef09b6a2 100644 --- a/codec2-dev/octave/ofdm_lib.m +++ b/codec2-dev/octave/ofdm_lib.m @@ -4,9 +4,7 @@ #{ Library of functions that implement a BPSK/QPSK OFDM modem. Rate Fs verison of ofdm_rs.m with OFDM based up and down conversion, and all - those nasty real-world details like fine freq, timing. - - + those nasty real-world details like fine freq, timing. #} @@ -414,3 +412,18 @@ function [rx_bits states aphase_est_pilot_log rx_np rx_amp] = ofdm_demod(states, states.foff_est_hz = foff_est_hz; endfunction + +% Save test bits frame to a text file in the form of a C array + +function test_bits_ofdm_file(test_bits_ofdm) + + f=fopen("../src/test_bits_ofdm.h","wt"); + fprintf(f,"/* Generated by test_bits_ofdm_file() Octave function */\n\n"); + fprintf(f,"const int test_bits_ofdm[]={\n"); + for m=1:length(test_bits_ofdm)-1 + fprintf(f," %d,\n",test_bits_ofdm(m)); + endfor + fprintf(f," %d\n};\n",test_bits_ofdm(length(test_bits_ofdm))); + fclose(f); + +endfunction diff --git a/codec2-dev/src/test_bits_ofdm.h b/codec2-dev/src/test_bits_ofdm.h new file mode 100644 index 00000000..acbed019 --- /dev/null +++ b/codec2-dev/src/test_bits_ofdm.h @@ -0,0 +1,116 @@ +/* Generated by test_bits_ofdm_file() Octave function */ + +const int test_bits_ofdm[]={ + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 0, + 0, + 0, + 1, + 1, + 1, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 0, + 0, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1, + 1, + 0, + 1, + 0, + 1, + 0, + 1, + 1, + 0, + 1, + 1, + 0, + 1, + 0, + 0, + 1, + 0, + 1, + 0, + 0, + 0, + 1, + 1, + 1, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1, + 0, + 0, + 1, + 1, + 1, + 0, + 0, + 1, + 1, + 1, + 0 +};