noise calculation in the gps-simulator
4 views (last 30 days)
Show older comments
Hi,
I am trying to understand the principle of gps sensor simulator in Matlab. According to the documentation, the horizontal position accuracy
specifies the standard deviation of the noise in the horizontal position measurement and the vertical position accuracy
specifies the standard deviation of the noise in the vertical position measurement. From my understanding, the measurement noise matrix be
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1416839/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1416844/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1416849/image.png)
But after reading the source code of matlab implementation, I am wondering where comes from the factor 2. The relevant source code is shown in the below.
dt = 1 ./ obj.SampleRate;
% in case of white noise process the decayfactor is 0.
decayFactor = obj.DecayFactor;
% tau = dt for white noise process
tau = dt / (1-decayFactor);
horzSigma = obj.HorizontalPositionAccuracy;
vertSigma = obj.VerticalPositionAccuracy;
sigmas = [horzSigma horzSigma vertSigma];
% updated standard deviation
% it equals to obj.pSigmaScaled = sigmas .* sqrt(2);
obj.pSigmaScaled = sigmas .* sqrt(2.*dt./tau);
obj.pPositionErrorFilterNum = 1;
obj.pPositionErrorFilterDen = [1 -decayFactor];
According to the implementation, the measurement noise is:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1416854/image.png)
I don't know where I got it wrong. Is there someone could help me about it?
Thanks for any help and hints in advance.
Best regards
0 Comments
Answers (2)
Ryan Salvo
on 23 Jun 2023
Hi Siyu,
For the noise calculation, the standard deviation is scaled by a bandwidth equal to 1/2 of the sampling rate. That results in the multiplication of the standard deviation by 2*dt.
Thanks,
Ryan
0 Comments
Siyu
on 26 Jun 2023
1 Comment
Ryan Salvo
on 26 Jun 2023
Hi Siyu,
We use the generic sensor noise model detailed in the TSim manual to model this random noise in the GPS sensor. See the Derivation of Modified Rate Random Walk Noise Model section for the complete details.
Thanks,
Ryan
See Also
Categories
Find more on Automated Driving Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!