I'm trying to reproduce the result of Spectrogram
from SpectrogramArray
, but having no luck, any help?
What I've got so far:
x = "some-audio.wav";
colorFunc = (Blend[{White, Orange, Red, Black}, #] &);
(* The spectrogram plotted by the Spectrogram function *)
Spectrogram[
Audio[x], 400, 160, HammingWindow, ColorFunction -> colorFunc,
Frame -> None]
(* Trying to reproduce it *)
spect = SpectrogramArray[Audio[x], 400, 160, HammingWindow];
half = spect[[All, 1 ;; Dimensions[spect][[2]]/2]];
data = Abs[half];
ArrayPlot[Reverse@Transpose[data], AspectRatio -> 1/3, Frame -> None,
ColorFunction -> colorFunc]
The result:
InverseSpectrogram[ data ]
? $\endgroup$Spectrogram
source code? $\endgroup$