From 97334f9f8aa38cbe511af4bacadc7a4010ebe60c Mon Sep 17 00:00:00 2001 From: Eric Kooistra <kooistra@astron.nl> Date: Thu, 13 Jun 2024 19:55:20 +0200 Subject: [PATCH] Correct plot_magnitude_spectrum(). --- applications/lofar2/model/rtdsp/plotting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/lofar2/model/rtdsp/plotting.py b/applications/lofar2/model/rtdsp/plotting.py index 964277b5d5..83965c1764 100644 --- a/applications/lofar2/model/rtdsp/plotting.py +++ b/applications/lofar2/model/rtdsp/plotting.py @@ -215,7 +215,7 @@ def plot_power_spectrum(fn, HF, fmt='r', fs=1.0, fLim=None, dbLim=None): plt.grid(True) -def plot_magnitude_spectrum(f, HF, fmt='r', fs=1.0, fLim=None, voltLim=None): +def plot_magnitude_spectrum(fn, HF, fmt='r', fs=1.0, fLim=None, voltLim=None): """Plot magnitude (= voltage) spectrum Input: @@ -227,7 +227,7 @@ def plot_magnitude_spectrum(f, HF, fmt='r', fs=1.0, fLim=None, voltLim=None): f = fn * fs # scale fn by fs flabel = 'Frequency [fs = %f]' % fs - plt.plot(f * fs, np.abs(HF), fmt) + plt.plot(f, np.abs(HF), fmt) plt.title('Magnitude spectrum') plt.ylabel('Voltage') plt.xlabel(flabel) -- GitLab