⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 deinterleaving.cpp

📁 在vc上做的802.16d ofdm phy的仿真
💻 CPP
字号:
/***************************************************************************
 * Copyright (c) 2003, Coast Co. Ltd.
 *
 * All rights reserved.
 *
 * 
 * Filename:deInterleaving.cpp
 *
 * File Description:
 *	 
 *	Implementation of the deInterleaving defined in IEEE 802.16 OFDM.
 * -------------------------------------------------------------------------
 *
 * Revision:1.0
 * Author :Liu TingTing
 * Date   :20/03/2004
 *
 * Revision Details
 * -----------------------------------------
 *
 ****************************************************************************/



/*****************************************************************************
 * Include Files
 ****************************************************************************/

#include "global_var.h"
#include "typedef.h"


/*****************************************************************************
 *   Function      : Int16 deInterleaving()
 *
 *	input:
 *	  *pDeInterleavingIn   : pointer to the input bits
 *	  Ncbps  : the number of coded bits per the allocated subchannels per OFDM symbol
 *	  Ncpc	 : the number of coded bits per subcarrier
 *
 *	output:
 *	  *pDeInterleavingOut   : pointer to the output bits
 ****************************************************************************/
void deInterleaving (Int8   *pDeInterleaverIn,
					 Uint16 Ncbps,
					 Uint8  Ncpc,
					 Int8   *pDeInterleaverOut)
{
	Int16 halfNum;
	Int16 prePermutIndex, firstPermutIndex, secondPermutIndex;

	halfNum = Ncpc == 1 ? 1 : (Ncpc >> 1);				    

    for (prePermutIndex = 0; prePermutIndex < Ncbps; prePermutIndex++)
	{
        firstPermutIndex = halfNum * (prePermutIndex / halfNum) 
	       + (prePermutIndex + 12 * prePermutIndex / Ncbps) % halfNum;

	    secondPermutIndex = 12 * firstPermutIndex - (Ncbps - 1) * (12 * firstPermutIndex / Ncbps);
        
	    pDeInterleaverOut[secondPermutIndex] = pDeInterleaverIn[prePermutIndex];
	}
}


⌨️ 快捷键说明

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