应用于无线通信的OFDM解调和RS解码源程序。64点FFT

源代码在线查看: function.h

软件大小: 25 K
上传用户: chenqiyun1990
关键词: OFDM FFT 应用于 无线通信
下载地址: 免注册下载 普通下载 VIP

相关代码

				/* FFT function:
				 * Real[] is the real part of complex input/output data;
				 * Imag[] is the imaginary part of complex input/output data;
				 * FFTSize is the data length equal to 2^M;
				 * Sign represents the FFT() function: 1  -> FFT
				 *                                     -1 -> IFFT;
				 * Results are stored back in Real[] and Imag[];
				 */
				void FFT(int Real[], int Imag[], WordType sign);
				
				/* CONVBASE Converts the number base of the input data (DataIn):
				 *   ConvBase(DType DataIn[], DType DataOut[], DType DataLen, DType sign)
				 * From the current base (CurrBase) to the new base required (NewBase);
				 * If the new base is less than the old base, e.g
				 * NewBase = 2 and CurrBase = 8, the DataOut will have more
				 * data words. For the above example DataOut will be 4 times
				 * longer than DataIn;
				 * The actual base used = 2^NewBase, thus NewBase = 8, is base 256;
				 * E.g. DataIn = [ 2 64 20 ] with CurrBase = 8, NewBase = 2
				 * DataOut = [2 0 0 0, 0 0 0 1, 0 1 1 0]
				 * Note : Both the input and output data is in a serial format;
				 * DataLen is the length of DataIn[];
				 * Sign represents the ConvBase() function: 1 -> NewBase < CurrBase
				 *                                          0 -> NewBase > CurrBase;
				 *                                          Other -> No change;
				 */
				void ConvBase(DType DataIn[], DType DataOut[], WordType DataLen, WordType Sign);
				
				/* Convert 2-bit binary code to Gray code */
				void Gray2(DType DataIn[], WordType Length);
				
				/* Change the source data format to fit the channel encoder */
				void SrcToChan(short SrcData[], DType ReqData[], WordType SymbolMark[], WordType BitMark[]);
				
				/* Change the data format to fit the source decoder */
				void ChanToSrc(DType ChannelData[], short SrcData[], WordType PosMark[]);
				
				/* Round the data to nearest integer */
				WordType Round(float RealData);
				
				/* Generates a pseudorandom number:
				 * *Seed is the seed of this function;
				 * RandMax is the maximum number of pseudorandom;
				 */
				unsigned short Random(unsigned int *Seed, unsigned short RandMax);			

相关资源