MCPcopy Create free account
hub / github.com/F-Stack/f-stack / gen_turbo_llr

Function gen_turbo_llr

dpdk/app/test-bbdev/test_bbdev_perf.c:1796–1817  ·  view source on GitHub ↗

Simple LLR generation assuming AWGN and QPSK */

Source from the content-addressed store, hash-verified

1794
1795/* Simple LLR generation assuming AWGN and QPSK */
1796static void
1797gen_turbo_llr(int8_t *llrs, uint32_t j, double N0, double llr_max)
1798{
1799 double b, b1, n;
1800 double coeff = 2.0 * sqrt(N0);
1801
1802 /* Ignore in vectors null LLRs not to be saturated */
1803 if (llrs[j] == 0)
1804 return;
1805
1806 /* Note don't change sign here */
1807 n = randn(j % 2);
1808 b1 = ((llrs[j] > 0 ? 2.0 : -2.0)
1809 + coeff * n) / N0;
1810 b = b1 * (1 << 4);
1811 b = round(b);
1812 if (b > llr_max)
1813 b = llr_max;
1814 if (b < -llr_max)
1815 b = -llr_max;
1816 llrs[j] = (int8_t) b;
1817}
1818
1819/* Generate LLR for a given SNR */
1820static void

Callers 1

generate_turbo_llr_inputFunction · 0.85

Calls 1

randnFunction · 0.85

Tested by

no test coverage detected