About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
  • License: Freeware
  • Last update: 5 years ago
  • Total downloads: 129
  • Price: Free |
  • Operating system: Linux, Mac OS X, Win All, BSD, Solaris
  • Publisher: John D'Errico (18 other programs)
See full specifications

scripts default iconEstimatenoise (Scripts) Publisher's description

Some curve fitting or smoothing tools can benefit from knowledge of the noise variance to expect on your data.

Some curve fitting or smoothing tools can benefit from knowledge of the noise variance to expect on your data. Kalman filters use this information, also some spline fitting tools. So I wrote a function to extract the noise variance from a signal vector. It also works on any specified dimension of an array.

A few examples of this code in use:

Simple linear data, with purely additive N(0,1) gaussian noise:

t = 0:10000;
x = t + randn(size(t));
mv = estimatenoise(x)
mv =

Gaussian noise added to a sine wave (Nominal variance = 0.01)
t = linspace(0,1,1000)';
x = sin(t*50) + randn(size(t))/10;
mv = estimatenoise(x)
mv =

Pure gaussian noise, with a nominal variance of 9. (Note that var would have been a better estimator for this particular case...)

mv = estimatenoise(3*randn(2,3,1000),3)
mv =
9.6584 8.2696 8.632
9.2404 8.5346 9.7725

A piecewise constant function with multiple discontinuities. The true noise variance should be 0.01.

t = linspace(0,1,1000);
X = round(cos(t*6*pi)) + randn(size(t))/10;
var(X) % var will be wildly in error
ans =

ans =

Test if estimatenoise is able to recover the variance of a normally distributed random sample with unit variance. (Yes, it will be much slower than var.)

ans =

Estimatenoise can now handle non-uniformly spaced series (by request.) In the next example,
the actual noise variance was 1.0 here. Perform the operation 1000 times, then look at the median variance estimate. How well did we do?

t = sort([randn(1,100) , randn(1,100)+5]);
X = repmat(sin(t*5)*100,1000,1) + ...

Estimatenoise is clearly wrong when the spacing is ignored.

ans =

Supplying the sampling "times", we get quite a reasonable result.
ans =

Estimatenoise also works on data with replicates. In this example, each point will be replicated up to 3 times. The actual noise variance was again 1.0 here. I'll also compare the increase in times required for estimatenoise when t is supplied.

t = sort([0:1:100, 1:2:100, 1:4:100]);
X = repmat(sin(t/10)*100,1000,1)+ ...

Again, estimatenoise is clearly wrong when the non-uniform spacing is ignored.

ans =
Elapsed time is 2.690135 seconds.

Supplying the sampling "times", we again get quite a reasonable result. The time penalty is not quite 2x.

ans =
Elapsed time is 4.864486 seconds.

System Requirements:

MATLAB 7.4 (R2007a)
Program Release Status: Major Update
Program Install Support: Install and Uninstall

Is Estimatenoise (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.