From 74ea0995719d97ccac33ca908715d16e422197d5 Mon Sep 17 00:00:00 2001
From: Erik Kooistra <kooistra@astron.nl>
Date: Thu, 30 Nov 2017 10:39:03 +0000
Subject: [PATCH] Normalize LOFAR FIR coeff.

---
 applications/apertif/matlab/one_pfb.m | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/applications/apertif/matlab/one_pfb.m b/applications/apertif/matlab/one_pfb.m
index 85c8afe488..09573c5ab0 100644
--- a/applications/apertif/matlab/one_pfb.m
+++ b/applications/apertif/matlab/one_pfb.m
@@ -89,7 +89,7 @@ fig=0;
 
 %% Selectable test bench settings
 tb.model_filterbank       = 'Free choice';         % 'LOFAR' = use fixed settings of LOFAR subband filterbank, else use free choice of tb.nof_subbands and PFIR coefficients
-%tb.model_filterbank       = 'LOFAR';
+tb.model_filterbank       = 'LOFAR';
 if strcmp(tb.model_filterbank, 'LOFAR')
     tb.model_quantization = 'fixed point';
     tb.nof_subbands       = 512;
@@ -100,13 +100,13 @@ else
 end
 
 % Input signal 'sinusoid' carrier frequency
-tb.subband_wg        = 47;           % subband range 0:tb.nof_subbands-1, can be fraction to have any sinusoid frequency
+tb.subband_wg        = 47.4;           % subband range 0:tb.nof_subbands-1, can be fraction to have any sinusoid frequency
 %tb.subband_wg        = 1.55;
 %tb.subband_wg        = 12;
 
 % Model a frequency sweep of the 'sinusoid'
 tb.chirp             = 0;              % 0 = use fixed tb.subband_wg frequency, else increment WG frequency every block to have chirp frequency sweep
-tb.chirp             = 1;
+%tb.chirp             = 1;
 if tb.chirp
     tb.nof_tsub      = 200;            % number of subband periods to simulate
 else
@@ -205,6 +205,7 @@ if strcmp(tb.model_filterbank, 'LOFAR')
     ctrl_pfir_subband.data_w             = 16;
     ctrl_pfir_subband.config.design      = 'lofar file';
     hfir_subband_coeff = load('data/Coeffs16384Kaiser-quant.dat');
+    hfir_subband_coeff = hfir_subband_coeff/max(hfir_subband_coeff);
 else
     % Calculate free choice PFIR coefficients (can be floating point or fixed point)
     ctrl_pfir_subband.nof_taps           = 16;                                                            % Number of taps
@@ -415,7 +416,7 @@ figure(fig);
 data = data_pfir_subband.';
 plot(ts, data(:))
 title(sprintf('Subband PFIR filter output - FFT input data (WG subband %6.3f)', tb.subband_wg));
-ylim([-2 2]);             % Delay tracking step when tb.subband_wg is .5 causes double range
+ylim([-3 3]);             % Delay tracking step when tb.subband_wg is .5 causes double range
 xlabel(sprintf('Time 0:%d [Tsub]', tb.nof_tsub-1));
 ylabel('Voltage');
 grid on;
-- 
GitLab