How to create a sine wave with linear increasing amplitude transition

4 ビュー (過去 30 日間)
Hello everybody,
I would like to create a sine wave with linear increasing amplitude (Amp1 to Amp2), characteristics mentioned above:
Total duration: 9sec
Amplitude1: 0.3
Transition start time: 4th sec
Transition duration: 300ms
Amplitude2: 0.6
Thnx :)

採用された回答

Russel Burgess
Russel Burgess 2021 年 3 月 14 日
One way:
t = linspace(0, 9, 10000); % s
f = 10; % Hz
A = 0.3.*(t<4) + (0.3 + (0.6 - 0.3)/0.3*(t-4)).*(t>=4 & t<4.3) + 0.6*(t>=4.3);
x = A.*sin(2.*pi.*f.*t);
plot(t, x);

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by