how can i lower the requested number of coefficient in gtcc?

5 次查看(过去 30 天)
i am trying to extract the feature using gtcc. Error is shown the in the command window. My fs is 1k, I need to lower the requested number of coefficients.
clear all close all clc
numfiles=1947;
Features=[];
fs=1000;
N = 4; % Order
Fc1 = 1; % First Cutoff Frequency
Fc2 = 100; % Second Cutoff Frequency
% Construct an FDESIGN object and call its BUTTER method.
h = fdesign.bandpass('N,F3dB1,F3dB2', N, Fc1, Fc2, fs);
Hd = design(h, 'butter');
for i=1:numfiles
% Data Loading
filename=sprintf('B(%d).mat',i);
ECG=importdata(filename);
%preprocessing
EECG=filter(Hd,ECG);
%Feature Extraction
GTCC = rms(gtcc(EECG,fs,'numcoeffs',4));
Feat=[GTCC];
Features=[Features;Feat];
disp(i)
end

回答(1 个)

Vidhi Agarwal
Vidhi Agarwal 2024-11-4,5:47
When you're using the "gtcc" function for feature extraction and encounter an error related to the number of coefficients, it typically means that the requested number of coefficients ('numcoeffs') is too high for the given sampling frequency and signal length. Below are the ways you can follow that might help you out.
  • Make sure that the length of your ECG signal is sufficient for the "gtcc" computation. If the signal is too short, it may not support the requested number of coefficients.
  • Start with a smaller number and gradually increase it to find the maximum that your data can support.
  • Verify that the sampling frequency (fs) is correctly set and appropriate for the ECG data. A mismatch in expected and actual sampling frequency can affect feature extraction.
  • Ensure that the preprocessing step (bandpass filtering) does not excessively reduce the signal length or alter it in a way that affects the "gtcc" computation.
To understand more about "gtcc" function, refer to the following documentation:
Hope that helps!

类别

Help CenterFile Exchange 中查找有关 Filter Design 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by