x <- seq(from=0, to=2*pi, length=150)
s1 <- sin(10*x)
s2 <- sin(7*x)
s <- s1 + s2
w <- rfft(s)
if (FALSE) ts.plot(w)
#
# Should see two peaks, corresponding to the two sines at different frequencies
#
Run the code above in your browser using DataLab