bryanwweber / UConnRCMPy

Data processing code for the RCM at UConn
BSD 3-Clause "New" or "Revised" License
4 stars 3 forks source link

Fix automatic selection of filtering frequency sometimes chooses bad values #22

Closed bryanwweber closed 7 years ago

bryanwweber commented 7 years ago

Bad in this sense means that the agreement between the filtered pressure trace and the raw pressure trace is really bad for a short segment of time, usually near ignition. Usually increasing the filter frequency manually improves agreement. See below.

pastedimage

bryanwweber commented 7 years ago

One possible fix for this is to limit the filter selection window to just the interesting part of the pressure trace. We should investigate if the noise frequency is a function of time.

bryanwweber commented 7 years ago

It seems like a couple of things helped here for some sample data. First was using a first order Butterworth filter instead of second order. Another is trying to optimize the selection of the linear portion of the residuals curve by estimating R^2 of the linear fit and iterating the choices of the start and stop until R^2 > some value, say 0.95 or 0.99