Time vs frequency taking detail of SpectrogramArray I have a 600 second @ 8000 Hz WAV file which need to be analyzed in detail in terms of events (red parts in plot) defined in time and frequency that need to be rather exact, in particular the derivative of the slanted red "lines" (i.e. Hz/s). After producing a SpectrogramArray with samples of 0.1 seconds

data = SpectrogramArray[file, Quantity[0.1, "seconds"],Round[800/3], 

I find dimension 800 for the frequency and 17978 for the time. I display the result with

MatrixPlot[Transpose[Abs[data][[l1 ;; l2, 500 ;; 800]]], 
AspectRatio -> 0.5, Mesh -> {2, 9}, MaxPlotPoints -> Infinity, 
Frame -> {{True, True}, {True, True}},
ColorFunction -> "Rainbow", ColorFunctionScaling -> False, 
DataRange -> {{t1, t2}, {0, 3000}}, ImageSize -> Large]`

For conversion (e.g. Arrayindices to DataRange), I take the upper half with a full scale 4000 Hz = 5Hz/channel. For time 0.1 second = 2.9963 channels = 17978/6000. (comparing the Spectrogram and SpectrogramArray plots it seems to work out). I do not find it a very satisfactory way of finding out what SpectrogramArray is doing, but I could not find a good description. My question is, is this way to go from array indices to the physical quantities of time and frequency.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.