フィルターのクリア

Sawtooth that has 2 different times

2 ビュー (過去 30 日間)
Peter Cristian
Peter Cristian 2022 年 4 月 11 日
回答済み: Mathieu NOE 2022 年 4 月 11 日
I have to make a sawtooth signal that has 2 times.
It starts at 0V, increases to 0.4V for 5ms, then decreases back to 0V in 0.5ms
the first part i know its, but i dont know how to write the last part
y=sawtooth(2*pi*200*t);

回答 (1 件)

Mathieu NOE
Mathieu NOE 2022 年 4 月 11 日
hello
here is the correct answer :
T = 25e-3; % signal duration = 25 ms
amplitude = 0.4;
fs = 10000; % ts = 0.1 ms
t = 0:1/fs:T-1/fs;
f_signal = 1/(5e-3 + 0.5e-3); % signal period = 5 ms + 0.5 ms
width = 5e-3/(5e-3 + 0.5e-3); % ratio of time for upward and downward portion of signal
x = amplitude*(0.5*(1+sawtooth(2*pi*f_signal*t,width)));
plot(t*1000,x)
xlabel('time (ms)');
grid on

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by