Question About Plotting Trigonometric Functions
Ben Abbott
bpabbott at mac.com
Sun Dec 23 21:11:59 CST 2007
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
> Help-octave at octave.org
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
More information about the Help-octave
mailing list