void RigidBodyDynamics::Advance(Real dt) { Vector3 dv = Accel(); Vector3 dw = AngularAccel(); v += dt*dv; w += dt*dw; T.t += dt*v; QuaternionRotation q,qw; q.setMatrix(T.R); qw.setMoment(w*dt); q = q*qw; q.inplaceNormalize(); q.getMatrix(T.R); }
/** * Convert wave data to MFCC. Also does spectral subtraction * if @a ssbuf specified. * * @param wave [in] waveform data * @param mfcc [out] buffer to store the resulting MFCC parameter vector [t][0..veclen-1], should be already allocated * @param para [in] configuration parameters * @param nSamples [in] length of waveform data * @param w [i/o] MFCC calculation work area * * @return the number of processed frames. */ int Wav2MFCC(SP16 *wave, float **mfcc, Value *para, int nSamples, MFCCWork *w, CMNWork *c) { int i, k, t; int end = 0, start = 1; int frame_num; /* Number of samples in output file */ /* set noise spectrum if any */ if (w->ssbuf != NULL) { /* check ssbuf length */ if (w->ssbuflen != w->bflen) { jlog("Error: mfcc-core: noise spectrum length not match\n"); return FALSE; } } frame_num = (int)((nSamples - para->framesize) / para->frameshift) + 1; for(t = 0; t < frame_num; t++){ if(end != 0) start = end - (para->framesize - para->frameshift) - 1; k = 1; for(i = start; i <= start + para->framesize; i++){ w->bf[k] = (float)wave[i - 1]; k++; } end = i; /* Calculate base MFCC coefficients */ WMP_calc(w, mfcc[t], para); } /* Normalise Log Energy */ if (para->energy && para->enormal) NormaliseLogE(mfcc, frame_num, para); /* Delta (consider energy suppress) */ if (para->delta) Delta(mfcc, frame_num, para); /* Acceleration */ if (para->acc) Accel(mfcc, frame_num, para); /* Cepstrum Mean and/or Variance Normalization */ if (para->cmn && ! para->cvn) CMN(mfcc, frame_num, para->mfcc_dim + (para->c0 ? 1 : 0), c); else if (para->cmn || para->cvn) MVN(mfcc, frame_num, para, c); return(frame_num); }
void CAppWnd::OnCreate(const CRect& rcClient) { // // Create and attach the components. // m_Accel.LoadRsc(IDR_APPACCEL); Accel(&m_Accel); m_Menu.LoadRsc(IDR_APPMENU); Menu(&m_Menu); m_StatusBar.Create(*this, IDC_STATUS_BAR, rcClient); StatusBar(&m_StatusBar); m_AppDlg.RunModeless(*this); // Call base class. CDlgFrame::OnCreate(rcClient); }