How to generate a square wave with random normal distributed period and pulse width?

3 ビュー (過去 30 日間)
Killimangiro
Killimangiro 2013 年 7 月 1 日
編集済み: Deepayan Bhadra 2022 年 5 月 30 日
Hi,
for example: a square wave signal with a period of 40-50 and a pulse width of 20-30, amplitude should be 1 I need it to be a continuous signal, each wave with random period and pulse width
so basically i need a row of 1s followed by a row of 0s followed by a new random row of 1s and so on...
I have the signal building toolbox, don't know if this helps
Thank you

回答 (1 件)

Matt J
Matt J 2013 年 7 月 1 日
編集済み: Matt J 2013 年 7 月 1 日
It'll be something like this,
T=5*randn+45; %duration
W=5*randn+25; %pulse width
t=linspace(0,T,1000);
pulse=(t<=W);
plot(t,pulse); ylim([-1,2]);
  5 件のコメント
Deepayan Bhadra
Deepayan Bhadra 2022 年 5 月 30 日
編集済み: Deepayan Bhadra 2022 年 5 月 30 日

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

カテゴリ

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