フィルターのクリア

how can delay give in nano or pico seconds ?

6 ビュー (過去 30 日間)
Sarfaraz Ahmed
Sarfaraz Ahmed 2019 年 1 月 8 日
コメント済み: Sarfaraz Ahmed 2019 年 1 月 9 日
Hi. I am giving delay to clock in mili, nano, pico seconds. Actually the clock timing value is let say 0.02 , if I attach variable transport delay block after the clock with 3m sec then my sampler sample the input at 0.023 which is fine. but when I give delay 3n sec or 3p sec then it makes the value same 0.02 (no affect of delay) or assume that small delay to 0.
Basically, I am working on nano and pico seconds. so it's very impportant to consider even small delay. How can I do this any one can help in this regard please ? I attached the the snap and delay code below:
function y fcn(count)
persistent p;
persistent j;
if isempty(p) % Initialization
p=0.3e-3;
%p=3e-9;
end
if isempty(j) % Initialization
j=-1;
end
step_size=0.1e-3 %% Initialization
%step_size=1e-9 %% Initialization
if(count<=j)
p=p - step_size;
j=j-1;
end
y = p;
Thanks
  2 件のコメント
Jan
Jan 2019 年 1 月 8 日
編集済み: Jan 2019 年 1 月 8 日
I do not understand, what your problem is.
x = 0.02 - 1e-9
fprintf('%.16g\n', x)
You see that the results differs from 0.02. Maybe you use disp to show the values? Then increase the number of displayed digits:
format long g
0.02 - 1e-9
This is not a more accurate calculation, but only less rounding for the display in the command window.
Sarfaraz Ahmed
Sarfaraz Ahmed 2019 年 1 月 9 日
Thanks Jan. I will look by setting long format.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangePulse and Transition Metrics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by