?? vco.h
字號:
#include "systemc-ams.h"SCA_SDF_MODULE(vco) { sca_sdf_in<double> in; sca_sdf_out<double> out; double gain; // gain double kvco; // sensitivity [Hz/V] double fc; // central frequency [Hz] double vfc; // control voltage to get FC double wc; // central pulsation [rad/s] double kvcor; // sensitivity [rad/(s*V) bool debug_init; void init() { wc = 2.0*M_PI*fc; kvcor = 2.0*M_PI*kvco; } void sig_proc() { if (debug_init) { cout << name() << ": " << " gain = " << gain << " kvco = " << kvco << " fc = " << fc << " vfc = " << vfc << " wc = " << wc << " kvcor = " << kvcor << endl; debug_init = 0; } double tn = sc_time_stamp().to_seconds(); double wvco = (wc + kvcor*(in.read() - vfc));/* cout << name() << ": t = " << tn << " wvco = " << wvco << endl;*/ out.write(gain*sin(wvco*tn)); } SCA_CTOR(vco) { debug_init = 1; }}; // vco
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -