Minimizing noise: Funcfit on wave operations?
schmaud
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
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
February 7, 2017 at 11:25 am - Permalink
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:
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
February 14, 2017 at 01:35 pm - Permalink
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
February 14, 2017 at 03:50 pm - Permalink