How to get the approximation from wdenoise
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
pascal plisson
am 9 Aug. 2019
Kommentiert: pascal plisson
am 13 Aug. 2019
I am using the wdenoise app coming with the wavalet toolbox. After properly setting the wavelet parameters, this application provides a figure that plots the original signal, the denoised signal, and approximation. I am interested by the approximation curve. When I generate mathlab code from the app, it only generate the code for getting the denoised signal.
My question is : how to do for getting the approxiation curve in matlab from the output arguments of the wdenoise built-in function.
Thanks for your help.
0 Kommentare
Akzeptierte Antwort
Kavya Vuriti
am 12 Aug. 2019
The denoised coefficients can be obtained from the wdenoise function. Signal approximation can be done using these coefficients. Let me give an example of denoising with level 6 decomposition using ‘sym8’ wavelet.
[xden,denoisedcfs]=wdenoise( x,6, 'Wavelet', 'sym8') % xden is the denoised signal, x is the input signal
The final element of “denoisedcfs” cell array corresponds to approximation coefficients and the other elements corresponds to detail coefficients level by level. The wave decomposition vector can be found by using wavedec function. The wavelet used for denoising can be used to specify wavelet parameters for wavedec function.
[c,l] = wavedec(x,6,'sym8');
Signal approximation can be reconstructed using any level of detail coefficients and approximation coefficients. The code below reconstructs signal using 4th level detail coefficients and approximation coefficients. The detail coefficients in all other levels must be set to zero.
tmpcfs = denoisedcfs; %declare temporary cell array to use denoisedcfs for reconstruction
for ii = [1 2 3 5 6]
tmpcfs{ii} = zeros(numel(tmpcfs{ii}),1);
end
Assign the detail coefficients present in tmpcfs level by level to the wavelet decomposition vector c. Then use waverec function to reconstruct the signal approximation.
a=0;
for i=7:-1:1
c(a+1:a+numel(tmpcfs{1,i}))=tmpcfs{1,i}';
a=a+numel(tmpcfs{1,i});
end
X = waverec(c,l,'sym8'); %X is the signal approximation.
3 Kommentare
Kavya Vuriti
am 13 Aug. 2019
From your code, I found that you have not used wavedec function to find the decomposition vector.
[c,l] = wavedec(signal,6,'sym8');
Also in the waverec function, the second parameter must be "l" obtained from the above line of code.
X = waverec(c,l,'sym8');
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Signal Analysis finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!