- The resulting wcoh matrix will contain the wavelet coherence values for each frequency and scale.
- It's important to remember that synchrosqueezing could result in certain alterations in the frequency domain., which could affect the coherence calculation. You may want to compare the results with and without synchrosqueezing to ensure that it's appropriate for your specific application.
Can you perform a wavelet coherence calculation with synchrosqueezing of the signals?
22 ビュー (過去 30 日間)
古いコメントを表示
Hi,
I'm analyzig some dynamic time domain data and comparing multiple signals. So far, I have good results using the wavelet transform (cwt), but I also tried the synchrosqueezed transform (wsst) and I'm exhilerated by it's effects on each signal! However, what I really need is the wavelet coherence (wcoherence), and I was wondering if there's a way to integrate the synchrosqueezing into wcoherence so that the two signals wsst'ed before being wcoherence'd.
0 件のコメント
回答 (2 件)
Gayatri Rathod
2023 年 3 月 3 日
Hi Vitek,
Yes, it is possible to perform a wavelet coherence calculation with synchrosqueezing of the signals in MATLAB. You can use the Wavelet Toolbox, which provides functions for computing the wavelet transform, wavelet coherence, and synchrosqueezing transform.
Here's an example of how you can compute the wavelet coherence with synchrosqueezing:
% Load the data for the two signals you want to analyze.
load signal1.mat
load signal2.mat
% Compute the synchrosqueezed wavelet transform of each signal using the wsst function.
scales = 1:128;
freqs = logspace(log10(0.01), log10(1), 128);
wst1 = wsst(signal1, scales, freqs);
wst2 = wsst(signal2, scales, freqs);
% Compute the wavelet coherence of the two signals using the wcoherence function, using the synchrosqueezed wavelet transform as input.
wcoh = wcoherence(wst1, wst2);
You can read more about the wsst and wcoherence from the following documentations: wsst Function, wcoherence Function.
Hope it helps!
Regards,
Gayatri Rathod
1 件のコメント
xiaoran Yin
2023 年 4 月 17 日
I'm sure the above code is not feasible because that's what I was thinking at the beginning, now I've modified the wsst by combining it with the settings of the wavelet coherence toolbox so that the results obtained can be generated including AR1 significant tests, COI ranges, etc. (of course these are in the tool above) The results are quite promising, at least up to this step of generating CWT photo.![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1358538/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1358538/image.png)
left is cwt and right is sst-cwt, I purposely did not modify the range of significant regions because it is not appropriate, in my opinion, to perform significance tests on the compressed coefficients.
However, the results are not so promising for the next step, which is the coherence calculation of the two compressed wavelet coefficient matrices.The figure below shows the results of my wavelet coherence of the two time series, at this point it can be seen that compared to the original results, what we want does not seem to be reflected, i.e. the wavelet coefficients get compressed in frequency in the high region, but simply disappear.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1358543/image.png)
My following idea is to perform a similar compression on the wavelet coherence coefficients as I did on the continuous wavelet coefficients, but since I am not a math or signal major, and in fact I am classified as a researcher in the field of geosciences, this process has become increasingly difficult for me, and I would be grateful if anyone could help me with this part.
In addition, the above if there is any reading difficulties that is normal, because this is the translated by software translation, I really get the code to get a headache. ;(
You can contact me through my email:yxrhhu@163.com or 220401010008@hhu.edu.cn
2 件のコメント
xiaoran Yin
2023 年 11 月 13 日
編集済み: xiaoran Yin
2023 年 11 月 13 日
@Vitek StepienSo glad this issue is getting attention again.Actually your idea is the same as I answered at the beginning, but after I answered it, I analyzed it in depth later on. WTC's idea can be understood as
1. cwt result of two sequences to get Wx,Wy.
2. xwt analyze it to get Wxy(Wxy=Wx.*conj(Wy);).
3. use the smoothwavelet to get sWxy, sWx, sWy.
4. compute Rsq, Rsq=abs(sWxy). ^2./(sX.*sY);
For the parameters such as octave and so on in this is not essential, and the phase angle is from the angle(Wxy) function which is also the important results. For compressing the Rsq wavelet coherence coefficients of the WTC, what we need to do is not to compress the result of the cwt from wsst. I ran your code, and the results I got are roughly the same from my figure. In my opinion, the core of achieving synchronous compression of WTC is to compress Rsq as cwt is compressed by wsst, i.e., rearrangement of wavelet coherence coefficients as in wsst.
Function wsst in matlab at last provides the function sstalgo to do the rearrangement,which is the algo of wsst (note: some modification is needed in this case if you are using a custom freq). sstalgo has three input variables, cwtcfs,phasetf,gamma.
The first is cwt coefficients, that is, the need to rearrange the object, here can be replaced by Rsq.
The third is the minimum value of cwt coefficients, you can do not care about.
The third is the core, phasetf, the wavelet transform coefficients and their derivatives of the phase difference (phasetf = imag(dcwtcfs./cwtcfs). /(2*pi);).
Undoubtedly Rsq itself doesn't have this imaginary part for us to compute, so what's possible is to compute it from inside the results of the Wxy from XWT, but the results are still unsatisfactory.
I have given up on this part for many reasons. I will upload the code I have modified, but since I am not a professional programmer, the code is very messy. And note that I am not using the wavelet tool that comes with matlab, but the Wavelet coherence toolbox from Grinsted(which is much more friendly for geostudy,GitHub - grinsted/wavelet-coherence: A cross wavelet and wavelet coherence toolbox for MATLAB),
so I hope this helps.
P.S. I hope that sharing a modified MATLAB function isn't an infringment of any copyright. If it is, I am unaware of that at the time of posting and didn't intend any harm and will remove the function from this post as soon as I'm notified( ;)Just like you. )
参考
カテゴリ
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!