TransylvanianInstituteOfNeuroscience / Superlets

MIT License
81 stars 26 forks source link

Is it possible to get complex output? #3

Open vikamanyukhina opened 7 months ago

vikamanyukhina commented 7 months ago

Dear developers,

Thank you for your work! In my lab we're using superlet, and I also recently tested the last version of it, "superlets" function from superlet.py. I observed that this new version works a bit better with my data, however, its output is power, as far as I understand. Besides the power, for some analyses I also need the phase of oscillations, which I can get only from a complex output, but not power. So I wanted to ask, do you think it's possible to modify your superlets function to get complex values as its output? I tried to do that by myself, but I realized that geometric mean estimation used in this function might work incorrectly with negative values, i.e. the row 207 of superlet.py. Thank you in advance, I would be very grateful for any response!

TransylvanianInstituteOfNeuroscience commented 7 months ago

Hello,

The superlet transform, as it is presented in the original papers, is defined to compute power, not a complex representation. However, the old version was computing the power a bit weirdly and was outputting a complex representation that the user then had to extract the power values from. Luckily, due to some interactions with a group that wanted to use superlets for radar applications, and needed a complex representation that spans the negative frequencies as well, I developed a version of the superlet transform that can take real or complex input and output a complex representation, correctly computing the complex geometric combination of the individual wavelet responses. It is implemented in MATLAB, for now, in this file Superlets/matlab-pure/nfaslt.m at main · TransylvanianInstituteOfNeuroscience/Superlets (github.com) https://github.com/TransylvanianInstituteOfNeuroscience/Superlets/blob/main/matlab-pure/nfaslt.m. If I understood correctly, this is exactly what you need. I will work with one of the python wizards in our lab this week to get out a python version of that file sometime this week.

Hope this helps, Harald

On Sat, 9 Dec 2023 at 02:03, VikaMan @.***> wrote:

Dear developers,

Thank you for your work! In my lab we're using superlet, and I also recently tested the last version of it, "superlets" function from superlet.py. I observed that this new version works a bit better with my data, however, its output is power, as far as I understand. Besides the power, for some analyses I also need the phase of oscillations, which I can get only from a complex output, but not power. So I wanted to ask, do you think it's possible to modify your superlets function to get complex values as its output? I tried to do that by myself, but I realized that geometric mean estimation used in this function might work incorrectly with negative values, i.e. the row 207 of superlet.py. Thank you in advance, I would be very grateful for any response!

— Reply to this email directly, view it on GitHub https://github.com/TransylvanianInstituteOfNeuroscience/Superlets/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR3QLFHSAPVBE4X3YJX4CGLYIOTCDAVCNFSM6AAAAABANK5J6CVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZTGNBUHEZDQNY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Harald Bârzan, PhD Transylvanian Institute of Neuroscience (TINS), Department of Experimental and Theoretical Neuroscience, Str. Ploiesti 33 https://maps.google.com/?q=Str.+Ploiesti+33&entry=gmail&source=g, 400157 Cluj-Napoca, Romania Email: @.***

vikamanyukhina commented 7 months ago

Hello Harald,

That's great, thank you a lot! Yes, that's exactly what I need! Will start with this and will be waiting for the python version:)

All the best, Viktoria

TransylvanianInstituteOfNeuroscience commented 7 months ago

Hello,

I uploaded a file that computes the complex superlet transform of real input data. Looking back, the matlab version that I previously mentioned computes the power (real) superlet spectrum of real or complex input data, so it was not necessarily what you needed. Apologies for the confusion.

Best, Harald

On Mon, 11 Dec 2023 at 11:30, VikaMan @.***> wrote:

Hello Harald,

That's great, thank you a lot! Yes, that's exactly what I need! Will start with this and will be waiting for the python version:)

All the best, Viktoria

— Reply to this email directly, view it on GitHub https://github.com/TransylvanianInstituteOfNeuroscience/Superlets/issues/3#issuecomment-1849644983, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR3QLFHA6TCB7YEGDTNYTLTYI3G7RAVCNFSM6AAAAABANK5J6CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNBZGY2DIOJYGM . You are receiving this because you commented.Message ID: @.*** .com>

-- Harald Bârzan, PhD Transylvanian Institute of Neuroscience (TINS), Department of Experimental and Theoretical Neuroscience, Str. Ploiesti 33 https://maps.google.com/?q=Str.+Ploiesti+33&entry=gmail&source=g, 400157 Cluj-Napoca, Romania Email: @.***

vikamanyukhina commented 7 months ago

Hello Harald,

Thank you a lot for your work!! I will test it soon:)

All the best, and have a nice week-end, Viktoria

perevo commented 3 months ago

Hello, I uploaded a file that computes the complex superlet transform of real input data. Looking back, the matlab version that I previously mentioned computes the power (real) superlet spectrum of real or complex input data, so it was not necessarily what you needed. Apologies for the confusion. Best, Harald

Hello,

Is it possible to have a Matlab version to compute the complex superlet transform of real input data?

Best, Jianrong

HaraldBarzan commented 2 months ago

Hello,

Sorry for the delayed response. Unfortunately there's no MATLAB version of SuperletCX at the time and we are very swamped with other work right now. Can I suggest marshalling data from MATLAB to Python and using that version instead, just for the time being?

Best, Harald

perevo commented 2 months ago

Hello Harald, Thanks for your response. I'll try it soon.

Best, Jianrong