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

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

手机号码,快捷登录

手机号码,快捷登录

找回密码

  登录   注册  

快捷导航
搜帖子
查看: 37023|回复: 68

[求助] 关于ADC SNR仿真结果的问题

[复制链接]
发表于 2012-7-15 15:41:51 | 显示全部楼层 |阅读模式

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

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

x
各位大侠好,

    我最近在仿真ADC的SNR,对于10bit的ADC,仿真的SNR结果竟然达到了62.2404dB,SNDR为61.6507dB.
      理论上对于10位的ADC,SNR应该为61.96dB啊。
    请教各位大侠,SNR大于理论值,这是什么原因??

    谢谢各位了!!
发表于 2012-7-15 17:37:31 | 显示全部楼层
回复 1# duke2050


    你好,请问你是怎么仿真SNR的?用的是什么仿真工具?我最近也在做一个AD,不知道AD怎么仿真精度。
 楼主| 发表于 2012-7-15 17:56:56 | 显示全部楼层
本帖最后由 duke2050 于 2012-7-15 17:59 编辑

defining and testing dynamic parameters in high-speed ADCs, Part1.pdf (207.36 KB, 下载次数: 1125 ) dynamic testing of high-speed ADCs, Part2.pdf (289.47 KB, 下载次数: 1068 ) 回复                   
2#
lovelybei



    我用的是spectre,仿真的方法大致是:对ADC输入正弦波,将得到的二进制数字转换成十进制,然后通过FFT变换后处理。
   你先看下maxim关于动态参数测试的文档吧,里面有对ADC输出的数据进行处理的matlab程序,呵呵,不懂的再交流
发表于 2012-7-15 22:51:16 | 显示全部楼层
相差0.6个dB,原因比较多了。你查查你FFT的代码,主tone取了多少个bin,harmonic取了多少个bin,DC的部分是不是bin取多了,自然会多一些。
 楼主| 发表于 2012-7-16 09:14:57 | 显示全部楼层
回复 4# steve_guo_1997


    下面的是我处理ADC输出的FFT代码,您看下可不可以?
   谢谢您了!!

clear
load sar_adc_1024point.txt    %WaveScan保存的波形文件,文件必须以英文开头
A= sar_adc_1024point;         %将测量数据赋给A,此时A为N×2的数组
x=A(:,1);                     %将A中的第一列赋值给x,形成时间序列
x=x';                         %将列向量变成行向量
y=A(:,2);                     %将A中的第二列赋值给y,形成被测量序列
y=y';                         %将列向量变成行向量

%显示原始数据曲线图(时域)
subplot(1,1,1);
plot(x,y) ;                                                                               %显示原始数据曲线图
xlabel('时间 (s)');
ylabel('被测变量y');
title('原始信号(时域)');
grid on;

format long;
%傅立叶变换
y=y-mean(y);                          %消去直流分量,使频谱更能体现有效信息
fclk=(length(x)-1)/(max(x)-min(x));   %仪器的采样频率
numpt=length(y);                      %data.txt中的被测量个数,即采样个数


%If no window function is used, the input tone must be chosen to be unique and with
%regard to the sampling frequency. To achieve this prime numbers are introduced and the
%input tone is determined by fIN = fSAMPLE * (Prime Number / Data Record Size).
%To relax this requirement, window functions such as HANNING and HAMING (see below) can
%be introduced, however the fundamental in the resulting FFT spectrum appears 'sharper'
%without the use of window functions.
Doutw=y;
%Doutw=y'.*hanning(numpt);
%Doutw=y'.*hamming(numpt);
%Performing the Fast Fourier Transform
Dout_spect=fft(Doutw);

%Recalculate to dB
Dout_dB=20*log10(abs(Dout_spect));

%Display the results in the frequency domain with an FFT plot
figure; %建立图形
maxdB=max(Dout_dB(1:numpt/2));
%For TTIMD, use the following short routine, normalized to —6.5dB full-scale.
%plot([0:numpt/2-1].*fclk/numpt,Dout_dB(1:numpt/2)-maxdB-6.5);
%plot([0:30/2-1].*fclk/numpt,Dout_dB(1:30/2)-maxdB);
plot([0:numpt/2-1].*fclk/numpt,Dout_dB(1:numpt/2)-maxdB);
grid on;

