Spectrogram function for Spectro-temporal receptive field

Dear mne Team,

I tried to use the mne Spectro-temporal receptive field (STRF) estimation on continuous data but the format of the input file displayed a vector containing the stimulus spectrogram. No related function seems to be provided to compute this spectrogram even in the original matlab toolbox. Is it possible to generate this spectrogram adapted to mne STRF using python fonction ?

Best.

Hi @WilliamLabCea,
did you follow this example? If so, could you specify which part requires clarification?

Yes I did. I noticed that the code takes a spectrogram as an input (in audio file), but I was unable to find the pieces of code that would compute the spectrogram for the temporal audio signal.

I would use scipy.signal.spectrogram — SciPy v1.7.1 Manual

Thank you for your response. I have tried to use scipy.signal.spectrogram but this function use a classic spectrogram (with a resulting array depends on the size of the windowing, the duration of the signal and the overlap rate between the windows). However, the spectrogramm as inpunt used with the strf is energy by Hilbert Transform, after filtering the time signal into 16 logarithmically spaced frequency bands. The main problem is that no suffisiant information are provide; it would be necessary to know exactly the properties of the filters (order, rejection rate, etc.) or include the code in the strf exemple.

Best.

William

The continuous STRF example is synthetic / simulated, so no spectrogram / hilbert is actually used there. There are a lot of different ways to do time-frequency decompositions. For a start you could look to see what people did in the references:

https://mne.tools/dev/auto_tutorials/machine-learning/30_strf.html#references