diff --git a/libraries/dsp/filter/src/python/diff_lofar_coefs b/libraries/dsp/filter/src/python/diff_lofar_coefs new file mode 100755 index 0000000000000000000000000000000000000000..620387d01c126e219f55d5634dea6c9d74bcc3a6 --- /dev/null +++ b/libraries/dsp/filter/src/python/diff_lofar_coefs @@ -0,0 +1,176 @@ +# Author: Eric Kooistra, 16 aug 2017 +# Purpose: +# Diff script to check that FIR coefficient mif files were indeed created from the LOFAR station subband FIR filter coefficient +# Description: +# The coefs_wide4_p1024_t16_*.mif files used by Hajee used the litle endian wb_factor order in the old create_mifs.py, this can +# be repeated by setting pfir.wb_big_endian = False in fil_ppf_create_mifs.py. +# +# The node_apertif_unb1_bn_filterbank.vhd in Hajee's image v16579 still used wpfb_unit instead of wpfb_unit_dev, because wpfb_unit_dev +# was first used in v16670. The wpfb_unit had little endian wideband index use for the data, and node_apertif_unb1_bn_filterbank.vhd +# assigned using to-range: +# fft_in_sosi_arr(I*g_wpfb.wb_factor to (I+1)*g_wpfb.wb_factor-1) +# In wpfb_unit_dev there is g_big_endian_wb_in and this is set to true in node_apertif_unb1_bn_filterbank.vhd such that it can +# assign with downto-range: +# fft_in_sosi_arr((U+1)*g_wpfb.wb_factor-1 downto U*g_wpfb.wb_factor) +# +# Initially I (erko) had changed the internal order of the wideband FIR coefficients in wpfb_unit_dev to big endian, but that was +# not backwards compatible to the little endian order that was used in wpfb_unit by Hajee. Therefore I changed this in wpfb_unit_dev +# which required that I recreated all *4wb_*.mif files using the recreate_4wb_mifs shell script. +# +# From apertif_unb1_bn_filterbank v17529 on all wideband *.mif files have the correct little endian order to match the +# little endian order of the wideband FIR coefficients in wpfb_unit, wpfb_unit_dev and in node_apertif_unb1_bn_filterbank.vhd. +# +# Usage: +# >./diff_lofar_coefs # works but gives /bin/bash: _python errors +# >. diff_lofar_coefs # works without these errors +# +# Expected result is that this diff_lofar_coefs script does not report diff's, which proofs that the LOFAR FIR coefficients in the +# apertif_unb1_bn_filterbank are correctly set. This can be verified on hardware by applying a WG at the center of subband 301, +# because the subband statistics will then show some subbands as low as at 0 dB instead of a noise floor at about 50 dB. This is +# because for teh center of a subband the WG can generate a perfect sinus. If the FIR coefficients are in the wrong order, then +# the subband statistics will not peak low to 0 dB. + +# 1) Check that copies of LOFAR FIR coefficient reference files are equal +diff $RADIOHDL/applications/apertif/matlab/data/Coeffs16384Kaiser-quant.dat $UPE/apps/commissioning_apertif_beamformer/coeffs16384Kaiser-quant.dat +diff $RADIOHDL/applications/apertif/matlab/data/Coeffs16384Kaiser-quant.dat $UNB/Firmware/modules/Lofar/pfs/src/data/Coeffs16384Kaiser-quant.dat + +# 2) Check that the local stored LOFAR FIR coefficients mif files are the same as in apertif_unb1_bn_filterbank +cd $RADIOHDL/libraries/dsp/filter/src/hex +diff coefs_wide4_p1024_t16_0.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_0.mif +diff coefs_wide4_p1024_t16_1.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_1.mif +diff coefs_wide4_p1024_t16_2.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_2.mif +diff coefs_wide4_p1024_t16_3.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_3.mif +diff coefs_wide4_p1024_t16_4.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_4.mif +diff coefs_wide4_p1024_t16_5.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_5.mif +diff coefs_wide4_p1024_t16_6.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_6.mif +diff coefs_wide4_p1024_t16_7.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_7.mif +diff coefs_wide4_p1024_t16_8.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_8.mif +diff coefs_wide4_p1024_t16_9.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_9.mif +diff coefs_wide4_p1024_t16_10.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_10.mif +diff coefs_wide4_p1024_t16_11.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_11.mif +diff coefs_wide4_p1024_t16_12.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_12.mif +diff coefs_wide4_p1024_t16_13.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_13.mif +diff coefs_wide4_p1024_t16_14.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_14.mif +diff coefs_wide4_p1024_t16_15.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_15.mif +diff coefs_wide4_p1024_t16_16.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_16.mif +diff coefs_wide4_p1024_t16_17.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_17.mif +diff coefs_wide4_p1024_t16_18.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_18.mif +diff coefs_wide4_p1024_t16_19.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_19.mif +diff coefs_wide4_p1024_t16_20.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_20.mif +diff coefs_wide4_p1024_t16_21.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_21.mif +diff coefs_wide4_p1024_t16_22.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_22.mif +diff coefs_wide4_p1024_t16_23.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_23.mif +diff coefs_wide4_p1024_t16_24.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_24.mif +diff coefs_wide4_p1024_t16_25.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_25.mif +diff coefs_wide4_p1024_t16_26.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_26.mif +diff coefs_wide4_p1024_t16_27.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_27.mif +diff coefs_wide4_p1024_t16_28.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_28.mif +diff coefs_wide4_p1024_t16_29.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_29.mif +diff coefs_wide4_p1024_t16_30.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_30.mif +diff coefs_wide4_p1024_t16_31.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_31.mif +diff coefs_wide4_p1024_t16_32.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_32.mif +diff coefs_wide4_p1024_t16_33.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_33.mif +diff coefs_wide4_p1024_t16_34.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_34.mif +diff coefs_wide4_p1024_t16_35.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_35.mif +diff coefs_wide4_p1024_t16_36.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_36.mif +diff coefs_wide4_p1024_t16_37.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_37.mif +diff coefs_wide4_p1024_t16_38.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_38.mif +diff coefs_wide4_p1024_t16_39.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_39.mif +diff coefs_wide4_p1024_t16_40.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_40.mif +diff coefs_wide4_p1024_t16_41.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_41.mif +diff coefs_wide4_p1024_t16_42.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_42.mif +diff coefs_wide4_p1024_t16_43.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_43.mif +diff coefs_wide4_p1024_t16_44.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_44.mif +diff coefs_wide4_p1024_t16_45.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_45.mif +diff coefs_wide4_p1024_t16_46.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_46.mif +diff coefs_wide4_p1024_t16_47.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_47.mif +diff coefs_wide4_p1024_t16_48.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_48.mif +diff coefs_wide4_p1024_t16_49.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_49.mif +diff coefs_wide4_p1024_t16_50.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_50.mif +diff coefs_wide4_p1024_t16_51.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_51.mif +diff coefs_wide4_p1024_t16_52.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_52.mif +diff coefs_wide4_p1024_t16_53.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_53.mif +diff coefs_wide4_p1024_t16_54.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_54.mif +diff coefs_wide4_p1024_t16_55.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_55.mif +diff coefs_wide4_p1024_t16_56.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_56.mif +diff coefs_wide4_p1024_t16_57.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_57.mif +diff coefs_wide4_p1024_t16_58.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_58.mif +diff coefs_wide4_p1024_t16_59.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_59.mif +diff coefs_wide4_p1024_t16_60.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_60.mif +diff coefs_wide4_p1024_t16_61.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_61.mif +diff coefs_wide4_p1024_t16_62.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_62.mif +diff coefs_wide4_p1024_t16_63.mif $RADIOHDL/applications/apertif/designs/apertif_unb1_bn_filterbank/src/hex/coefs_wide4_p1024_t16_63.mif + +# 3) Create reference LOFAR FIR coefficients mif files: +cd $RADIOHDL/libraries/dsp/filter/src/python +python fil_ppf_create_mifs.py -f $RADIOHDL/applications/apertif/matlab/data/Coeffs16384Kaiser-quant.dat -t 16 -p 1024 -w 4 -c 16 + +# 4) Verify that the created reference LOFAR FIR coefficients mif files are equal to the local stored mif files +cd $RADIOHDL/libraries/dsp/filter/src/hex +diff Coeffs16384Kaiser-quant_4wb_0.mif coefs_wide4_p1024_t16_0.mif +diff Coeffs16384Kaiser-quant_4wb_1.mif coefs_wide4_p1024_t16_1.mif +diff Coeffs16384Kaiser-quant_4wb_2.mif coefs_wide4_p1024_t16_2.mif +diff Coeffs16384Kaiser-quant_4wb_3.mif coefs_wide4_p1024_t16_3.mif +diff Coeffs16384Kaiser-quant_4wb_4.mif coefs_wide4_p1024_t16_4.mif +diff Coeffs16384Kaiser-quant_4wb_5.mif coefs_wide4_p1024_t16_5.mif +diff Coeffs16384Kaiser-quant_4wb_6.mif coefs_wide4_p1024_t16_6.mif +diff Coeffs16384Kaiser-quant_4wb_7.mif coefs_wide4_p1024_t16_7.mif +diff Coeffs16384Kaiser-quant_4wb_8.mif coefs_wide4_p1024_t16_8.mif +diff Coeffs16384Kaiser-quant_4wb_9.mif coefs_wide4_p1024_t16_9.mif +diff Coeffs16384Kaiser-quant_4wb_10.mif coefs_wide4_p1024_t16_10.mif +diff Coeffs16384Kaiser-quant_4wb_11.mif coefs_wide4_p1024_t16_11.mif +diff Coeffs16384Kaiser-quant_4wb_12.mif coefs_wide4_p1024_t16_12.mif +diff Coeffs16384Kaiser-quant_4wb_13.mif coefs_wide4_p1024_t16_13.mif +diff Coeffs16384Kaiser-quant_4wb_14.mif coefs_wide4_p1024_t16_14.mif +diff Coeffs16384Kaiser-quant_4wb_15.mif coefs_wide4_p1024_t16_15.mif +diff Coeffs16384Kaiser-quant_4wb_16.mif coefs_wide4_p1024_t16_16.mif +diff Coeffs16384Kaiser-quant_4wb_17.mif coefs_wide4_p1024_t16_17.mif +diff Coeffs16384Kaiser-quant_4wb_18.mif coefs_wide4_p1024_t16_18.mif +diff Coeffs16384Kaiser-quant_4wb_19.mif coefs_wide4_p1024_t16_19.mif +diff Coeffs16384Kaiser-quant_4wb_20.mif coefs_wide4_p1024_t16_20.mif +diff Coeffs16384Kaiser-quant_4wb_21.mif coefs_wide4_p1024_t16_21.mif +diff Coeffs16384Kaiser-quant_4wb_22.mif coefs_wide4_p1024_t16_22.mif +diff Coeffs16384Kaiser-quant_4wb_23.mif coefs_wide4_p1024_t16_23.mif +diff Coeffs16384Kaiser-quant_4wb_24.mif coefs_wide4_p1024_t16_24.mif +diff Coeffs16384Kaiser-quant_4wb_25.mif coefs_wide4_p1024_t16_25.mif +diff Coeffs16384Kaiser-quant_4wb_26.mif coefs_wide4_p1024_t16_26.mif +diff Coeffs16384Kaiser-quant_4wb_27.mif coefs_wide4_p1024_t16_27.mif +diff Coeffs16384Kaiser-quant_4wb_28.mif coefs_wide4_p1024_t16_28.mif +diff Coeffs16384Kaiser-quant_4wb_29.mif coefs_wide4_p1024_t16_29.mif +diff Coeffs16384Kaiser-quant_4wb_30.mif coefs_wide4_p1024_t16_30.mif +diff Coeffs16384Kaiser-quant_4wb_31.mif coefs_wide4_p1024_t16_31.mif +diff Coeffs16384Kaiser-quant_4wb_32.mif coefs_wide4_p1024_t16_32.mif +diff Coeffs16384Kaiser-quant_4wb_33.mif coefs_wide4_p1024_t16_33.mif +diff Coeffs16384Kaiser-quant_4wb_34.mif coefs_wide4_p1024_t16_34.mif +diff Coeffs16384Kaiser-quant_4wb_35.mif coefs_wide4_p1024_t16_35.mif +diff Coeffs16384Kaiser-quant_4wb_36.mif coefs_wide4_p1024_t16_36.mif +diff Coeffs16384Kaiser-quant_4wb_37.mif coefs_wide4_p1024_t16_37.mif +diff Coeffs16384Kaiser-quant_4wb_38.mif coefs_wide4_p1024_t16_38.mif +diff Coeffs16384Kaiser-quant_4wb_39.mif coefs_wide4_p1024_t16_39.mif +diff Coeffs16384Kaiser-quant_4wb_40.mif coefs_wide4_p1024_t16_40.mif +diff Coeffs16384Kaiser-quant_4wb_41.mif coefs_wide4_p1024_t16_41.mif +diff Coeffs16384Kaiser-quant_4wb_42.mif coefs_wide4_p1024_t16_42.mif +diff Coeffs16384Kaiser-quant_4wb_43.mif coefs_wide4_p1024_t16_43.mif +diff Coeffs16384Kaiser-quant_4wb_44.mif coefs_wide4_p1024_t16_44.mif +diff Coeffs16384Kaiser-quant_4wb_45.mif coefs_wide4_p1024_t16_45.mif +diff Coeffs16384Kaiser-quant_4wb_46.mif coefs_wide4_p1024_t16_46.mif +diff Coeffs16384Kaiser-quant_4wb_47.mif coefs_wide4_p1024_t16_47.mif +diff Coeffs16384Kaiser-quant_4wb_48.mif coefs_wide4_p1024_t16_48.mif +diff Coeffs16384Kaiser-quant_4wb_49.mif coefs_wide4_p1024_t16_49.mif +diff Coeffs16384Kaiser-quant_4wb_50.mif coefs_wide4_p1024_t16_50.mif +diff Coeffs16384Kaiser-quant_4wb_51.mif coefs_wide4_p1024_t16_51.mif +diff Coeffs16384Kaiser-quant_4wb_52.mif coefs_wide4_p1024_t16_52.mif +diff Coeffs16384Kaiser-quant_4wb_53.mif coefs_wide4_p1024_t16_53.mif +diff Coeffs16384Kaiser-quant_4wb_54.mif coefs_wide4_p1024_t16_54.mif +diff Coeffs16384Kaiser-quant_4wb_55.mif coefs_wide4_p1024_t16_55.mif +diff Coeffs16384Kaiser-quant_4wb_56.mif coefs_wide4_p1024_t16_56.mif +diff Coeffs16384Kaiser-quant_4wb_57.mif coefs_wide4_p1024_t16_57.mif +diff Coeffs16384Kaiser-quant_4wb_58.mif coefs_wide4_p1024_t16_58.mif +diff Coeffs16384Kaiser-quant_4wb_59.mif coefs_wide4_p1024_t16_59.mif +diff Coeffs16384Kaiser-quant_4wb_60.mif coefs_wide4_p1024_t16_60.mif +diff Coeffs16384Kaiser-quant_4wb_61.mif coefs_wide4_p1024_t16_61.mif +diff Coeffs16384Kaiser-quant_4wb_62.mif coefs_wide4_p1024_t16_62.mif +diff Coeffs16384Kaiser-quant_4wb_63.mif coefs_wide4_p1024_t16_63.mif + +# 5) Set script exit directory +cd $RADIOHDL/libraries/dsp/filter/src/python