关于EE247码密度测试INL和DNL的疑问
录入:edatop.com 阅读:
最近在测试10bitSAR ADC的INL和DNL,芯片输入是正弦波,用的是EE247给的码密度matlab程序,但是程序中有一句T = -cos(pi*ch/sum(h));不太理解,望大神能指点一下。附:
datap=textread('4_1.txt','%s');
datan=textread('4_2.txt','%s');
datap=hex2dec(datap);
datan=hex2dec(datan);
y=datap-datan;
minbin=min(y);
maxbin=max(y);
% histogram
a=hist(y, minbin:maxbin);
h=a(1:2:end);
%h=h(2:end-1);
% cumulative histogram
ch = cumsum(h);
% transition levels found by:
T = -cos(pi*ch/sum(h));
% linearized histogram
hlin = T(2:end) - T(1:end-1);
% truncate at least first and last
% bin, more if input did not clip ADC
trunc=2;
hlin_trunc = hlin(1+trunc:end-trunc);
% calculate lsb size and dnl
lsb= sum(hlin_trunc) / (length(hlin_trunc));
dnl= [0 hlin_trunc/lsb-1];
misscodes = length(find(dnl<-0.99));
% calculate inl
inl= cumsum(dnl);
datap=textread('4_1.txt','%s');
datan=textread('4_2.txt','%s');
datap=hex2dec(datap);
datan=hex2dec(datan);
y=datap-datan;
minbin=min(y);
maxbin=max(y);
% histogram
a=hist(y, minbin:maxbin);
h=a(1:2:end);
%h=h(2:end-1);
% cumulative histogram
ch = cumsum(h);
% transition levels found by:
T = -cos(pi*ch/sum(h));
% linearized histogram
hlin = T(2:end) - T(1:end-1);
% truncate at least first and last
% bin, more if input did not clip ADC
trunc=2;
hlin_trunc = hlin(1+trunc:end-trunc);
% calculate lsb size and dnl
lsb= sum(hlin_trunc) / (length(hlin_trunc));
dnl= [0 hlin_trunc/lsb-1];
misscodes = length(find(dnl<-0.99));
% calculate inl
inl= cumsum(dnl);
它里面有一篇参考文献 你去下下啦 里面有原理说明你这个问题的
申明:网友回复良莠不齐,仅供参考。如需专业解答,请学习本站推出的微波射频专业培训课程。
上一篇:请教:关于cadence中smic库mos管参数设定的问题
下一篇:calibre PEX spectre 后仿问题请教。