Open pavleb opened 3 years ago
Sorry for the late reply, I'm a bit busy at the moment but I'll get back to you at the weekend. Looks like a good idea though, thanks for your time and effort!
Ok, sounds great! Feel free to push your branch and I'll be glad to take a look.
Checking from MODA, bispectral analysis can be implemented straightforward. In its calculation it relies on
wavelet_transform.py
. For two signalssig1
andsig2
, the bispectral analysis requires spectra at frequencies so it becomes B(ω1,ω2,ω1 + ω2). When performing wavelet transform usingwavelet_transform.py
the frequencies at which the wavelet coefficients are calculated are selected using fmin and fmax as well as the number of voicesnv
.However for bispectral analysis we need also frequencies that are sum of the pairs. What I suggest is the following:
Change the signature of the function
wavelet_transform
inwavelet_transform.py
by adding new parametersel_freqs = None
. This would change two things how this function executes. Ifsel_freqs
is set then the function will ignorefmin
andfmax
and calculate the wavelet transform at the provided list of frequencies. This is achieved with these two blocks:and
By doing so, we can implement bispectral analysis in no time. I have a prototype working, I can push it in a new branch. I just wanted to double check with you whether such a signature change to
wavelet_transform
function is acceptable for you. It remains backwards compatible but for my taste it becomes cumbersome. Maybe, we can separate the frequency interval calculation as an auxiliary function and decouple the process.Please let me know what do you think.