How and What features are extracted using Wavelet Packet Transform

3 次查看(过去 30 天)
I have and Signal of 10000*3 size.I would like to extract the features from Wavelet coefficiensts of last level. Since it is wavalet packet transform,for 3rd level i will be having 8 sub bands.How this help us to extract the Features and What are the Features need to Extract generally
wname='sym5';level=3;keepap=1;
crit='shannon';critv=0;
% sorh='s';
% dwtmode('per'); %signal Extension
emg_notch=abs(rand(10000,3));
wpt(:,i)=wpdec(emg_notch(:,i),level,wname,crit,critv); %Wpt Decomposition
Index in position 2 is invalid. Array indices must be positive integers or logical values.
%% Level 3 Coefficienst %%
WP_cfs10(:,i)=wpcoef(wpt(:,i),[3 0]);
WP_cfs11(:,i)=wpcoef(wpt(:,i),[3 1]);
WP_cfs12(:,i)=wpcoef(wpt(:,i),[3 2]);
WP_cfs13(:,i)=wpcoef(wpt(:,i),[3 3]);
WP_cfs14(:,i)=wpcoef(wpt(:,i),[3 4]);
WP_cfs15(:,i)=wpcoef(wpt(:,i),[3 5]);
WP_cfs16(:,i)=wpcoef(wpt(:,i),[3 6]);
WP_cfs17(:,i)=wpcoef(wpt(:,i),[3 7]);

回答(1 个)

Suraj Kumar
Suraj Kumar 2024-8-30
Hi C Prasad,
To extract features using the Wavelet Packet Transform (WPT), you can go through the following steps along with the attached code snippets:
1. Decompose the signal using the ‘wpdec function and loop over each column of your signal to cover different channels and extract the coefficients from each sub-band using the ‘wpcoef function.
for i = 1:3
wpt{i} = wpdec(emg_notch(:, i), level, wname, crit, critv);
for j = 0:7
WP_cfs{j+1, i} = wpcoef(wpt{i}, [3, j]);
end
end
2. After getting the coefficients, you can extract various features accordingly.
features(j, 1, i) = mean(coeffs);
features(j, 2, i) = std(coeffs);
features(j, 3, i) = sum(coeffs.^2);
features(j, 4, i) = entropy(coeffs);
features(j, 5, i) = max(coeffs);
To know more about the ‘wpdec and wpcoef function in MATLAB, you can refer to the following documentations:
Hope this helps!

类别

Help CenterFile Exchange 中查找有关 Signal Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by