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

Normalize LOFAR FIR coeff.

parent d46aa892
No related branches found
No related tags found
No related merge requests found
...@@ -89,7 +89,7 @@ fig=0; ...@@ -89,7 +89,7 @@ fig=0;
%% Selectable test bench settings %% 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 = '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') if strcmp(tb.model_filterbank, 'LOFAR')
tb.model_quantization = 'fixed point'; tb.model_quantization = 'fixed point';
tb.nof_subbands = 512; tb.nof_subbands = 512;
...@@ -100,13 +100,13 @@ else ...@@ -100,13 +100,13 @@ else
end end
% Input signal 'sinusoid' carrier frequency % 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 = 1.55;
%tb.subband_wg = 12; %tb.subband_wg = 12;
% Model a frequency sweep of the 'sinusoid' % 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 = 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 if tb.chirp
tb.nof_tsub = 200; % number of subband periods to simulate tb.nof_tsub = 200; % number of subband periods to simulate
else else
...@@ -205,6 +205,7 @@ if strcmp(tb.model_filterbank, 'LOFAR') ...@@ -205,6 +205,7 @@ if strcmp(tb.model_filterbank, 'LOFAR')
ctrl_pfir_subband.data_w = 16; ctrl_pfir_subband.data_w = 16;
ctrl_pfir_subband.config.design = 'lofar file'; ctrl_pfir_subband.config.design = 'lofar file';
hfir_subband_coeff = load('data/Coeffs16384Kaiser-quant.dat'); hfir_subband_coeff = load('data/Coeffs16384Kaiser-quant.dat');
hfir_subband_coeff = hfir_subband_coeff/max(hfir_subband_coeff);
else else
% Calculate free choice PFIR coefficients (can be floating point or fixed point) % Calculate free choice PFIR coefficients (can be floating point or fixed point)
ctrl_pfir_subband.nof_taps = 16; % Number of taps ctrl_pfir_subband.nof_taps = 16; % Number of taps
...@@ -415,7 +416,7 @@ figure(fig); ...@@ -415,7 +416,7 @@ figure(fig);
data = data_pfir_subband.'; data = data_pfir_subband.';
plot(ts, data(:)) plot(ts, data(:))
title(sprintf('Subband PFIR filter output - FFT input data (WG subband %6.3f)', tb.subband_wg)); 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)); xlabel(sprintf('Time 0:%d [Tsub]', tb.nof_tsub-1));
ylabel('Voltage'); ylabel('Voltage');
grid on; grid on;
......
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