Main Content

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

クロック信号の特徴の抽出

オン/オフ信号はどの程度急激にオン/オフの切り替えができるでしょうか。どのような頻度で、またどれぐらい長い間、アクティブにできるでしょうか。クロック出力のそういった特性をすべて求めます。

信号を読み込み、プロットします。時間は秒単位、信号レベルはボルト単位で測定します。

load('clock.mat')

plot(tclock,clocksig)
xlabel('Time (s)')
ylabel('Level (V)')

Figure contains an axes object. The axes object with xlabel Time (s), ylabel Level (V) contains an object of type line.

statelevels を使い、ヒストグラムにより信号の上下レベルを検出します。出力を指定しない場合は、信号がプロットされ、レベルがマークされて、ヒストグラムが表示されます。

levels = statelevels(clocksig)
levels = 1×2

    0.0138    5.1848

statelevels(clocksig);

Figure State Level Information contains 2 axes objects. Axes object 1 with title Histogram of signal levels (100 bins), xlabel Level (Volts), ylabel Count contains an object of type line. Axes object 2 with title Signal, xlabel Samples, ylabel Level (Volts) contains 3 objects of type line.

遷移ごとに信号がどれぐらい早く立ち上がるかを求めます。risetimestatelevels で検出された上下レベルを使用します。この関数での立ち上がり時間は、信号がレベル間の差の 10% から 90% に立ち上がるまでに要する時間として定義されています。

[Rise,LoTime,HiTime,LoLev,HiLev] = risetime(clocksig,tclock);

Levels = [LoLev HiLev; (levels(2)-levels(1))*[0.1 0.9]+levels(1)]
Levels = 2×2

    0.5309    4.6677
    0.5309    4.6677

出力なしで risetime を呼び出すと、関数は信号の注釈付きプロットを描画します。立ち上がり時間には影が付けられ、クロッシング ポイントがマークされ、レベルが表示されます。入力として、時間ベクトルまたはサンプル レートを使用できます。

risetime(clocksig,Fs);

Figure Rise Time Plot contains an axes object. The axes object with xlabel Time (seconds), ylabel Level (Volts) contains 12 objects of type patch, line. One or more of the lines displays its values using only markers These objects represent rise time, signal, upper cross, lower cross, upper boundary, upper state, lower boundary, upper reference, lower reference, lower state.

overshoot および undershoot では、信号が遷移ごとにステート レベルからどれぐらいかけ離れているかが示されます。結果はレベル間の差のパーセントで表されます。その他の出力では、実際の時間と信号値が示されます。

overshoot(clocksig,Fs);

[pctgs,values,times] = undershoot(clocksig,Fs);

hold on
text(1.1e-3,2,'     Undershoot','Background','w','Edge','k')
plot([times;1.17e-3],[values;2],'^m','HandleVisibility','off')
hold off

Figure Overshoot Plot contains an axes object. The axes object with xlabel Time (seconds), ylabel Level (Volts) contains 13 objects of type line, text. One or more of the lines displays its values using only markers These objects represent signal, upper cross, lower cross, post-overshoot, upper boundary, upper state, lower boundary, upper reference, lower reference, lower state.

falltime を使用して、信号が低下する速度を求めます。それぞれのステート レベルとパーセント基準レベルは手動で設定できます。同じことは risetime でも行うことができます。

falltime(clocksig,tclock, ...
    'PercentReferenceLevels',[30 80],'StateLevels',[0 5]);

Figure Fall Time Plot contains an axes object. The axes object with xlabel Time (seconds), ylabel Level (Volts) contains 12 objects of type patch, line. One or more of the lines displays its values using only markers These objects represent fall time, signal, upper cross, lower cross, upper boundary, upper state, lower boundary, upper reference, lower reference, lower state.

信号周期を検出します。既定では、この周期は、各ステート レベル間中程の基準レベルにおける連続立ち上がりクロッシング間で経過する時間として定義されます。クロッシングの極性の変更、ステート レベルの指定、基準レベルの調整ができます。

per = pulseperiod(clocksig,tclock)
per = 4×1
10-3 ×

    0.4143
    0.4200
    0.4188
    0.4111

pulseperiod(clocksig,Fs,'Polarity','negative','MidPct',25);

Figure Pulse Period Plot contains an axes object. The axes object with xlabel Time (seconds), ylabel Level (Volts) contains 10 objects of type patch, line. One or more of the lines displays its values using only markers These objects represent pulse period, signal, mid cross, upper boundary, upper state, lower boundary, mid reference, lower state.

デューティ比はパルス サイクルに対するパルス幅の比です。これは、直接計算または専用の関数を使用して求められます。

dut = dutycycle(clocksig,Fs);

wdt = pulsewidth(clocksig,Fs);

compare = [wdt./per dut]
compare = 4×2

    0.4862    0.4862
    0.4756    0.4756
    0.4871    0.4871
    0.4886    0.4886

参考

| | | | | | | |

関連するトピック