You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checking from MODA, bispectral analysis can be implemented straightforward. In its calculation it relies on wavelet_transform.py. For two signals sig1 and sig2, the bispectral analysis requires spectra at frequencies so it becomes B(ω1,ω2,ω1 + ω2). When performing wavelet transform using wavelet_transform.py the frequencies at which the wavelet coefficients are calculated are selected using fmin and fmax as well as the number of voices nv.
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 in wavelet_transform.py by adding new parameter sel_freqs = None. This would change two things how this function executes. If sel_freqs is set then the function will ignore fmin and fmax and calculate the wavelet transform at the provided list of frequencies.
This is achieved with these two blocks:
if sel_freqs is not None:
fmin = np.min(sel_freqs)
fmax = np.max(sel_freqs)
nv = len(sel_freqs)
and
if sel_freqs is not None:
freq = sel_freqs
else:
freq = 2 ** (
arange(ceil(nv * np.log2(fmin)), np.floor(nv * np.log2(fmax)) + 1).conj().T / nv
)
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.
The text was updated successfully, but these errors were encountered:
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!
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.
The text was updated successfully, but these errors were encountered: