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

2 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Pawel Jastrzebski
Pawel Jastrzebski il 24 Lug 2018
Modificato: Pawel Jastrzebski il 24 Lug 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)')

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by