Commit 995e48af authored by Stefan Westerfeld's avatar Stefan Westerfeld

Fix all pattern normalization if only A (or only B) blocks are found.

Signed-off-by: Stefan Westerfeld's avatarStefan Westerfeld <stefan@space.twc.de>
parent af2f3529
......@@ -1202,8 +1202,8 @@ decode_and_report (const WavData& wav_data, const string& orig_pattern)
{
for (size_t i = 0; i < raw_bit_vec_all.size(); i += 2)
{
raw_bit_vec_all[i] /= raw_bit_vec_norm[0]; /* normalize A soft bits with number of A blocks */
raw_bit_vec_all[i + 1] /= raw_bit_vec_norm[1]; /* normalize B soft bits with number of B blocks */
raw_bit_vec_all[i] /= max (raw_bit_vec_norm[0], 1); /* normalize A soft bits with number of A blocks */
raw_bit_vec_all[i + 1] /= max (raw_bit_vec_norm[1], 1); /* normalize B soft bits with number of B blocks */
}
vector<float> soft_bit_vec = normalize_soft_bits (raw_bit_vec_all);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment