From a124c04021f01802c3ae17e03e9a0f114bc1749b Mon Sep 17 00:00:00 2001 From: Thomas Kolb Date: Sun, 13 Feb 2022 19:54:07 +0100 Subject: [PATCH] plot_spectrum: ensure that the t and f array sizes match --- impl/utils/plot_spectrum.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impl/utils/plot_spectrum.py b/impl/utils/plot_spectrum.py index 16481f6..1d97c44 100755 --- a/impl/utils/plot_spectrum.py +++ b/impl/utils/plot_spectrum.py @@ -14,7 +14,7 @@ with open(sys.argv[1], 'rb') as infile: T = np.fromfile(infile, dtype=np.float32, count=1) data = np.fromfile(infile, dtype=np.complex64) - f = np.arange(-1/(2*T), 1/(2*T), 1/T/data.size) + f = np.arange(-1/(2*T), 1/(2*T), 1/T/data.size)[:data.size] spec = 20*np.log10(np.absolute(np.fft.fftshift(np.fft.fft(data))) / data.size)