Clear Filters
Clear Filters

Am trying to extract features from EMG signal and attaching the code herewith... plz help me whether i have provided the proper initialization...

2 views (last 30 days)
x = load('emg.mat');
function feat = getfTDDfeat_Online(x,steps,winsize,wininc)
NFPC = 6;% we extract 6 features/channel
steps = 4;
datasize = size(x,1);
Nsignals = size(x,2);
winsize = 150;
wininc = 50;
numwin = floor((datasize - winsize)/wininc)+1;
NumSigFeat = Nsignals*NFPC;
% allocate memory
feat = zeros(numwin,Nsignals*NFPC);
% sliding windows increments
st = 1;
en = winsize;
for i = 1:numwin
curwin = x(st:en,:);
% steps1: Extract features from original signal and a nonlinear version of it
ebp = KSM1(curwin);
efp = KSM1(log(curwin.^2+eps).^2);
% steps2: Correlation analysis
num = -2.*ebp.*efp;num = sum(num'*num)./NumSigFeat;
den = efp.*efp+ebp.*ebp;den = sum(den'*den)./NumSigFeat;

Answers (1)

arushi on 21 Nov 2023
Hi Emimal,
I understand that you want to extract the features from EMG signals file. In the provided code, there are a few potential areas of improvement:
  1. Function Input Parameters: It seems that the input parameters steps, winsize, and wininc are defined as input arguments to the function getfTDDfeat_Online. However, within the function, these parameters are reassigned with fixed values. This might cause confusion and unexpected behavior. If these values are meant to be fixed, it's better to remove them from the function signature and define them directly within the function.
  2. Data Loading: The code starts with loading the EMG data from a file named 'emg.mat'. It's assumed that this file contains the EMG data in a suitable format for further processing.
  3. Sliding Window: The code sets up a sliding window loop to process the EMG signal in overlapping windows. The current implementation appears to extract features from each window separately.
Hope this helps.


Find more on Fourier Analysis and Filtering in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!