public void ApplyFilter() { switch (fPostAction) { case PostAction.paSpline: { SplineFilter splineFilter = new SplineFilter(fSplineCount); for (int i = 0; i < fData.Count; i++) { TrendPoint trendPt = this[i]; trendPt.pFilteredValue = splineFilter.Run(trendPt.pValue); } //splineFilter.Dispose(); } break; case PostAction.paFilter: { int count = fData.Count; if (count != 0) { LowPassFilter lowPassFilter = new LowPassFilter(count); try { for (int i = 0; i < count; i++) { lowPassFilter.SetInputDataItem(i, this[i].pValue); } lowPassFilter.SetMode(fFilter.Mode); lowPassFilter.SetBandWidth(fFilter.BandWidth); lowPassFilter.SetOvershoot(fFilter.Overshoot); lowPassFilter.SetFrequencyResolution(fFilter.FrequencyResolution); lowPassFilter.SetSuppressionDegree(fFilter.SuppressionDegree); lowPassFilter.SetSubstractionNoiseDegree(fFilter.SubstractionNoiseDegree); lowPassFilter.Execute(); for (int i = 0; i < count; i++) { this[i].pFilteredValue = lowPassFilter.GetOutputDataItem(i); } } finally { //lowPassFilter.Dispose(); } } } break; } }