It is to ask how to Extract features from a signal in matlab

6 次查看(过去 30 天)
I have a project to do. But I am a newbie in matlab.
***
Let me say somethig about the dataset.
Pulse Transit Time (PTT) is the time that pulse waves require to travel in blood vessels between two
sites. It is an important indicator for many medical properties and recent research focused on its
potential for blood pressure monitoring.
A total of 22 participants were involved in the data collection while performing three different activities (‘sit’, ‘walk’, ‘run’). The dataset contains 66 recordings. A recording contains 11 time series variables, each representing a physiological signal for more than 40,000
heartbeats.Each signal variable(column) has min 242K samples.
******
The idea is to extract features( like mean, min, max, std, median) from a signal. BUt the professor was telling us to extract those features with a sliding window with 50% of overlap.
1) Having such a big samples on every signal(column) what is the recommended window size?
2) what is the point of overlapping?
2) How is the sliding window implemented with a 50% of overlapping?
3) How are the extracted features are stored.
***
Anyone who can give me a starting point will be appreciated.

回答(1 个)

Yash Sharma
Yash Sharma 2023-9-20
I understand that you have large amount of time series data and you want to extract features like mean, min, max, std, median using sliding window protocol.
  • The recommended window size for feature extraction depends on the signal's characteristics and analysis goals.
  • Choose a window size that captures meaningful patterns while remaining computationally feasible.
  • Start with a window size of several thousand samples (e.g., 5000 or 10000).
  • Adjust the window size based on analysis results and requirements.
  • Overlapping in a sliding window approach ensures that adjacent sections of the signal are included in the extracted features.
  • Overlapping allows for a smoother transition between windows and avoids potential information loss at the boundaries, it also captures temporal relationships that can improve accuracy.
Here’s an example code on how you can implement sliding window protocol with 50% overlap on timeseries data.
% Parameters
windowSize = 5000; % Window size
overlap = windowSize / 2; % Overlap size
% Generate example time series data
timeSeriesData = rand(1, 242000); % Replace with your actual time series data
% Initialize variables
numWindows = floor((length(timeSeriesData) - windowSize) / overlap) + 1;
features = zeros(numWindows, 5); % Assuming 5 features to be extracted
% Sliding window protocol
startIndex = 1;
for i = 1:numWindows
endIndex = startIndex + windowSize - 1;
% Extract features from the current window
windowData = timeSeriesData(startIndex:endIndex);
feature1 = mean(windowData);
feature2 = min(windowData);
feature3 = max(windowData);
feature4 = std(windowData);
feature5 = median(windowData);
% Store the extracted features
features(i, :) = [feature1, feature2, feature3, feature4, feature5];
% Slide the window
startIndex = startIndex + overlap;
end
% Display the extracted features
disp(features);
  • You can use “tables” in MATLAB to store tabular data.
Please find links to below documentation which I believe will help you for further reference.

Community Treasure Hunt

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

Start Hunting!

Translated by