linuxbit-manipulationdiffvisualize

Visualization of Bitwise Difference of Audio Files


In Linux, I need to visualize the bitwise difference between two audio files (left and right channel), in a way so that I can understand (approximately) when they are identical, and when they are different.

The tools I use just portray the side-by-side bitwise difference byte by byte, but I need a visualization of the full files.

Is there a utility I can use for this?


Solution

  • No utility, but you could do it in Python relatively easily:

    import matplotlib.pyplot as plt 
    import scipy.io.wavfile as wf
    
    rate, data = wf.read("file.wav")
    lchannel, rchannel = data[:,0], data[:,1]
    diff = lchannel != rchannel
    plt.plot(diff)