How to calculate the energy of details and approxmiations coefficients of discret wavelet transform ?
조회 수: 6 (최근 30일)
이전 댓글 표시
Hi everyone, i calculate the energy of details and approxmiations coefficients of discret wavelet transform .i used DWT(Daub4) Here is the code
for n=1:23
deriv=(val(n,:))/2.559375;
t=(0:length(deriv)-1)/Fs;
result{n} = filtfilt(d1,deriv);
[c,l]=wavedec(result{n},4,'db4');
[cd1,cd2,cd3,cd4]=detcoef(c,l,[1,2,3,4]);
cA4=appcoef(c,l,'db4',4);
[Ea,Ed]=wenergy(c,l)
energie{n} = {Ea, Ed};
end
And when i was looking for the formula of the energy i found this :
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/166185/image.png)
and as i understand the energy is the percentage of energy corresponding to the approximation and the details
So when i was trying to write a C code using this formula and the values of cd1,cd2,cd3,cd4 i don't get the same values that i have with matlab So i want to know where i wrong ?
i mean to calcuate the energy i should use [cd1,cd2,cd3,cd4]??
Please i need a clarification,Thanks
댓글 수: 2
Sandeep Nayak
2019년 11월 8일
yes. cd1,cd2,cd3,cd4 are the details coefficients and the command wenergy gives the percentage of energy not the actual energy. you can calculate the percentage energy by the expression i.e. percentage energy due to approximation = (energy of approximation-energy of details)/energy of approximation *100. similarly % energy due to details = 100-% energy due to approximation. energy of approximation is sum of square of approximation coefficients and energy of details is sum of square of details coefficients. Hope you got your answer..
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Continuous Wavelet Transforms에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!