diff --git a/impl/utils/plot_spectrum_loop.py b/impl/utils/plot_spectrum_loop.py index aba9ff4..ebb0f49 100755 --- a/impl/utils/plot_spectrum_loop.py +++ b/impl/utils/plot_spectrum_loop.py @@ -14,7 +14,7 @@ def load_data(): print(f"Error: not a complex signal file. Format {header} not implemented yet.") exit(1) - T = np.fromfile(infile, dtype=np.float32, count=1) + T = np.fromfile(infile, dtype=np.float32, count=1)[0] data = np.fromfile(infile, dtype=np.complex64) f = np.arange(-1/(2*T), 1/(2*T), 1/T/data.size)[:data.size] diff --git a/impl/utils/plot_timedomain.py b/impl/utils/plot_timedomain.py index 9ae8a77..1d919b1 100755 --- a/impl/utils/plot_timedomain.py +++ b/impl/utils/plot_timedomain.py @@ -8,10 +8,10 @@ import matplotlib.pyplot as pp with open(sys.argv[1], 'rb') as infile: header = infile.read(4) if header == b'CPX_': - T = np.fromfile(infile, dtype=np.float32, count=1) + T = np.fromfile(infile, dtype=np.float32, count=1)[0] data = np.fromfile(infile, dtype=np.complex64) elif header == b'FLT_': - T = np.fromfile(infile, dtype=np.float32, count=1) + T = np.fromfile(infile, dtype=np.float32, count=1)[0] data = np.fromfile(infile, dtype=np.float32) else: print(f"Error: Format {header} not implemented yet.")