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

5 ビュー (過去 30 日間)
Muhammad
Muhammad 2022 年 6 月 5 日
回答済み: Vidhi Agarwal 2024 年 11 月 4 日 5:47
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 Center および File ExchangeFilter Design についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by