|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
扰动法lms校准SAR ADC matlab遇到了问题,error也没什么效果
LSB给的30,uw,ud都是2e-3。失配给的5%,大佬能不能帮我看下问题。
另外有个疑问,dither所加的vin是要给个sin波吗,还是固定就好。
Vip = 0.3*Vref/(sqrt(1+(2*pi*fs*k)^2*(R*C)^2))*sin(2*pi*fin*k*(ts*t-R*C+del_jitter*randn(1,1)))+Vcm+dither_LSB*LSB;
Vin = -0.3*Vref/(sqrt(1+(2*pi*fs*k)^2*(R*C)^2))*sin(2*pi*fin*k*(ts*t-R*C+del_jitter*randn(1,1)))+Vcm-dither_LSB*LSB;
[dout1(t),adout1(t,]= (adc_sar_diff(Vip,Vin,Vref,Vcm,M,Cm_p,Cm_n,Cd1_p,Cd1_n,Cp1_p,Cp1_n,Comp_os,del_Compvn,del_ktc,weight));
dout1(t)=floor(dout1(t));
adout1(t, = floor(adout1(t,);
Vip = 0.3*Vref/(sqrt(1+(2*pi*fs*k)^2*(R*C)^2))*sin(2*pi*fin*k*(ts*t-R*C+del_jitter*randn(1,1)))+Vcm-dither_LSB*LSB;
Vin = -0.3*Vref/(sqrt(1+(2*pi*fs*k)^2*(R*C)^2))*sin(2*pi*fin*k*(ts*t-R*C+del_jitter*randn(1,1)))+Vcm+dither_LSB*LSB;
[dout2(t),adout2(t,:)]= (adc_sar_diff(Vip,Vin,Vref,Vcm,M,Cm_p,Cm_n,Cd1_p,Cd1_n,Cp1_p,Cp1_n,Comp_os,del_Compvn,del_ktc,weight));
dout2(t)=floor(dout2(t));
adout2(t,:) = floor(adout2(t,:));
error = adout1(t,:)*rot90(weight,3)- adout2(t,:)*rot90(weight,3);
error = adout1(t,:)*rot90(weight,3)- adout2(t,:)*rot90(weight,3)- 2*delta_d;
t
delta_d=delta_d+ud*error;
weight(:,1:14)=weight(:,1:14)-ux*error*(adout1(t,1:14)- adout2(t,1:14));
d(t)=error;
|
|