How to plot the average wavelet magnitude over range of frequencies
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Emma Vande-Wouwer
am 16 Jun. 2022
Beantwortet: Jonas
am 4 Jul. 2022
Hi !
I was wondering if it's possible these kinds of plots of wavelot transforms in matlab:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1034435/image.jpeg)
A is the wavelet transform amplitude accross frequency and times then B is the average wavelet for the range of frequencies.
I found that the wavelet toolbox has the timeSpectrum and scaleSpectrum function but both these functions give the average wavelet amplitude over time and scale and I would like to have it over frequencies like figure b:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1034440/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1034445/image.jpeg)
Is there a parameter for these function to do this or is there another spectrum function that gives the average wavelet amplitude over frequencies ?
Thank you in advance!
0 Kommentare
Akzeptierte Antwort
Jonas
am 4 Jul. 2022
why not use the output of the cwt function? you can average it yourself:
load mtlb
t=(0:numel(mtlb)-1)/Fs;
[wt,f,coi]=cwt(mtlb,Fs);
ca=subplot(2,1,1);
surf(t,f,abs(wt))
shading flat;
axis tight;
set(ca,'YScale','log')
xlabel('time (s)');
ylabel("Frequency (Hz)")
zlabel('magnitude');
view([-79 50])
subplot(2,1,2);
[sortF,idx]=sort(f);
wt=wt(idx,:);
semilogx(f,mean(abs(wt),2));
xlabel("frequency (Hz)")
ylabel('mean amplitude');
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Continuous Wavelet Transforms 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!