StingraySoftware / stingray

Anything can happen in the next half hour (including spectral timing made easy)!
https://stingray.science/stingray
MIT License
174 stars 144 forks source link

Can we use Bispectrum function for audio analysis? #639

Open monk1337 opened 2 years ago

monk1337 commented 2 years ago

Hi, I am trying to implement Bispectrum function for audio analysis and found your repo. But this function takes a light curve object as input, can we make it more general to utilise for other purposes?

How Bispectrum can be use in audio analysis can be found here: Screenshot 2022-02-21 at 4 02 06 PM Screenshot 2022-02-21 at 4 02 13 PM

matteobachetti commented 2 years ago

Hi @monk1337, good point. I drafted the relevant functions here: https://github.com/StingraySoftware/stingray/pull/640. If you could help us test it using your own data, it would be great!

monk1337 commented 2 years ago

Hi @matteobachetti Thank you for quick reply and help, However I am still confused how to use any of that function, to give an example my data looks like this:

I have audio segments in numpy representation, such as:

Screenshot 2022-02-22 at 2 16 53 PM

For each segment ( Numpy array ) I am calculating the features, such as :

Screenshot 2022-02-22 at 2 17 06 PM

You can run the minimal working example here:

https://colab.research.google.com/drive/1l_sAJqjfukX-Ux4xNCdjMNBiYPuVmxfz?usp=sharing

How should I calculate the Bispectrum Score (BGS) for this numpy array (audio segment )?

monk1337 commented 2 years ago

@matteobachetti any updates?

matteobachetti commented 2 years ago

@monk1337 the use case seems very different from ours. At the moment, it's difficult for me to understand how to adapt our infrastructure to your use case. I would need some time dedicated to this issue, which I cannot afford at the moment. If you have time to investigate this, free to propose improvements of the code, though