genfading.h

来自「无线信道模型的仿真程序」· C头文件 代码 · 共 31 行

H
31
字号
#include <valarray>
#include <math.h>

const double PI = 3.14159265;

using namespace std;

class CFadingEnergyGenerator
{
public:
	void Initialize(int n, double fd);
	void Update(int numOfSteps);
	void GetPwrDB(double *pDbArray); // power in dB
	void SetN(int n);
	void GetN(int *pN);
	void SetFd(double fd);
	void GetFd(double *pFd);
	void GetComplexEnvelope(double *pRealArray,double *pImagArray); // complex fading coefficients
	void GetMag(double *pMagArray); // absolute magnitude

private:
	double   m_maxOmega;		// 2*pi*fd

	// number of oscillators used and number of output needed
	unsigned int	m_nos, m_branchNumber;

	valarray<double> m_cosBeta, m_sinBeta, m_theta, m_omega, m_coeffReal, m_coeffImag;

	// z is the output of n-dimension fast Walsh transform from input x
	void fwt(valarray<double> & z, valarray<double> & x, unsigned int n);
};

⌨️ 快捷键说明

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