Skip to content
Snippets Groups Projects
Commit 5976e6bd authored by Eric Kooistra's avatar Eric Kooistra
Browse files

Better not use unwrap in phase plots.

parent cd05465c
No related branches found
No related tags found
1 merge request!419Resolve RTSD-265
...@@ -146,7 +146,8 @@ def plot_spectra(fn, HF, fs=1.0, fLim=None, dbLim=None, aLim=None): ...@@ -146,7 +146,8 @@ def plot_spectra(fn, HF, fs=1.0, fLim=None, dbLim=None, aLim=None):
. fs: sample frequency in Hz . fs: sample frequency in Hz
""" """
Hmag = np.abs(HF) Hmag = np.abs(HF)
Hphs = np.unwrap(np.angle(HF)) # Hphs = np.unwrap(np.angle(HF))
Hphs = np.angle(HF)
Hpow_dB = pow_db(HF) # power response Hpow_dB = pow_db(HF) # power response
f = fn * fs # scale fn by fs f = fn * fs # scale fn by fs
flabel = 'Frequency [fs = %f]' % fs flabel = 'Frequency [fs = %f]' % fs
...@@ -209,7 +210,9 @@ def plot_phase_spectrum(fn, HF, fmt='r', fs=1.0, fLim=None, aLim=None): ...@@ -209,7 +210,9 @@ def plot_phase_spectrum(fn, HF, fmt='r', fs=1.0, fLim=None, aLim=None):
f = fn * fs # scale fn by fs f = fn * fs # scale fn by fs
flabel = 'Frequency [fs = %f]' % fs flabel = 'Frequency [fs = %f]' % fs
plt.plot(f, np.unwrap(np.angle(HF)), fmt) # Hphs = np.unwrap(np.angle(HF))
Hphs = np.angle(HF)
plt.plot(f, Hphs, fmt)
plt.title('Phase spectrum') plt.title('Phase spectrum')
plt.ylabel('Pase [rad]') plt.ylabel('Pase [rad]')
plt.xlabel(flabel) plt.xlabel(flabel)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment