Skip to content

Commit 638e261

Browse files
committed
added some debug code to dig into failure
1 parent e24c6b0 commit 638e261

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

octave/trellis.m

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
max_prob = -100;
172172
do
173173

174-
if verbose
174+
if bitand(verbose, 0x4)
175175
printf(" ");
176176
for s=1:nstages
177177
printf("%4d", n(s)-1);
@@ -186,12 +186,12 @@
186186
prob = 0;
187187
for s=1:nstages
188188
prob += txp(s, n(s));
189-
if verbose
189+
if bitand(verbose,0x4)
190190
printf("%8.2f ", txp(s, n(s)));
191191
end
192192
if s < nstages
193193
prob += tp(s, n(s), n(s+1));
194-
if verbose
194+
if bitand(verbose,0x4)
195195
printf("%8.2f ", tp(s, n(s), n(s+1)));
196196
end
197197
end
@@ -202,7 +202,7 @@
202202
max_n = n;
203203
end
204204

205-
if verbose
205+
if bitand(verbose,0x4)
206206
printf("%9.2f %9.2f\n", prob, max_prob);
207207
end
208208

@@ -316,7 +316,7 @@
316316
C = precompute_C(nbits);
317317

318318
% Vector Quantise target vectors sequence
319-
[tx_indexes target_ ] = vector_quantiser_fast(vq, target, verbose=0);
319+
[tx_indexes target_ ] = vector_quantiser_fast(vq, target, verbose);
320320
% use convention of indexes starting from 0
321321
tx_indexes -= 1;
322322
% mean SD of VQ with no errors
@@ -419,6 +419,11 @@
419419
% run a test
420420
EbNo=10^(EbNodB/10);
421421
results = run_test(target, vq, sd_table, h_table, ntxcw, nstages, EbNo, verbose);
422+
if verbose
423+
for f=2:nframes-1
424+
printf("f: %03d tx_index: %04d rx_index: %04d\n", f, results.tx_indexes(f), results.rx_indexes(f));
425+
end
426+
end
422427
endfunction
423428

424429
% Plot histograms of SD at different decimations in time

0 commit comments

Comments
 (0)