diff --git a/applications/apertif/matlab/two_pfb.m b/applications/apertif/matlab/two_pfb.m index 445fb7f90372d1a8ada98cfbfdd0468c2384f4ba..a56184ba5915e199f6afd7ce98ca7d3427d86020 100644 --- a/applications/apertif/matlab/two_pfb.m +++ b/applications/apertif/matlab/two_pfb.m @@ -36,6 +36,9 @@ % rerun the impulse reponse tail of the previous sync interval. % However if the sync interval is very large, than this rerun may be % ignored to simplify the implementation. +% The FIR prefilter in the PFB can be bypassed by means of the pfir +% tb.pfir_subband_bypass or tb.pfir_channel_bypass. Without the +% FIR prefilter the PFB becomes a FFT. % % * The Apertif subband beamformer is not modelled, therefore the corner % turn operates on the selected subbands. The channel correlator is not @@ -62,11 +65,15 @@ else tb.nof_subbands = 512; tb.nof_channels = 64; - tb.subband_hp_adjust = true; tb.subband_hp_adjust = false; - tb.channel_hp_adjust = true; - %tb.channel_hp_adjust = false; + tb.channel_hp_adjust = false; + + tb.subband_dc_adjust = false; + tb.channel_dc_adjust = false; end +% Optionally bypass the FIR prefilter in the PFB +tb.pfir_subband_bypass = 0; +tb.pfir_channel_bypass = 0; % Channel filterbank tb.nof_tchan_per_sync = 20; % nof channel periods per sync interval @@ -244,6 +251,7 @@ else ctrl_pfir_subband.r_stop = 1e-4; % only for fircls1 ctrl_pfir_subband.config.hp_factor = 1; % Default channel half power bandwidth ctrl_pfir_subband.config.hp_adjust = tb.subband_hp_adjust; + ctrl_pfir_subband.config.dc_adjust = tb.subband_dc_adjust; ctrl_pfir_subband.BWchan = ctrl_pfir_subband.config.hp_factor / tb.subband_fft_size; % Channel bandwidth hfir_subband_coeff = pfir_coeff_adjust(ctrl_pfir_subband.nof_polyphases, ... ctrl_pfir_subband.nof_taps, ... @@ -264,7 +272,7 @@ ctrl_pfir_subband.gain = sum(ctrl_pfir_subband.coeff(:)) / ctrl_pfir_subband.nof if tb.force_subband_pfir_coeff ctrl_pfir_subband.gain = 1; end -ctrl_pfir_subband.bypass = 0; +ctrl_pfir_subband.bypass = tb.pfir_subband_bypass; disp(sprintf(['Subband FIR filter settings:\n', ... '. Bypass = %d\n', ... @@ -320,6 +328,7 @@ ctrl_pfir_channel.r_pass = 1e-3; % only for fircls1 ctrl_pfir_channel.r_stop = 1e-4; % only for fircls1 ctrl_pfir_channel.config.hp_factor = 1; % Default channel half power bandwidth ctrl_pfir_channel.config.hp_adjust = tb.channel_hp_adjust; +ctrl_pfir_channel.config.dc_adjust = tb.channel_dc_adjust; ctrl_pfir_channel.BWchan = ctrl_pfir_channel.config.hp_factor / tb.channel_fft_size; % Channel bandwidth hfir_channel_coeff = pfir_coeff_adjust(ctrl_pfir_channel.nof_polyphases, ... ctrl_pfir_channel.nof_taps, ... @@ -333,7 +342,7 @@ ctrl_pfir_channel.coeff = reshape(hfir_channel_coeff, ctrl_pfir_channel.nof_poly ctrl_pfir_channel.coeff = flipud(ctrl_pfir_channel.coeff); ctrl_pfir_channel.Zdelays = zeros(ctrl_pfir_channel.nof_polyphases, ctrl_pfir_channel.nof_taps-1); ctrl_pfir_channel.gain = sum(ctrl_pfir_channel.coeff(:)) / ctrl_pfir_channel.nof_polyphases; -ctrl_pfir_channel.bypass = 0; +ctrl_pfir_channel.bypass = tb.pfir_channel_bypass; disp(sprintf(['Channel FIR filter settings:\n', ... '. Bypass = %d\n', ...