diff --git a/libraries/base/common/src/vhdl/common_create_strobes_from_valid.vhd b/libraries/base/common/src/vhdl/common_create_strobes_from_valid.vhd index 0a1167aff0c1985f82f91ead2df8bc2d94b0eb3a..2474c75da3e6754b73419668b1d3d4e04bec78d4 100644 --- a/libraries/base/common/src/vhdl/common_create_strobes_from_valid.vhd +++ b/libraries/base/common/src/vhdl/common_create_strobes_from_valid.vhd @@ -42,6 +42,8 @@ -- out_eop __________| |_______| |_______| |_______| |_______| |___ -- -- Remark: +-- . Use VHDL coding template from: +-- https://support.astron.nl/confluence/display/SBe/VHDL+design+patterns+for+RTL+coding -- . The out_sop and out_eop are created as well, for reference. -- . The out_sync1 for LOFAR1 style is only avaiable if g_pipeline = TRUE, -- because the pipeline is needed to let the out_sync1 preceed the diff --git a/libraries/dsp/fft/src/vhdl/fft_r2_pipe.vhd b/libraries/dsp/fft/src/vhdl/fft_r2_pipe.vhd index fdf43ef38abef91ed6d8b85a8392eaf222ded968..c9ed7f72c558ac588935c3670265363a810f4b5f 100644 --- a/libraries/dsp/fft/src/vhdl/fft_r2_pipe.vhd +++ b/libraries/dsp/fft/src/vhdl/fft_r2_pipe.vhd @@ -39,15 +39,22 @@ -- an alternating way: A(0), B(0), A(1), B(1).... etc -- -- --- Remarks: When g_fft.nof_chan is used the spectrums at the output will be interleaved --- per spectrum and NOT per sample. So in case g_fft.nof_chan = 1 there will be --- two multiplexed channels at the input (c0t0 means channel 0, timestamp 0) : +-- Remarks: +-- . When g_fft.use_separate = TRUE, then the two real inputs are pseudo randomly +-- multiplied by +1 or -1 every block of input samples in fft_switch. At the +-- FFT output this is undone by fft_unswitch. In this way any crosstalk due +-- to quantization noise between the two real inputs gets scrambled and thus +-- averages to zero when integrated over multiple blocks. +-- +-- . When g_fft.nof_chan is used the spectrums at the output will be interleaved +-- per spectrum and NOT per sample. So in case g_fft.nof_chan = 1 there will be +-- two multiplexed channels at the input (c0t0 means channel 0, timestamp 0) : -- --- c0t0 c1t0s c0t1 c1t1 c0t2 c1t2 ... c0t15 c1t15 +-- c0t0 c1t0s c0t1 c1t1 c0t2 c1t2 ... c0t15 c1t15 -- --- At the output will find: +-- At the output will find: -- --- c0f0 c0f1 c0f2 ... c0f15 c1f0 c1f1 c1f2 ... c1f15 (c0f0 means channel 0, frequency bin 0) +-- c0f0 c0f1 c0f2 ... c0f15 c1f0 c1f1 c1f2 ... c1f15 (c0f0 means channel 0, frequency bin 0) -- -- diff --git a/libraries/dsp/fft/src/vhdl/fft_switch.vhd b/libraries/dsp/fft/src/vhdl/fft_switch.vhd index 6f10f0c7120ade40935e7384508cc1e1290cad25..cad57405ab3b2c03ed84834171fab082b2ed6b51 100644 --- a/libraries/dsp/fft/src/vhdl/fft_switch.vhd +++ b/libraries/dsp/fft/src/vhdl/fft_switch.vhd @@ -22,6 +22,16 @@ -- Purpose: Scramble quantization noise crosstalk between two real inputs -- Description: -- . Ported from LOFAR1, see readme_lofar1.txt +-- . The fft_switch multiplies the samples from two real inputs A and B in a +-- block by +1 or -1. The fft_unswitch undoes this by multiplying the FFT +-- output again by +1 and -1. The fft_unswitch takes account of that the FFT +-- has time mutliplexed the two spectra of the two inputs. +-- . The input switching is pseudo random base on a LFSR (linear feedback +-- shift register) sequence. The fft_switch and fft_unswitch start at the +-- first in_val = '1' and then continue 'forever' until a next power cycle +-- by rst ='1'. +-- Remark: +-- . Copy from applications/lofar1/RSP/pft2/src/vhdl/pft_switch.vhd -- . Removed in_sync, because the in_val are guaranteed to arrive in blocks of -- c_nof_clk_per_block samples, forever after rst release. -- The purpose of the in_sync is to recover from an fractional input block, @@ -29,7 +39,9 @@ -- processing, without need for in_sync to recover from fractional blocks. -- The application that uses the FFT must guarantee to only pass on complete -- blocks of c_nof_clk_per_block samples to the FFT. --- Remark: Copy from applications/lofar1/RSP/pft2/src/vhdl/pft_switch.vhd +-- . The two real inputs each use another LFSR sequence, like for LOFAR1. +-- For the crosstalk mitigation purpose scrambling only one input would be +-- enough, but scrambling both inputs is fine too. LIBRARY IEEE, common_lib; USE IEEE.std_logic_1164.ALL; diff --git a/libraries/dsp/fft/src/vhdl/fft_unswitch.vhd b/libraries/dsp/fft/src/vhdl/fft_unswitch.vhd index b8a7de8c7ba0f119e6ef0048c89d2609abfd68d5..6d9f561a15e7ca184f70c418810bd85f9b1ac6d6 100644 --- a/libraries/dsp/fft/src/vhdl/fft_unswitch.vhd +++ b/libraries/dsp/fft/src/vhdl/fft_unswitch.vhd @@ -22,9 +22,11 @@ -- Purpose: Scramble quantization noise crosstalk between two real inputs -- Description: -- . Ported from LOFAR1, see readme_lofar1.txt +-- . See fft_switch.vhd +-- Remark: +-- . Copy from applications/lofar1/RSP/pft2/src/vhdl/pft_unswitch.vhd -- . Removed in_sync, because the in_val are guaranteed to arrive in blocks of -- c_nof_clk_per_block samples, forever after rst release. --- Remark: Copy from applications/lofar1/RSP/pft2/src/vhdl/pft_unswitch.vhd LIBRARY IEEE, common_lib; USE IEEE.std_logic_1164.ALL;