title('FFT PLOT');
xlabel('ANALOG INPUT FREQUENCY (Hz)');
ylabel('AMPLITUDE (dB)');
a1=axis; axis([a1(1) a1(2) -120 a1(4)]);

%Calculate SNR, SINAD, THD and SFDR values
%Find the signal bin number, DC = bin 1
fin=find(Dout_dB(1:numpt/2)==maxdB);  
%Span of the input frequency on each side
%span=max(round(numpt/200),5);%span=max(round(numpt/200),5);
%Approximate search span for harmonics on each side
spanh=2;%spanh=2;
%Determine power spectrum
spectP=(abs(Dout_spect)).*(abs(Dout_spect));
%Find DC offset power
%Pdc=sum(spectP(1:span));
%Extract overall signal power
Ps=sum(spectP(fin-spanh:fin+spanh));
%Vector/matrix to store both frequency and power of signal and harmonics
Fh=[];
%The 1st element in the vector/matrix represents the signal, the next element represents
%the 2nd harmonic, etc.
Ph=[];
%Find harmonic frequencies and power components in the FFT spectrum
for har_num=1:10 %har_num谐波总数
%Input tones greater than fSAMPLE are aliased back into the spectrum
tone=rem((har_num*(fin-1)+1)/numpt,1); %rem(x,y)x除以y的余数  numpt(Number of Points)
if tone>0.5
%Input tones greater than 0.5*fSAMPLE (after aliasing) are reflected
tone=1-tone;
end
Fh=[Fh tone];
%For this procedure to work, ensure the folded back high order harmonics do not overlap
%with DC or signal or lower order harmonics
%har_peak=max(spectP(round(tone*numpt)-spanh:round(tone*numpt)+spanh));
%har_bin=find(spectP(round(tone*numpt)-spanh:round(tone*numpt)+spanh)==har_peak);
%har_bin=har_bin+round(tone*numpt)-spanh-1;
%Ph=[Ph sum(spectP(har_bin-1:har_bin+1))];
Ph=[Ph sum(spectP(har_num*(fin-1):har_num*(fin-1)+2))];
end
%Determine the total distortion power
Pd=sum(Ph(2:10)); %Pd总失真功率  Ph(1) is fundamental harmonic谐波 power
%Determine the noise power
Pn=sum(spectP(1:numpt/2))-Ps-Pd;  %Pn噪声功率  Ps信号功率

format;%设置输出格式
SNR = 10*log10(Ps/Pn)    %信噪比
SINAD=10*log10(Ps/(Pn+Pd)) % SINAD = 10*log10(Ps/(Pn+Pd))  信号与噪声失真比
disp('THD is calculated from 2nd through 10th order harmonics');
SFDR=10*log10(Ph(1)/max(Ph(2:10)))  %SFDR无杂散动态范围
ENOB = (SINAD-1.76)/6.02
disp('Signal & Harmonic Power Components:');
HD=10*log10(Ph(1:10)/Ph(1))
发表于 2012-7-16 09:55:50 | 显示全部楼层
理论的ENOB计算也是根据锯齿误差的RMS功率近似得到
你的频率很低,DAC也是理想的,ENOB测到比理论值大点正常
当然以上前提是噪声和谐波没有少计算
发表于 2012-7-16 10:42:37 | 显示全部楼层
收获颇丰的,谢谢!
 楼主| 发表于 2012-7-16 10:47:53 | 显示全部楼层
回复 6# mcgrady


    现在的问题主要是SNR竟然比理论值大,这个就有点迷糊了,呵呵,敬请指教!!谢谢了!!
发表于 2012-7-16 11:32:12 | 显示全部楼层
是否有OVER SAMPLING?
 楼主| 发表于 2012-7-16 13:09:16 | 显示全部楼层
回复 9# jesseyu


    采样频率为300KHz,输入的正弦波信号频率为9.08203125KHz
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

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

X

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

GMT+8, 2025-5-30 23:01 , Processed in 0.024125 second(s), 7 queries , Gzip On, MemCached On.

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