From 7888edd230aa5d1c8cd3f37770106fb6994a4bcc Mon Sep 17 00:00:00 2001
From: Eric Kooistra <kooistra@astron.nl>
Date: Thu, 18 Nov 2021 15:52:34 +0100
Subject: [PATCH] Print CW power.

---
 libraries/base/common/python/try_round.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libraries/base/common/python/try_round.py b/libraries/base/common/python/try_round.py
index bf284b5d8c..9748ae0250 100755
--- a/libraries/base/common/python/try_round.py
+++ b/libraries/base/common/python/try_round.py
@@ -89,6 +89,10 @@ SNR_adc_scale = SNR_adc - fraction * 20 * np.log10(2)
 SNR_away = 10*np.log10(A_away_cw / A_away_spurious)
 SNR_even = 10*np.log10(A_even_cw / A_even_spurious)
 
+print('A_adc_cw      = %7.3f dBW' % (10*np.log10(A_adc_cw)))
+print('A_away_cw     = %7.3f dBW' % (10*np.log10(A_away_cw)))
+print('A_even_cw     = %7.3f dBW' % (10*np.log10(A_even_cw)))
+print('')
 print('SNR_adc       = %7.3f dB' % SNR_adc)
 print('SNR_adc_scale = %7.3f dB' % SNR_adc_scale)
 print('SNR_away      = %7.3f dB' % SNR_away)
@@ -97,7 +101,7 @@ print('SNR_even      = %7.3f dB' % SNR_even)
 if useplot:
     # Plot sinus
     plt.figure(figNr)
-    plt.plot(t, a_adc, '-r', t, a_away, '.-g', t, a_even, '.b')
+    plt.plot(t, a_adc, '-r', t, a_away, '.-g', t, a_even, '.-b')
     plt.xlabel('Time')
     plt.ylabel('Voltage')
     plt.title('Sinus (%d values)' % N)
@@ -106,7 +110,7 @@ if useplot:
 
     # Plot spectrum
     plt.figure(figNr)
-    plt.plot(f, A_adc, '-r', f, A_away, '.-g', f, A_even, '.b')
+    plt.plot(f, A_adc, '-r', f, A_away, '.-g', f, A_even, '.-b')
     plt.xlabel('Frequency')
     plt.ylabel('Power')
     plt.title('Frequency (%d bins)' % (N/2))
-- 
GitLab