Have you looked at the Measurement Studio analysis controls (see Visual Basic Help->Analysis Controls in the Measurement Studio reference)? Specifically, the CWDSP control might have what you need for filtering data, and the CWStat control may have what you need for averaging.
- Elton