python 电力系统时域仿真_Matlab 由时域仿真结果计算 jitter 的脚本

这里简单谈下由时域仿真结果计算 jitter 的方法。

关于如何计算 jitter, 这里的方法主要分为两步,首先在 Cadence 仿真中得到时钟信号过零点时刻的数据,然后利用 matlab 对此数据处理,从而得到 clock jitter 以及时钟周期的直方图(histogram)。

对于过零点时刻的获取,主要可以通过 calculator 中的 cross 函数对 spectre 时域仿真的时钟信号的处理来得到,如下图中所示。

之后,可以将得到的数据列表导出为 CSV 文件(注意对数据设置合适的小数点位数),并利用 matlab 处理。

这里 Matlab 中的处理主要是利用过零点数据得到时钟周期,以此来计算其均值和标准差,具体的 matlab 脚本如下:% calc the jitter from the data of the zero-crossing time

cross_time=csvread('jitter_data.csv', 1, 1); % reading data from the csv file

num=length(cross_time); % find the data length

i=1:num-1;

period(i)=cross_time(i+1)-cross_time(i); % calculate the period

Tc=mean(period); % the avergaed clk period

Jc=std(period); % the cycle jitter (period jitter)

k=1:length(period)-1;

DeltaT(k)=period(k+1)-period(k); % calculate the difference for 2 nearby period

Jcc=std(DeltaT);

%Jpp=max(period)-min(period); % peak-peak Cycle jitter

[n,xout]=hist(period,18); % plot the histogram

bar(xout,n);

title('Clock Period Histogram');

xlabel('clcok period');

ylabel('number')

%text(max(xout), max(n), sprintf('Tc=%.3e', Tc),'hor','right');

%text(max(xout), 0.85*max(n), sprintf('Jc=%.3e', Jc),'hor','right');

%text(max(xout), 0.8*max(n), sprintf('Jcc=%.3e', Jcc),'hor','right');

gtext(sprintf(' T=%.3e\n Jc=%.3e\n Jcc=%.3e', Tc,Jc,Jcc))

我们可以用以前介绍的抖动时钟的信号源来加以验证,在理想时钟引入 synchronous jitter (edge-to-edge jitter), 这里取 Jee=10ps, 则对应的 cycle-jitter Jc 约为14.1ps。

下图是实际利用 matlab 分析得到的 cycle-jitter 和周期的直方图,这里的 Jc=13.9ps, 可见还是比较接近的

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值