File: BlockcodeScenarios.m

package info (click to toggle)
codec2 1.2.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 76,376 kB
  • sloc: ansic: 436,819; cpp: 2,091; objc: 1,736; sh: 1,510; python: 1,405; asm: 683; makefile: 605
file content (129 lines) | stat: -rw-r--r-- 5,543 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
% File BlockcodeScenarios
%
% This is a set of scenarios for the Coded Modulation Library.
%
% The simulations specified in this file are for cyclic block codes,
% with APP decoding.
%
% Last updated on Oct. 12, 2007

% determine where your root directory is
load( 'CmlHome.mat' );

% determine where to store your files
base_name = 'blockcode';
if ispc
    data_directory = strcat( '\output\', base_name, '\' );
else
    data_directory = strcat( '/output/', base_name, '/' );
end

full_directory = strcat( cml_home, data_directory );
if ~exist( full_directory, 'dir' )
    mkdir( full_directory);
end

% A cyclic block code is a rate 1 convolutional code with trellis
% termination
record = 1; % don't change this record number
sim_param(record).comment = '(23,12) Nonsystematic Golay code';
sim_param(record).sim_type = 'coded';
sim_param(record).code_configuration = 0;
sim_param(record).SNR = [0:0.5:8];
sim_param(record).SNR_type = 'Eb/No in dB';
sim_param(record).framesize = 12; % This is k
sim_param(record).modulation = 'BPSK';
sim_param(record).mod_order = 2;
sim_param(record).channel = 'AWGN';
sim_param(record).bicm = 1; % does not matter for BPSK
sim_param(record).linetype = 'k-';
sim_param(record).legend = sim_param(record).comment;
sim_param(record).g1 = [1 0 1 0 1 1 1 0 0 0 1 1];
sim_param(record).nsc_flag1 = 1;
sim_param(record).decoder_type = 0; % log-MAP decoding (i.e. APP)
% sim_param(record).filename = strcat( data_directory, 'GolayAWGN.mat');
sim_param(record).filename = strcat( data_directory, base_name, int2str(record), '.mat' );
sim_param(record).reset = 0;
sim_param(record).max_trials = 1e7*ones( size(sim_param(record).SNR) );
sim_param(record).minBER = 2e-5; 
sim_param(record).max_frame_errors = 301*ones( size(sim_param(record).SNR) );
sim_param(record).save_rate = 1e3;

% (23,12) Golay code in systematic form
record = 2;  % don't change this record number
sim_param(record).comment = '(23,12) Systematic Golay code';
sim_param(record).sim_type = 'coded';
sim_param(record).code_configuration = 0;
sim_param(record).SNR = [0:0.5:8];
sim_param(record).SNR_type = 'Eb/No in dB';
sim_param(record).framesize = 12;  % This is k
sim_param(record).modulation = 'BPSK';
sim_param(record).mod_order = 2;
sim_param(record).channel = 'AWGN';
sim_param(record).bicm = 1; % does not matter for BPSK
sim_param(record).linetype = 'b-';
sim_param(record).legend = sim_param(record).comment;
sim_param(record).g1 = [1 0 1 0 1 1 1 0 0 0 1 1];
sim_param(record).nsc_flag1 = 0;
sim_param(record).decoder_type = 0; % log-MAP decoding (i.e. APP)
% sim_param(record).filename = strcat( data_directory, 'GolaySystematicAWGN.mat');
sim_param(record).filename = strcat( data_directory, base_name, int2str(record), '.mat' );
sim_param(record).reset = 0;
sim_param(record).max_trials = 1e7*ones( size(sim_param(record).SNR) );
sim_param(record).minBER = 2e-5;  
sim_param(record).max_frame_errors = 300*ones( size(sim_param(record).SNR) );
sim_param(record).save_rate = 1e3;

record = 3; % don't change this record number
sim_param(record).comment = '(15,10) Nonsystematic Expurgated Hamming code';
sim_param(record).sim_type = 'coded';
sim_param(record).code_configuration = 0;
sim_param(record).SNR = [0:0.5:8];
sim_param(record).SNR_type = 'Eb/No in dB';
sim_param(record).framesize = 10; % This is k
sim_param(record).modulation = 'BPSK';
sim_param(record).mod_order = 2;
sim_param(record).channel = 'AWGN';
sim_param(record).bicm = 1; % does not matter for BPSK
sim_param(record).linetype = 'r-';
sim_param(record).legend = sim_param(record).comment;
sim_param(record).g1 = [1 0 1 0 1 1] ;
sim_param(record).nsc_flag1 = 1;
sim_param(record).decoder_type = 0; % log-MAP decoding (i.e. APP)
%sim_param(record).filename = strcat( data_directory, 'HammingAWGN.mat');
sim_param(record).filename = strcat( data_directory, base_name, int2str(record), '.mat' );
sim_param(record).reset = 0;
sim_param(record).max_trials = 1e7*ones( size(sim_param(record).SNR) );
sim_param(record).minBER = 2e-5;  
sim_param(record).max_frame_errors = 301*ones( size(sim_param(record).SNR) );
sim_param(record).save_rate = 1e3;

record = 4; % don't change this record number
sim_param(record).comment = '(15,10) Systematic Expurgated Hamming code';
sim_param(record).sim_type = 'coded';
sim_param(record).code_configuration = 0;
sim_param(record).SNR = [0:0.5:8];
sim_param(record).SNR_type = 'Eb/No in dB';
sim_param(record).framesize = 10; % This is k
sim_param(record).modulation = 'BPSK';
sim_param(record).mod_order = 2;
sim_param(record).channel = 'AWGN';
sim_param(record).bicm = 1; % does not matter for BPSK
sim_param(record).linetype = 'm-';
sim_param(record).legend = sim_param(record).comment;
sim_param(record).g1 = [1 0 1 0 1 1] ;
sim_param(record).nsc_flag1 = 0;
sim_param(record).decoder_type = 0; % log-MAP decoding (i.e. APP)
% sim_param(record).filename = strcat( data_directory, 'BluetoothAWGN.mat');
sim_param(record).filename = strcat( data_directory, base_name, int2str(record), '.mat' );
sim_param(record).reset = 0;
sim_param(record).max_trials = 1e7*ones( size(sim_param(record).SNR) );
sim_param(record).minBER = 2e-5;  
sim_param(record).max_frame_errors = 300*ones( size(sim_param(record).SNR) );
sim_param(record).save_rate = 1e3;

% To add a new record, cut and paste one of the above records.
% Change record number to be one higher than the last used.
% Modify parameters as desired.