How to generate a sine signal in which initially frequency increases linearly, then remains constant for some time and again decreases linearly.

3 views (last 30 days)
How to generate a sine signal in which initially frequency increases linearly then remains constant for some time and again decreases linearly i.e, for 1st segment its frequency increases linearly from 0HZ – 100 HZ for t1=10 sec. Then the frequency remains constant in the 2nd segment for at 100 Hz at t2=50 sec and for the 3rd segment the frequency decreases linearly from 100Hz to 0 Hz for t3=10 sec.

Accepted Answer

Pawel Jastrzebski
Pawel Jastrzebski on 24 Jul 2018
Edited: Pawel Jastrzebski on 24 Jul 2018
Would it look like this:
% y = sine(2*pi*f*t)
t1 = linspace(0,10,500);
t2 = linspace(10,50,500);
t3 = linspace(50,60,500);
f1 = linspace(0,100,500);
f2 = repmat(100, [1 numel(t2)]);
f3 = fliplr(f1)
t = [t1 t2 t3];
f = [f1 f2 f3];
figure
subplot(2,1,1)
plot(t,2*pi*f.*t)
title('2*pi*f.*t')
xlabel('t');
ylabel('2*pi*f.*t')
subplot(2,1,2)
plot(t,sin(2*pi*f.*t));
title('sin(2*pi*f.*t)')
xlabel('t');
ylabel('sin(2*pi*f.*t)')

More Answers (0)

Categories

Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!