Adding Random Noise to a Sine Wave in Mathematica

Click For Summary

Discussion Overview

The discussion revolves around generating a sine wave combined with random noise using Mathematica, specifically for a time series and spectral analysis class. Participants explore methods for creating a sequence of random numbers, arranging them, and integrating them with sine wave outputs.

Discussion Character

  • Exploratory, Technical explanation, Homework-related

Main Points Raised

  • One participant seeks guidance on generating 100 random numbers in ascending order from 0 to at least 2π to combine with a sine wave.
  • Another participant suggests using the Sort function to arrange random numbers in ascending order.
  • A different participant questions the need for ascending order, arguing that random variables do not have a correlation between time and value, and proposes adding random values to the outputs of the sine function instead.
  • The same participant later expresses realization that their approach aligns with advice given by their professor, acknowledging their earlier misunderstanding.

Areas of Agreement / Disagreement

There is no consensus on the necessity of arranging random numbers in ascending order, as some participants challenge this idea while others provide technical solutions. The discussion remains unresolved regarding the best approach to integrate random noise with the sine wave.

Contextual Notes

Participants express varying interpretations of how to combine random values with sine wave outputs, leading to different proposed methodologies. The discussion reflects uncertainty about the relationship between the random variables and the sine function.

stunner5000pt
Messages
1,447
Reaction score
5
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
 

Attachments

  • noise.JPG
    noise.JPG
    7.1 KB · Views: 516
Physics news on Phys.org
any ideas people??

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

Sort[Real,{1.13,2.14,1.54,2.61}]

{1.13,1.54,2.14,2.61}
 
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
 
chroot said:
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

now why didnt i think of it that way

in fact tahts what my prof said too

im just silly

thanks a lot :biggrin:
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 4 ·
Replies
4
Views
9K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K