微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 微波和射频技术 > RFIC设计学习交流 > matlab仿真SAR ADC有效位

matlab仿真SAR ADC有效位

时间:10-02 整理:3721RD 点击:
请教各位大神们,我用matlab仿真出来的10位sar adc有效位和SFDR感觉很奇怪,下面的这个结果是说明了我哪里有问题吗

就是感觉有效位数应该很接近10吧,然后SFDR不应该这么大啊,求大神们指导啊==

sfdr这么大很正常,你可能仿的点数比较多,做DFT的点数多,
因为你仿的可能是理想AD
但有效位不够接近9位是有点问题,
细节不清看不清原因

下面是代码中的Approx函数,我是网上搜的代码然后改动了一部分function [counter,thresholds]=Approx_2(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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%global variables%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
threshold(1,nbit+1)=0;% threshold array
counter=0;% converter decimal output
threshold(1)=0.5*v;% 0 threshold
threshold(2)=0.5*v;% first threshold
threshold_id=0.5*v;% next ideal threshold
tau=1/(2*pi*f_bw);% DAC output pole
in=input;
Tmax=1/(f_s*nbit);% clock period
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
for i=2nbit+1)% conversion cycle
if i < 6如果把这里的数字改大,出来的效果会更好
Tmax=2*Tmax;
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%finitebandwidth & 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;
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%successive approximation%
%conversion algorythm%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
if (in-threshold(i)) > 0
threshold_id=threshold_id+1/2^i*v;
bit=1;
else
threshold_id=threshold_id-1/2^i*v;
bit=0;
end
Tmax=1/(f_s*nbit);
counter=(counter+bit*2^(nbit-i+1));
thresholds(i-1)=threshold(i);
end
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Output%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
counter=counter;
if nargout > 1
thresholds=thresholds;
end
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

那个数字的影响是因为给的转换时间足够长,所以能达到更好效果吗?更细致的原因是什么呢?还有,error calculation那一段明白是在校准比较器的输入什么的,可是不太懂那些式子是怎么来的。请大神不吝赐教啊O(∩_∩)O~

sfdfsdfew

who know it?

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top