[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Question About Plotting Trigonometric Functions
From: |
Ben Abbott |
Subject: |
Re: Question About Plotting Trigonometric Functions |
Date: |
Mon, 24 Dec 2007 11:11:59 +0800 |
The period of your sine wave is 1/400 = 0.0025, while the distance
between time indices is 0.1 (40 cycles). Each sample is very a
multiple of a cycle. Thus, you are evaluating sin(2*pi*N) for N = 0,
40, 80, 120, 160, 200. Each of these should ideally give a result of
zero. Your result is within expected numerical precision.
To obtain a more representative plot of the sine wave, try
f = 400;
t = (0:0.01:1.0)/f;
plot (t, sin (2*pi*f*t))
Ben
On Dec 24, 2007, at 7:10 AM, Malstygian wrote:
I would like to graph the following puretone sine wave:
f = 400;
t = 0:0.1:0.5;
plot(t, sin(2*pi*f*t))
However, the plot this generated did not look correct as confirmed by
plotting the same equation using my TI-83 graphing calculator. The
picture
of the result is shown below. What am I doing wrong?
Thank you
http://www.nabble.com/file/p14482857/sin_graph.png
--
View this message in context:
http://www.nabble.com/Question-About-Plotting-Trigonometric-Functions-tp14482857p14482857.html
Sent from the Octave - General mailing list archive at Nabble.com.
_______________________________________________
Help-octave mailing list
address@hidden
https://www.cae.wisc.edu/mailman/listinfo/help-octave