3
$\begingroup$

I am trying to write a Kalman Filter for airplane radar tracking, so I generated testing data and now I want to add some white noise to this data. I have tried doing this, but it didn't help. So far I was able to import the data from a spreadsheet and now I need to modify the data in the file.

The generated data consists of position (px, py) and velocity (vx, vy) in two dimensions. The model is very simplified, assuming that the airplane has constant acceleration only in the X direction and the acceleration in Y direction is so small that it can be neglected. Position and velocity is calculated for each the first 100 seconds of the motion.

enter image description here enter image description here

Any tips, regarding how to implement the abovementioned?

$\endgroup$
1
  • 1
    $\begingroup$ Could you show (a portion of) your testing data, so we can figure out how it’s formatted? Could you also include the specific code you used in your attempt with WhiteNoiseProcess? $\endgroup$
    – MarcoB
    Jun 4, 2020 at 2:48

2 Answers 2

3
$\begingroup$

I have not used WhiteNoiseProcess before. But looking at help, what you can go is generate the noise (called noiseData below) and then add it, point by point, to your input?

p = WhiteNoiseProcess[.5]; (*mean 0 and standard deviation 0.5 say*)
noiseData = RandomFunction[p, {0, 10}];
ListPlot[noiseData]

Mathematica graphics

Now add the above to your data. This is your data before

myData = Transpose[{Range[0, 10], Range[0, 10]}];
ListLinePlot[myData]

enter image description here

This is your data after adding the noise

ListLinePlot[myData + Normal[noiseData][[1]]]

enter image description here

$\endgroup$
4
$\begingroup$

It will depend a bit on exactly what the format of the data you imported is, but you can do something like this:

data = Sin[2 Pi 4 Subdivide[999]];
noisyData = 
  data + RandomVariate[NormalDistribution[0, 1], Length[data]];
ListLinePlot[{
  noisyData,
  data
  }
 ]

Sine wave and sine wave with noise.

I generate a pure sine wave with $f = 4$ (or $\omega = 8 \pi$). Then I add Gaussian noise to it using RandomVariate. I ask RandomVariate to produce 1000 random numbers since my data has a length of 1000. The 0 and 1 in NormalDistribution are the mean and standard deviation, respectively.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.