#if !defined(_NOISE_H_20191117_1047_)
#define _NOISE_H_20191117_1047_


class CNoise
{
public:
	int   m_nNoiseSense;

	int   m_nStyle;            //频率范围类型,0=倍频程,1-1/3倍频程,2=用户定制
	int   m_nSpectrumCount;    //中心频率的个数
	float m_fsSpectrum[30 + 1][3]; //中心频率及频率范围

	//测量值
	float m_fsNoiseDB[30 + 1][3];

public:
	void SetNoiseSense(int nAdjustMethod) {m_nAdjustMethod = nAdjustMethod;}
	int  GetNoiseSense() {return (m_nAdjustMethod);}

	//得到频率分段的个数
	int  GetSpectrumCount(){return (m_nSpectrumCount);}
	//得到指到索引的频段
	void GetSpectrumIndex(int nIndex, float* pfMin, float* pfCenter, float* pfMax);
	//得到指到索引的频段
	void SetSpectrumIndex(int nIndex, float fMin, float fCenter, float pfMax);

	//设置分析类型
	void SetStyle(int nStyle, BOOL bAdjust);

	//调整中心频率及频率范围	
	void AdjustSpectrum(int nStyle);

	//设置噪音的测试标准
	void  SetNoiseRange(int nIndex, float fMin, float fMax);
	//获得噪音的测试标准
	void  GetNoiseRange(int nIndex, float* pfMin, float* pfMax);

	//设置噪音的测量值
	void  SetNoise(int nIndex, float fNoise);
	//得到噪音的测量值
	float GetNoise(int nIndex);
	//清除噪音的测量值
	void  ClearNoise();
public:
	//构造函数
	CNoise();
	//析构函数
	~CNoise();
};

void IFFT_ComplexEx(float* pfRealX, float* pfImageX, unsigned int wCount);

//带阻
void FFT_BeldStop(float* pfRealX, float* pfImageX, int nCount, double dbFreqS, double dbFreqE, double dbSampleFreq);
//带通
void FFT_BeldPass(float* pfRealX, float* pfImageX, int nCount, double dbFreqS, double dbFreqE, double dbSampleFreq);
//FFT到峰值
void FFTToPeak(float* pfTarget, float* pfRealX, float* pfImageX, int nCount);


#endif