LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
BruceAmmons

Initialize filters with first value

Status: Declined

Any idea that has received less than 8 kudos within 8 years after posting will be automatically declined.

Currently, whenever you filter data it is initialized with all zeroes.  If your data is fairly constant, there is a large section where the filtered value slowly goes from zero to the steady state value.  This is annoying when doing a quick look at the filtered data, because you have to rescale a graph to ignore the ramping portion of the filtered data.

 

My suggestion is to provide an option for either providing a starting value for the filter or automatically using the first value of the data being filtered.  For fairly constant data, this would eliminate the large ramp from zero.  For varying data, it would start better as well.  It seems the initial value is fairly arbitrary, so it shouldn't violate any mathematical rules.  It would be the equivalent of subtracting the first value from all the data, filtering, then adding the first value back to the filtered data.

 

Bruce

Bruce Ammons
Ammons Engineering
3 Comments
LuI
Active Participant
Active Participant

I'd suggest not a constant 1. element, but an appropriate number of the elements in reversed order so that wnhe reaching the original 1st element, the filters are set. So if having an array of (0,1,2,3,4,5,4,3,2,1,0,1,2...) and a filter that needs 3 elemnt to set, use an array of (3,2,1,0,1,2,3,4,5,4,3,2,1,0,1,2...) and remove those additional elemnts after filtering.

BruceAmmons
Trusted Enthusiast

There are several options - repeating constant, mirroring with even or odd symmetry, maybe more.  For FIR filters, several options would be useful.  I was thinking more about IIR filters, which would require an infinite number of initialization points.  I suspect there is a mathematical formula that could be used to determine the filter state so that the filter starts at the first value in the sequence instead of zero.  It would be much more complicated to initialize an IIR filter with multiple points.

 

Bruce

Bruce Ammons
Ammons Engineering
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 8 kudos within 8 years after posting will be automatically declined.