MATLAB Answers

How to create a sine wave with linear increasing amplitude transition

조회 수: 1(최근 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