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

Use fir_wb_reverse to try effect of wrong wideband factor P order of the FIR coefficients.

parent 74ea0995
No related branches found
No related tags found
No related merge requests found
......@@ -65,16 +65,16 @@ close all;
fig=0;
%% Select application
%application = 'lofar_subband'; % load LOFAR subband filterbank coefficients from file
application = 'apertif_subband'; % calculate Apertif subband filterbank coefficients using fir1 or fircls1
application = 'apertif_channel'; % calculate Apertif channel filterbank coefficients using fir1 or fircls1
application = 'lofar_subband'; % load LOFAR subband filterbank coefficients from file
%application = 'apertif_subband'; % calculate Apertif subband filterbank coefficients using fir1 or fircls1
%application = 'apertif_channel'; % calculate Apertif channel filterbank coefficients using fir1 or fircls1
%application = 'arts_channel'; % calculate Arts channel filterbank coefficients using fir1 or fircls1
%application = 'test_bypass'; % create bypass pfir coefficients with 1 in first tap and 0 in remaining taps
%application = 'test_incrementing'; % create incrementing pfir coefficients 1:L*N for PFIR implementation verification purposes
%% - Application specific settings
% Default settings
% Default settings (will get overruled dependend on application)
config.hp_factor = 1;
config.hp_adjust = false;
config.dc_adjust = false;
......@@ -91,15 +91,19 @@ elseif strcmp(application, 'test_incrementing')
L = 8;
coeff_w = 16;
%coeff_w = 9;
q_full_scale = 2^(coeff_w-1);
coeff = [1:L*N]'; % row
coeff = coeff / q_full_scale; % or use coeff = coeff / (max(coeff)+1);
config.design = 'incrementing';
elseif strcmp(application, 'lofar_subband')
% Load the quantized FIR coefficients of the subband filterbank in a LOFAR station
N = 1024;
L = 16;
coeff_w = 16;
q_full_scale = 2^(coeff_w-1);
coeff = load('data/Coeffs16384Kaiser-quant.dat'); % column
coeff = coeff'; % row
coeff = coeff / q_full_scale;
config.design = 'lofar_subband';
else
if strcmp(application, 'apertif_subband')
......@@ -126,15 +130,16 @@ else
end
% Enable or disable adjustment of the PFIR coefficients. Uncomment to
% overrule default:
% overrule application default for test purposes:
%config.hp_adjust = true;
config.hp_adjust = false;
%config.hp_adjust = false;
%config.dc_adjust = true;
%config.dc_adjust = false;
% Select FIR filter design method (fircls1 yields better results than
% fir1 regarding stop band suppression). Uncomment to overrule default:
% fir1 regarding stop band suppression). Uncomment to overrule
% application default for test purposes:
%config.design = 'fircls1';
%config.design = 'fir1';
......@@ -163,6 +168,24 @@ else
end
NL = N*L; % Total number of FIR filter coefficients (taps)
% Try effect of wrong wideband factor P order of the FIR coefficients.
% It is noticable in the FIR transfer function as about factor 2 in dB
% less attenuation outside the passband for bins that are multiples of
% about N/P. For P = 4 the attenuation spikes occur at:
% . bin 255.6
% . bin 256.4
% . bin 511.6
% In a time domain simulation a CW at those bins will then also show in
% the DC bin.
fir_wb_reverse = true;
%fir_wb_reverse = false; % default
if fir_wb_reverse
P = 4;
coeff = reshape(coeff, P, NL/P);
coeff = flipud(coeff);
coeff = reshape(coeff, 1, NL);
end
% Scale to actual frequency
fs = 200e6; % Lofar ADC sample rate = 200.0 MHz
fs = 200e6/1024; % Lofar subband sample rate = 200.0 MHz
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment