Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Which ML function should I use to approx smoothness of a signal?
Date: Mon, 1 Oct 2007 20:09:56 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 31
Message-ID: <fdrk6k$a6i$1@fred.mathworks.com>
References: <fdrhn6$nti$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
NNTP-Posting-Host: webapp-06-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1191269396 10450 172.30.248.36 (1 Oct 2007 20:09:56 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 1 Oct 2007 20:09:56 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:430886



"G.A.M. " <x0zero@gmail.com> wrote in message <fdrhn6$nti
$1@fred.mathworks.com>...
> I have a raw signal as a vector.
> I have a smoothed signal derived from the raw signal with an
> in-house algorithm. (It is another vector.)
> 
> I need to quantify the variance of the smoothed signal from
> the raw signal. What are some good options for this in Matlab?
> 
> Also, as a second question, if I want to quantify the noise
> in the raw signal (referenced to itself only), what Matlab
> functions should I look at?

Interesting. I happen to have a code that solves
exactly this problem. I'll post it on the file exchange.
I was waiting to add a few more bells and whistles,
but if there is a use for it, I'll post it now. Give it a
day to show up there.

As an example, gaussian noise added to a sine wave,
nominal variance = 0.01.

t = linspace(0,1,1000)';
x = sin(t*50) + randn(size(t))/10;

v = estimatenoise(x)
v =
      0.0096887

HTH,
John