adding noise to a signal in python
<p>I want to add some random noise to some 100 bin signal that I am simulating in Python - to make it more realistic.</p>

<p>On a basic level, my first thought was to go bin by bin and just generate a random number between a certain range and add or subtract this from the signal.</p>

<p>I was hoping (as this is python) that there might a more intelligent way to do this via numpy or something. (I suppose that ideally a number drawn from a gaussian distribution and added to each bin would be better also.)</p>

<p>Thank you in advance of any replies.</p>

<hr>

<p>I'm just at the stage of planning my code, so I don't have anything to show. I was just thinking that there might be a more sophisticated way of generating the noise.</p>

<p>In terms out output, if I had 10 bins with the following values:</p>

<p>Bin 1: 1
Bin 2: 4
Bin 3: 9
Bin 4: 16
Bin 5: 25
Bin 6: 25
Bin 7: 16
Bin 8: 9
Bin 9: 4
Bin 10: 1</p>

<p>I just wondered if there was a pre-defined function that could add noise to give me something like:</p>

<p>Bin 1: 1.13
Bin 2: 4.21
Bin 3: 8.79
Bin 4: 16.08
Bin 5: 24.97
Bin 6: 25.14
Bin 7: 16.22
Bin 8: 8.90
Bin 9: 4.02
Bin 10: 0.91</p>

<p>If not, I will just go bin-by-bin and add a number selected from a gaussian distribution to each one.</p>

<p>Thank you.</p>

<hr>

<p>It's actually a signal from a radio telescope that I am simulating. I want to be able to eventually choose the signal to noise ratio of my simulation.</p>
