How does scaleSpectrum function work?

Dear community!
I am using continuous wavelet transform in my data analysis, and wish to quantify a time-dependent power, by integrating the wavelet power over scales (frequencies). MATLAB has a function for that - scaleSpectrum, but I find it hard to understand what exactly it computes.
What does scaleSpectrum function compute exactly - Which formula does it use? And, how does this formula change when a specific value of SpectrumType parameter is given?
Unfortunately, I couldn't find the information in the function's documentation (https://se.mathworks.com/help/wavelet/ref/cwtfilterbank.scalespectrum.html#namevaluepairs), and has no "Algorithms" section. Regarding "SpectrumType", it writes the following:
"Type of wavelet spectrum to return, specified as a comma-separated pair consisting of 'SpectrumType' and either 'power' or 'density'. If specified as 'power', the averaged sum of the scale-averaged wavelet spectrum over all scales is normalized according to the value specified in 'Normalization'. If specified as 'density', the weighted integral of the wavelet spectrum over all scales is normalized according to the value specified in 'Normalization'."
Question 1 (SpectrumType='power'): "averaged sum of the scale-averaged wavelet spectrum over all scales". So the wavelet spectrum is first scale-averaged, then it is summed, and then averaged again? What is 'spectrum', that is being scale-averaged, exactly?
Question 2 (SpectrumType='density'): "the weighted integral of the wavelet spectrum over all scales". Does this mean that the wavelet spectrum is integrated? And the integral is "weighted"? Would it be possible to clarify this?
I also couldn't find any information on google, Matlab Answers, Newsgroup, Blog, FileExchange, etc. The link to FAQ given here (https://se.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-question-on-answers-and-get-a-fast-answer) couldn't be opened (broken).
Thanks everyone for replies, help, and wish you all the best!
Oleg

3 件のコメント

dpb
dpb 11分 前
Have you referred to the reference papers from which it appears the function implementation was derived?
I asked an AI 'bot the Q? and it created at least a plausible sequence of steps that you would want to confirm would produce the outputs..
Oleg
Oleg 41分 前
編集済み: Oleg 37分 前
Hi DPB, Thanks for reply — yes, saw the reference, but they are not referred to in the documentation, unfortunately, so not very helpful for understanding what the function computes... The function can produce different normalizations based on given parameters, but which equation from which reference they implement is not stated. I tried AI too, but it is still guessing, which I'd like to avoid.
dpb
dpb 5分 前
Did you read the m-file to see if it is commented as to which pieces-parts came from where? MOST Mathworks developers are pretty good in that regards although it's not universal.
Failing that, try to see if the AI prescription produces a recognizable result for a sample case -- if that were so, it would be pretty-much mandatory to be what was done for at least that case.
Failing that, you can always ask for a support request from Mathworks to get further explanation of just what the input explanations really mean.
NOTA BENE: I'm not suggesting that having sufficient documentation to be able to understand the function is not important...it should be but Mathworks also tries to minimize the effort and cost of documentation given that it is a commercial venture so shortcuts are taken, understandedly.

サインインしてコメントする。

回答 (0 件)

製品

リリース

R2026a

質問済み:

約5時間 前

コメント済み:

dpb
約2時間 前

Community Treasure Hunt

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

Start Hunting!

Translated by