jettable.cpp

来自「Mobile STK for Symbian OS V0.1」· C++ 代码 · 共 40 行

CPP
40
字号
/***************************************************//*! \class JetTable    \brief STK jet table class.    This class implements a flue jet non-linear    function, computed by a polynomial calculation.    Contrary to the name, this is not a "table".    Consult Fletcher and Rossing, Karjalainen,    Cook, and others for more information.    by Perry R. Cook and Gary P. Scavone, 1995 - 2005.*//***************************************************/#include "JetTable.h"JetTable :: JetTable() : Function(){}JetTable :: ~JetTable(){}StkFloat JetTable :: computeSample( StkFloat input ){  // Perform "table lookup" using a polynomial  // calculation (x^3 - x), which approximates  // the jet sigmoid behavior.  lastOutput_ = input * (input * input - (StkFloat)  1.0);  // Saturate at +/- 1.0.  if (lastOutput_ > 1.0)     lastOutput_ = (StkFloat) 1.0;  if (lastOutput_ < -1.0)    lastOutput_ = (StkFloat) -1.0;   return lastOutput_;}

⌨️ 快捷键说明

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