I am calculating features from an EMG signal using MATLAB by segmenting the EMG signal into windows of 200 samples and then calculating the features of each window.
I need help trying to use a histogram feature please.
I can easily generate a vector of bins for one data window using the following code:
binCount = 9;
[histBins, ~] = histcounts(dataWindow, binCount);
However, the experiment I am following states the histogram is divided into 9 bins along a 3 standard deviation (sigma) threshold. I am confused as to how the threshold fits in with generating the histogram bins.
Is a 3 sigma threshold calculated for each data window and the data points falling within that threshold used to generate the histogram? Example pseudo code:
for i = 1:numDataWindows
dataWindow = windows(i);
Calculate 3 standard deviations threshold using dataWindow
Get data points from dataWindow that fall within threshold
Generate histogram on data points within threshold
...
Store histogram bins for later use
end
Or is the 3 sigma threshold generated from the entire data signal, before windowing, so that the same threshold is then applied to each data window before generating each histogram?