On 17/09/2009, at 3:39 AM, delic wrote:
I wrote a script that I anticipating seeing a spike at 10Hz with the
function 10* sin(2*pi*10*t).
I can't figure out why my plots do not show spikes at the
frequencies I
expect. Am I doing something wrong or is my expectations wrong?
(a) Is this a homework question?
(b) Have you figured it out yet?
(c) Hint: You have spikes at +/- 40 in a range from -50 to 50. You
*want* spikes
at 10 and 90 Hz. Could it be that you haven't set your frequency
vector ``f''
quite right? :-)
cheers,
Rolf Turner
P. S. You won't get spikes bang on at 10 and 90 Hz. because these are
*not*
Fourier frequencies when n = 256. If you want spikes in your
periodogram
at bang on 10 and 90 Hz use a value of n that is divisible by 10,
e.g. n=500.
Why would you want a power of 2 anyhow? (Well, the fft goes faster
when n
is a power of 2, but who cares?)
R. T.
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.