📄 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 + -