is my code are correct?? multilevel wavelet and feature extraction
1 view (last 30 days)
Show older comments
i want to use wavelet to decomposed the signal at certain detail then classify the detail of signal using parseval theorm.
. The proposed classification method is doneusing unique patterns. The difference be-tween the discrete wavelet coefficients of theanalyzed signal and a pure signal at each levelwill be computed, and the result will bedivided by the total energy of the correspond-ing pure signal for normalization purposes,and then multiplied by 100 to have apercentage ratio. but i keep getting error for my coding. is anyone can point out what is the problem with this code??
% multilevel wavelet
x = (voltage(:,1:718));
l_s = length (x)
[C,L] = wavedec( x, 3, 'db1');
% extract level 3 approximation
cA3 = appcoef(C,L,'db1',3);
%extract the levels 4,3, 2, and 1 detail coefficients from C, type:
[cD1,cD2,cD3] = detcoef(C,L,[1,2,3]);
figure (1);
figure(1); subplot(211);
plot(x); title('Original signal');
subplot(1,2,1); plot(D1); title('Detail D1')
subplot(1,2,1); plot(D2); title('Detail D2')
subplot(1,2,1); plot(D3); title('Detail D3')
%reconstruct the details at levels 1, 2 and 3, from C, type:
D1 = wrcoef('d',C,L,'db1',1);
D2 = wrcoef('d',C,L,'db1',2);
D3 = wrcoef('d',C,L,'db1',3);
%display the results of the level 3 decomposition, type:
subplot(2,2,1); plot(A3);
title('Approximation A3')
subplot(2,2,2); plot(D1);
title('Detail D1')
subplot(2,2,3); plot(D2);
title('Detail D2')
subplot(2,2,4); plot(D3);
title('Detail D3')
--------------------------------------------------------------------- %apply parseval theorm
% N= no. of sample
% J = no. of approximate level
% aj = approximate version signal
% dj = detail version signal
symsum((cA3),k,1,N)= symsum((cA^2),k,1,N)+ symsum((symsum((cD^2),k,1,N)),i,1,J);
Answers (0)
See Also
Categories
Find more on Signal Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!