|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% finite bandwidth & slew-rate %
% error calculation %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
deltaV=abs(threshold_id-threshold(i-1));
slope=deltaV/tau;
if slope > sr
tslew=(deltaV/sr) - tau;
if tslew >= Tmax % only slewing
error = deltaV - sr*Tmax;
else
texp = Tmax - tslew;
error = (deltaV-sr*tslew)*exp(-texp/tau);
end
else
% only exponential settling
texp = Tmax;
error = deltaV*exp(-texp/tau);
end
threshold(i) = threshold_id - sign(threshold_id-threshold(i-1))*error;
大神们能不能帮忙解释下,上面这段Approx代码的意思啊,这是在校正什么呢?
下面是这个函数的开头
function [counter,thresholds]=Approx_2_hl(input,nbit,f_bw,sr,f_s,v)
% input= input sample
% nbit= number of converter bits
% f_bw= DAC bandwidth [f_s]
% sr= DAC slew-rate [V_fs/T_s]
% f_s= normalized sampling frequency |
|