set fixed print precision once

This commit is contained in:
Ahmet Inan 2025-07-11 23:08:05 +02:00
commit 87eae6675a
2 changed files with 4 additions and 2 deletions

View file

@ -352,7 +352,7 @@ struct Decoder : Common
}
}
DSP::quick_sort(snr, symbol_count);
std::cerr << "Es/N0 (dB): " << std::fixed << std::setprecision(1) << DSP::decibel(snr[0]) << " .. " << DSP::decibel(snr[symbol_count/2]) << " .. " << DSP::decibel(snr[symbol_count-1]) << std::endl;
std::cerr << "Es/N0 (dB): " << DSP::decibel(snr[0]) << " .. " << DSP::decibel(snr[symbol_count/2]) << " .. " << DSP::decibel(snr[symbol_count-1]) << std::endl;
crc_bits = data_bits + 32;
shuffle(code, perm);
polar_decoder(nullptr, mesg, code, frozen_bits, code_order);
@ -411,6 +411,7 @@ int main(int argc, char **argv)
return 1;
}
std::cerr << std::fixed << std::setprecision(1);
int output_count = argc - 2;
switch (input_file.rate()) {
case 8000:

View file

@ -294,7 +294,7 @@ struct Encoder : public Common
symbol(j);
}
DSP::quick_sort(papr, symbol_count);
std::cerr << "PAPR (dB): " << std::fixed << std::setprecision(1) << DSP::decibel(papr[0]) << " .. " << DSP::decibel(papr[symbol_count/2]) << " .. " << DSP::decibel(papr[symbol_count-1]) << std::endl;
std::cerr << "PAPR (dB): " << DSP::decibel(papr[0]) << " .. " << DSP::decibel(papr[symbol_count/2]) << " .. " << DSP::decibel(papr[symbol_count-1]) << std::endl;
}
finish();
}
@ -330,6 +330,7 @@ int main(int argc, char **argv)
std::cerr << "Unsupported frequency offset." << std::endl;
return 1;
}
std::cerr << std::fixed << std::setprecision(1);
typedef float value;
typedef DSP::Complex<value> cmplx;
DSP::WriteWAV<value> output_file(output_name, output_rate, output_bits, output_chan);