Improvements to debug scripts

This commit is contained in:
Thomas Kolb 2024-03-30 22:04:26 +01:00
parent d9707ac4a9
commit 66c88bf889
2 changed files with 6 additions and 3 deletions

View file

@ -17,7 +17,7 @@ with open(sys.argv[1], 'rb') as infile:
t = np.arange(0, T*data.size, T) t = np.arange(0, T*data.size, T)
amp = np.absolute(data) amp = np.absolute(data)
phase = np.angle(data) phase = np.unwrap(np.angle(data))
pp.plot(t, amp, 'r-') pp.plot(t, amp, 'r-')
pp.legend(['Amplitude']) pp.legend(['Amplitude'])

View file

@ -35,8 +35,11 @@ ax.legend(['Spectrum'])
ax.set_xlabel('Frequency [Hz]') ax.set_xlabel('Frequency [Hz]')
def update(*args): def update(*args):
try:
spec, f = load_data() spec, f = load_data()
line.set_ydata(spec) line.set_ydata(spec)
except Exception as e:
print(e)
return [line] return [line]