- 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.
- 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.
- 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.
Am trying to extract features from EMG signal and attaching the code herewith... plz help me whether i have provided the proper initialization...
5 次查看(过去 30 天)
显示 更早的评论
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;
0 个评论
回答(1 个)
arushi
2023-11-21
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:
Hope this helps.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Measurements and Feature Extraction 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!