Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Graphing noise (mathematica)

  1. Sep 13, 2006 #1
    For my time series and spectral analysis class i need to graph something like in the attachment. i need to have 100 numbers that are connected like that, and then 'add' them to a sinusiodal wave to create a real life wave - with noise.

    How would i do this using mathematica??

    I can easily generate a whole bunch of random numbers with ranging values but how would i make it such taht all the numbers are in ascending order and go from 0 to at least 2 pi?

    would i use numerous Random[x] and then arrange them (how?) in ascending order??

    Please help!!

    Thank you in advance for your input

    Attached Files:

  2. jcsd
  3. Sep 14, 2006 #2
    any ideas people??

    graphing random numbers and then 'joinging' them seems to be a good idea here... is that possible with mathematica though?
  4. Sep 14, 2006 #3
    Look up the function Sort.


  5. Sep 14, 2006 #4


    User Avatar
    Staff Emeritus
    Science Advisor
    Gold Member

    I have no idea what you mean, ascending order. From what I can tell, there's no correlation between the time and the value, which is rather the definition of a random variable. You're not going to add the random values to the angles going into the sine function -- you're going to add them to the outputs coming from the sine function.

    Just compute a table of sine values, one for each point of interest. Next, add a random value to each entry in the table.

    - Warren
  6. Sep 14, 2006 #5
    now why didnt i think of it that way

    in fact tahts what my prof said too

    im just silly

    thanks a lot :biggrin:
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook