generate a triangular pulse

5 ビュー (過去 30 日間)
Muhammad Haziq
Muhammad Haziq 2020 年 2 月 25 日
回答済み: Karan Singh 2025 年 2 月 5 日 6:53
Hi everone,
I want to generate a triangular waveform with sampling frequency of 20k and having a pulse width of 4.25 ms. I need to adjust amplitude and range of triangle according to my needs. for this purpose I try to use " tripuls(t) " command but couldn't succeed in it. Can any body help me.
regards,
Haziq

回答 (1 件)

Karan Singh
Karan Singh 2025 年 2 月 5 日 6:53
You might find the sawtooth function helpful for generating a triangular pulse: https://in.mathworks.com/help/signal/ref/sawtooth.html.
Here's an example directly from the documentation that you can adjust as needed.
"sampling frequency of 20k and having a pulse width of 4.25 ms".
T = 10*(1/50);
fs = 1000;
t = 0:1/fs:T-1/fs;
x = sawtooth(2*pi*50*t);
plot(t,x)
grid on
Karan

カテゴリ

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

タグ

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by