Pulse random generator issue

3 ビュー (過去 30 日間)
ibra01
ibra01 2019 年 2 月 18 日
編集済み: Anushka 2025 年 2 月 17 日
Hello,
I'm new in Simulink and i trying to make a pulse random generatorpulse random generator. Pulses have amplitude (1 ) and width (6 nano sec). The signal has to be periodic. how can i do it? I apprecitate any help.
Thanks.

回答 (1 件)

Anushka
Anushka 2025 年 2 月 17 日
編集済み: Anushka 2025 年 2 月 17 日
You can use this block to make a pulse random generator:
Set the sample time of the model to 6 nanosecond:
You can consider the below mentioned MATLAB function to be used in the pulse random generator:
function y = fcn(u)
persistent counter
if isempty(counter)
counter = 0;
end
id = rand(1);
if id > 0.5 && u == 0
counter = 6;
end
if counter > 0
y = 1;
counter = counter - 1;
else
y = 0;
end
end
Hope this helps!

カテゴリ

Help Center および File ExchangeSources についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by