new_chk_overflow.m

来自「计算LDPC码理论性能的MATLAB程序,有例子说明,对通信系统设计很有帮助!」· M 代码 · 共 23 行

M
23
字号
function y = new_chk_overflow(f_n_ext,ofl_pos,ofl_neg,ext,mapping)m_pos_index = round((2*atanh(exp(-mapping(2)/2)) - ext(1))/ext(2)) + 1;m_neg_index = round((-2*atanh(exp(-mapping(2)/2)) - ext(1))/ext(2)) + 1;if (m_pos_index < ext(3))	f_n_ext(m_pos_index) = f_n_ext(m_pos_index) + ofl_pos/ext(2);else	f_n_ext(ext(3)) = f_n_ext(ext(3)) + ofl_pos/ext(2);endif (m_neg_index > 1)	f_n_ext(m_neg_index) = f_n_ext(m_neg_index) + ofl_neg/ext(2);else	f_n_ext(1) = f_n_ext(1) + ofl_neg/ext(2);	% Thanks to Sang Hyun Lee for spotting this errorend% actually, the if-then should be unnecessary, by the nature of overflow ... but % then we'd have to check whether ofl_pos or ofl_neg was zeroy = f_n_ext;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?