plot_spectrum: ensure that the t and f array sizes match

This commit is contained in:
Thomas Kolb 2022-02-13 19:54:07 +01:00
parent 89f04b3ad0
commit a124c04021
1 changed files with 1 additions and 1 deletions

View File

@ -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)