Series of rectangular pulses with increasing pulse length

1 回表示 (過去 30 日間)
Kurosch Mehrgan
Kurosch Mehrgan 2020 年 10 月 29 日
回答済み: Akira Agata 2020 年 10 月 30 日
I'm trying to define a function which is a series of rectangular pulses, where the length of a pulse increases by a constant with each repeat. The distance between the pulses should remain the same.
How would I do this in MATLAB?

回答 (1 件)

Akira Agata
Akira Agata 2020 年 10 月 30 日
How about using modulate function (Signal Processing Toolbox)?
The following is an example:
fs = 100;
fc = 5;
data = 0:0.2:1;
y = modulate(data,fc,fs,'pwm');
% Plot the waveform
figure
plot(y)
ax = gca;
ax.XTick = 0:20:120;
ax.YLim = [0 1.2];
grid on

カテゴリ

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

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by