sine with increasing frequency
Ältere Kommentare anzeigen
in my opinion, the following code should produce a sine-wave that has a frequency of 2Hz at t=20. but when i count the periods between t=19 and t=20, i count more than 3 periods. what am i doing wrong?
clear all, close all, clc;
t=linspace(0,20,10000);
y=sin(2*pi*(1+(5/100)*t).*t);
plot(t,y);
hold on;
2 Kommentare
Image Analyst
am 5 Sep. 2015
If you have the signal processing toolbox, you might also be interested in the chirp() function.
Max E.
am 5 Sep. 2015
Antworten (1)
Star Strider
am 5 Sep. 2015
You’re multiplying by t first, then element-wise by .*t. I also don’t understand what the 1 is for.
See if this does what you want:
t=linspace(0,20,10000);
y=sin(2*pi/20.*t.^2);
3 Kommentare
Star Strider
am 5 Sep. 2015
The Signal Processing Toolbox is a MathWorks product. You can request it as part of a university license, or buy it from MathWorks.
I’m adding Simulink to the Products tags.
Max E.
am 5 Sep. 2015
Star Strider
am 5 Sep. 2015
I still don’t understand what you want, but so long as you got your answer, we’ll consider this resolved.
Kategorien
Mehr zu Array and Matrix Mathematics finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
