📄 produce_whitenoise.cpp
字号:
// Produce_WhiteNoise.cpp : implementation file
//
#include "stdafx.h"
#include "Watertank.h"
#include "Produce_WhiteNoise.h"
#include "math.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Produce_WhiteNoise
IMPLEMENT_DYNCREATE(Produce_WhiteNoise, CCmdTarget)
Produce_WhiteNoise::Produce_WhiteNoise()
{
}
Produce_WhiteNoise::~Produce_WhiteNoise()
{
}
BEGIN_MESSAGE_MAP(Produce_WhiteNoise, CCmdTarget)
//{{AFX_MSG_MAP(Produce_WhiteNoise)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Produce_WhiteNoise message handlers
void Produce_WhiteNoise::Initial()
{
Parameter_A=353;
Parameter_f=2;
Parameter_k=19;
Parameter_shift=0.5;
Array[0]=1;
Array[1]=0;
Array[2]=0;
Outdata=0;
}
double Produce_WhiteNoise::ProduceWhiteNoise()
{
Array[2]=Parameter_A*Array[0];
Array[1]=Array[2]%((int)pow(2,Parameter_k)-1);
Array[0]=Array[1];
Outdata=((double)Array[1]/pow(2,Parameter_k)-Parameter_shift)*Parameter_f;
return Outdata;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -