Script to plot audio waves from I2S samples exported from sigrok/PulseView. This was created to provide visual aid when debugging I2S drivers.
- Python 3.9+
- tkinter
- matplotlib
- bitstring
python SigPlotI2S.py [Options] <input file>
Required arguments:
<input file> Path to the input file
Options:
-h, --help Show help message
-o <output file>, --output <output file>
Path to the output file (.png or .pdf). Save image into a file
instead of opening a pop-up.
-d <datawidth>, --datawidth <datawidth>
Number of bits per sample (default: 16)
-c <channels>, --channels <channels>
Number of channels (default: 2)
-s, --swap-channels, --no-swap-channels
Swap left and right channels (default: False)
In this example we will use a 44.1kHz, 16-bit, stereo WAV file containing a sine wave and, from the I2S data recorded, generate the resulting waveform of the output audio.
- Scan the I2S bus to be analysed;
- Add and configure I2S decoder;
- Export I2S annotation as
sinewave.txt
;
- Run SigPlotI2S to convert and plot the I2S samples;
python SigPlotI2S.py -d 16 -c 2 sinewave.txt
- Get the resulting waveform.