Event Detection and Signal Averaging in Data Analysis

Slide Note
Embed
Share

In this detailed guide, learn about event detection from raw data and the theory behind it, focusing on identifying repeated motifs in signals using sliding windows and reference profiles. Explore the concept of on-line event detection algorithms and signal averaging techniques to improve signal-to-noise ratio. Follow an exercise workflow for analyzing accelerometer data of repetitive movements. MATLAB prerequisites and code resources are provided for practical implementation.


Uploaded on Oct 08, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. Event detection from raw data John-Eric Sax n josaxen@abo.fi

  2. Prerequisites Matlab (tested on 2015a, 2018b) with default toolboxes installed Android/iOS smartphone with accelerometer Matlab mobile app Matlab source code is provided in zip package on course website

  3. Event detection - theory Raw data often contains repetitions of the same event signal, e.g. EKG signal, step detection Only interested in subset of the signal time domain -> apply sliding window How to extract the repeated motifs? Use a library of reference profiles Align reference profile against signal to obtain matches Use selected criteria for match, e.g. minimize Euclidean (L2 norm) or maximize correlation

  4. Event detection - theory On-line event detection algorithm computed on edge Preprocess raw data normalize and filter e.g. with median filter Windowing select window width >= event Initialize reference profile(s) Peak detection Alignment detect event repetitions by matching and aligning against ref. profile Derive features and metrics from detected events Raw data Alignment Reference signals Averaged feature(s) Upwards acceleration 500 1000 800 400 600 acceleration (mm/s2) 300 400 200 200 0 100 -200 -400 0 -600 -100 -800 0 100 200 300 400 0 200 400 600 800 1000 sample 500 Downwards acceleration 50 400 0 acceleration (mm/s2) 300 -50 200 100 -100 0 -150 -100 0 200 400 600 800 1000 -200 0 200 400 600 800 sample

  5. Event detection signal averaging Assume we have n events, which are noisy repetitions of equal length Obtain signal average as the mean of n repetitions Signal-to-noise ratio: ??? =??????? ?????? Signal averaging improves SNR by factor ? , ? = number of repetitions Limitations Assumes that noise is uncorrelated Requires synchronized signals Signals must share common shape

  6. Exercise workflow Log accelerometer data containing repetitive movements, e.g. from walking stairs or jumping Install and start Matlab mobile app Tap menu and select sensors, acceleration symbol Choose sampling frequency and select either Stream to MATLAB or Log Press START to upload sensor data to Matlab drive or stream to PC Load logged data into Matlab workspace: load XXX.dat Data is now available as a Timetable object. Timetable.Variables property contains the acceleration matrix.

  7. Matlab code parameters Input: 1D acceleration data vector data shape_size Defines the width of the reference profile. Optimal width depends on sample rate and event length. peak_threshold Defines the tolerance/threshold for detecting a movement. Number indicates fraction of 99% percentile filtered peak. filter_coefficient Determines width (samples) of median filter window direction Detect events in positive (1) or negative (-1) direction use_filtered Option to extract shapes with filtering or without. runs Number of iterations to go through the same dataset. Default is now 0, i.e. batch mode and no adaptive learning. Outputs reference_profile initialized/learned reference profile, defaults to Gaussian all_profiles matrix of all detected event profiles all_features matrix of features/metrics extracted from profiles (min/max/avg, integral, A95, transition time, correlation)

  8. Tasks Goal: extract repetitions of events from collected sensor data using the provided Matlab code Hints Initialize shape_size as sample_rate*time(event) Use e.g. correlation feature (all_features(:,5)) as metric of detection accuracy If necessary tweak parameters direction, peak_threshold and filter_coefficient Report the number of events detected, the match % and the correlation of each event w.r.t. reference profile Plot detected event profiles (all_profiles) Plot the reconstructed signal average as the mean of the matrix all_profiles Bonus: run the algorithm in iterative mode by increasing value of runs parameter. This will update reference profile based on learned input. Does the correlation and match % improve?

Related


More Related Content