Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HDL
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
9458a881
Commit
9458a881
authored
7 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Use fir_wb_reverse to try effect of wrong wideband factor P order of the FIR coefficients.
parent
74ea0995
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/apertif/matlab/run_pfir_coeff.m
+30
-7
30 additions, 7 deletions
applications/apertif/matlab/run_pfir_coeff.m
with
30 additions
and
7 deletions
applications/apertif/matlab/run_pfir_coeff.m
+
30
−
7
View file @
9458a881
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment