How to find peaks in streaming data while using a moving average filter?

5 visualizaciones (últimos 30 días)
Hello MATLAB community,
This is my first post; I've done some searching on the site to find similar questions/solutions, but I haven't been successful, so I apologize if this question is redundant.
I'm using a scope to stream live data from a microcontroller, and I'd like to be able to detect peak values in the signal within a certain window of data points. I'm using a moving average filter with a window length of 10 currently. I'm wondering if there is an analogous way to implement peak finding within a certain window frame. I'm able to get the peak values after the data collection is complete, but I'm looking to do peak detection live.
I'm aware the scope has a built in peak finder tool and GUI, but I don't know how to implement that functionality with code. Those are two ideas I have for a solution, but I am open to other suggestions, too.
Thank you for your time and input! I appreciate it! Below is the code I'm working with:

Respuestas (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by