# `analyze.spectrogram` The function [`analyze.spectrogram`](#digger.analyze.spectrogram.spectrogram) analyzes a numerical gauge trace using a fast Fourier transform to generate a spectrogram. ```{literalinclude} ../../../../../examples/post-run/barry_arm/setpostprocess.py :language: python :start-after: Block 5 Start :end-before: Block 5 End ``` :::{attention} This code snippet is not fully self-sufficient. This snippet relies on simulation output files. To reproduce the example, execute the file `digger/examples/post-run/barry_arm/setpostprocess.py` from within the directory in which it is located. **Before** the script is executed either the example simulation must be run or the file `digger/data/barry_arm_output.zip` must be unzipped and the resulting directory (`_output`) must be placed within `digger/examples/post-run/barry_arm/`. ::: The utility function [`digger.utils.gauge2ts`](#digger.utils.gauge2ts.gauge2ts) assists in ensuring that the numerical gauge data provided by D-Claw conforms to the expectations of the spectrogram and [wavelet analysis](example-wavelet). Running this code snippet generates three diagnostic figures that depict the detrended gauge, the frequency content of the gauge trace, and the spectrogram. ```{figure} ../../../../_static/from_examples/spectrum-BA_timeseries.png :alt: Example digger.analyze.spectrogram gauge figure. An example of the diagnostic output provided by digger.analyze.spectrogram showing the detrended gauge trace. ``` ```{figure} ../../../../_static/from_examples/spectrum-BA_fourier.png :alt: Example digger.analyze.spectrogram fourier transform figure. An example of the diagnostic output provided by digger.analyze.spectrogram showing the frequency content. ``` ```{figure} ../../../../_static/from_examples/spectrum-BA_spectrogram.png :alt: Example digger.analyze.spectrogram spectrogram figure. An example of the diagnostic output provided by digger.analyze.spectrogram showing the spectrogram. ```