Minimizing noise: Funcfit on wave operations?

Hallo,

I want to minimize noise by optimizing a scaling factor:
I have two anti-correlated signals (waves) with correlated noise. Call them A and B.
By calculating:
C=A-B*f
(with f being some factor) I can enhance the signal and remove the noise.

Ideally I would like to optimize f by minimizing the noise of C:
C=A-B*f
wavestats /r=[a,b] C

Problem: How to find the "f" resulting in the lowest noise by minimizing V_sdev?

Is there a way to do this by using the build in routines e.g. for curve fitting?

cheers

Ralf







You might want to look at the Optimize operation. Somewhat more cumbersome than CurveFit, but more suited to the problem, I think.

DisplayHelpTopic "Finding Minima and Maxima of Functions"

You would have to write a function that computes C and Variance(C). Use Optimize to find the f that minimizes variance.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Thank you! I was not aware of optimze. It does exactely what I need!

Just 3 suggestion on improving the help function:
- Optimize must be supplied a pWave
- the user defined must require a wave as first parameter
(the error message without these two waves is not self explaining. Waves are required, even if in both cases the wave is never touched)
- the value returned by "return" can be calculated before (all exsamples in the manual calculate it in the same line), e.g:
function test(w,x)
wave w
variable x
wavestats/q w
return v_sdev
end


The 3 points were not directely clear to me from reading the help files, maybe other people would struggle there as well.

best regards,

Ralf
Well, that information is in the help link I included, albeit in the section on 1D optimization. I guess I expected you to read straight through; the info in the 1D case is easier to read, and provides an introduction to the topic.

The last point seems like basic programming, though I admit that all my examples did the computation right in the return statement. I wanted examples where the function itself is simple enought that it wasn't the part that was difficult to understand.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com