在线咨询
eetop公众号 创芯大讲堂 创芯人才网
切换到宽版

EETOP 创芯网论坛 (原名:电子顶级开发网)

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 4383|回复: 5

[求助] matlab仿真SAR ADC有效位

[复制链接]
发表于 2015-8-17 15:35:55 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
请教各位大神们,我用matlab仿真出来的10位sar adc有效位和SFDR感觉很奇怪,下面的这个结果是说明了我哪里有问题吗 1.png
 楼主| 发表于 2015-8-17 15:36:56 | 显示全部楼层
就是感觉有效位数应该很接近10吧,然后SFDR不应该这么大啊,求大神们指导啊==
发表于 2015-8-19 15:17:43 | 显示全部楼层
sfdr这么大很正常,你可能仿的点数比较多,做DFT的点数多,

因为你仿的可能是理想AD

但有效位不够接近9位是有点问题,
细节不清看不清原因
 楼主| 发表于 2015-8-19 17:24:39 | 显示全部楼层
回复 3# sohubjb


   下面是代码中的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

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                  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;
%                                                                   %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%      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~
发表于 2016-9-6 12:52:36 | 显示全部楼层
sfdfsdfew
发表于 2017-12-5 09:54:07 | 显示全部楼层
who know it?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

小黑屋| 手机版| 关于我们| 联系我们| 在线咨询| 隐私声明| EETOP 创芯网
( 京ICP备:10050787号 京公网安备:11010502037710 )

GMT+8, 2024-9-28 23:29 , Processed in 0.028886 second(s), 10 queries , Gzip On, Redis On.

eetop公众号 创芯大讲堂 创芯人才网
快速回复 返回顶部 返回列表