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

Use COMPLEX_RADIUS().

parent 8bb76ddf
No related branches found
No related tags found
1 merge request!219No functional change. Use short index variables names in capitals, to ease...
Pipeline #26258 passed
......@@ -80,9 +80,6 @@
-- > observe the *_scope signals as radix decimal, format analogue format signals in the Wave window.
-- default use analogue(automatic), if necessary zoom in using right click analogue(custom).
--
-- Note:
-- . Must use ABS() with **2.0 of negative REAL, because (negative)**2.0 yields error and value 0.0,
-- . Must use brackets (ABS()) to avoid compile error
LIBRARY ieee, common_lib, dp_lib, diag_lib, filter_lib, rTwoSDF_lib, fft_lib, wpfb_lib;
LIBRARY pfs_lib, pft2_lib, pfb2_lib;
......@@ -798,12 +795,11 @@ BEGIN
sub_b_re_frac <= out_re WHEN rising_edge(dp_clk) AND out_bin = c_bin_b + 1 AND out_val_b = '1';
sub_b_im_frac <= out_im WHEN rising_edge(dp_clk) AND out_bin = c_bin_b + 1 AND out_val_b = '1';
-- Must use ABS() with ** of real, because (negative)**2.0 yields error and value 0.0, also must use brackets (ABS()) to avoid compile error
sub_a_ampl <= SQRT((ABS(REAL(sub_a_re)))**2.0 + (ABS(REAL(sub_a_im)))**2.0);
sub_a_ampl_frac <= SQRT((ABS(REAL(sub_a_re_frac)))**2.0 + (ABS(REAL(sub_a_im_frac)))**2.0);
sub_a_ampl <= COMPLEX_RADIUS(sub_a_re, sub_a_im);
sub_a_ampl_frac <= COMPLEX_RADIUS(sub_a_re_frac, sub_a_im_frac);
sub_b_ampl <= SQRT((ABS(REAL(sub_b_re)))**2.0 + (ABS(REAL(sub_b_im)))**2.0);
sub_b_ampl_frac <= SQRT((ABS(REAL(sub_b_re_frac)))**2.0 + (ABS(REAL(sub_b_im_frac)))**2.0);
sub_b_ampl <= COMPLEX_RADIUS(sub_b_re, sub_b_im);
sub_b_ampl_frac <= COMPLEX_RADIUS(sub_b_re_frac, sub_b_im_frac);
---------------------------------------------------------------------------
-- Measure ADC/WG input mean (DC) and power, and determine sine amplitude
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment