Jump to content
  • 0

Waveforms I2S reconstructed audio waveform display


s21jb

Question

I just got myself an Analog Discovery 2. I tried probing an I2S stream on a CODEC, using the Logic Analyzer function. I noticed that the software is capable of  decoding Left and Right channel samples as hex or singed decimal numbers - which is not much help when trying to make sense of audio signals. Is there any way to reconstruct left and right channel audio wave-shapes represented as analog charts for better observation? Can it be exported as channels on the oscilloscope and compared with other analog signals or Is it possible to see the spectrum of the Left and Right channel audio streams from the I2S signals?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Hi @s21jb

By increasing the bus (or interpreter) row high in Logic Analyzer you will see the analog representation of the value.

With the following script you can export the I2S data to csv. Then you can import it in Scope (under File menu) for further processing.

var rg = Logic1.Channels.I2S.events //events
var rgt = Logic1.Channels.I2S.eventStamps // event time stamps
var c = rg.length-1 // number of events

var i = 0
if(rg[0].charAt(0)!="R") i++ // make sure to start with right

var file = File("~/Desktop/i2s.csv")
file.writeLine("Time,Right,Left")

for(; i < c; i+=2){
    // trim leading R/L char
    // normalize to +-1 for 16 bit signed values
    var v1 = parseInt(rg[i].substring(2))/32768
    var v2 = parseInt(rg[i+1].substring(2))/32768
    file.appendLine(rgt[i]+","+v1+","+v2)
}

i1.thumb.png.3119585cf80de578cd2b06da8a4d9bb7.png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...