import numpy as np import struct import matplotlib.pypl…