Skip to content
GitLab
Explore
Sign in
Register
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RTSD
HDL
Commits
33db9d3f
Commit
33db9d3f
authored
6 years ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Added log subband statistics for subband_i, to investigate spurious subband power for WG sinus.
parent
159dedf8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/apertif/matlab/run_pfb.m
+36
-0
36 additions, 0 deletions
applications/apertif/matlab/run_pfb.m
with
36 additions
and
0 deletions
applications/apertif/matlab/run_pfb.m
+
36
−
0
View file @
33db9d3f
...
...
@@ -64,6 +64,7 @@ tb.subband_wg = 1; % subband range 0:tb.nof_subbands-1, can be
tb
.
subband_wg
=
301
;
tb
.
subband_wg
=
301
+
1
/
13
;
tb
.
subband_wg
=
64
;
tb
.
subband_wg
=
64
+
1
/
64
;
tb
.
phase
=
0
;
% initial 'sinusoid' phase offset normalized to 2pi
tb
.
sop
=
1
;
% initial 'impulse' start index in range ctrl_wg.block_size = tb.subband_fft_size
...
...
@@ -331,6 +332,40 @@ if strcmp(tb.model_quantization, 'fixed point')
fclose
(
fid
);
end
%% Log subband statistics for subband_i
% bin indices for a subband spectrum after the impulse response has
% settled, so after ctrl_pfir_subband.nof_taps * tb.nof_subbands
tg
=
(
ctrl_pfir_subband
.
nof_taps
+
4
)
*
tb
.
nof_subbands
;
tgI
=
tg
+
1
;
sub_bins
=
tgI
+
[
0
:
tb
.
nof_subbands
-
1
];
% Matlab indices of subbands in block tg
sub_I_bin
=
tgI
+
tb
.
subband_i
;
% Matlab index of subband_I
sub_ampl
=
abs
(
data_pfft_subband
);
data
=
sub_ampl
.'
;
data
=
data
(:);
sub_I_ampl
=
data
(
sub_I_bin
);
sub_I_power
=
sub_I_ampl
^
2
;
sub_spurious
=
data
(
sub_bins
);
sub_spurious
(
tb
.
subband_I
)
=
0
;
sub_spurious_max
=
max
(
sub_spurious
);
sub_spurious_power
=
sum
(
sub_spurious
.^
2
);
sub_I_snr
=
sub_I_power
/
sub_spurious_power
;
sub_I_snr_max
=
sub_I_power
/
sub_spurious_max
^
2
;
disp
(
sprintf
([
'\nStatistics for WG subband %f in subband bin %d:\n'
,
...
'. Subband amplitude = %10.8f\n'
,
...
'. Subband power = %10.8f\n'
,
...
'. Spurious amplitude max = %10.8f\n'
,
...
'. Spurious total power = %10.8f\n'
,
...
'. SNR subband / spurious total = %f dB\n'
,
...
'. SNR subband / spurious max = %f dB\n'
],
...
tb
.
subband_wg
,
tb
.
subband_i
,
...
sub_I_ampl
,
...
sub_I_power
,
...
sub_spurious_max
,
...
sub_spurious_power
,
...
10
*
log10
(
sub_I_snr
),
...
10
*
log10
(
sub_I_snr_max
)));
%% Plot data path results
xfig
=
300
;
...
...
@@ -346,6 +381,7 @@ tsub_one = (0: tb.nof_tsub-1); % time i
sub_I
=
tb
.
subband_I
+
[
0
:
tb
.
nof_subbands
:
tb
.
nof_subbands
*
tb
.
nof_tsub
-
1
];
% get Matlab indices of all subband_I
sub_Iplus1
=
tb
.
subband_Iplus1
+
[
0
:
tb
.
nof_subbands
:
tb
.
nof_subbands
*
tb
.
nof_tsub
-
1
];
% get Matlab indices of all next neighbour subband_I+1
%% Plot WG output
fig
=
fig
+
1
;
figure
(
'position'
,
[
xfig
+
fig
*
dfig
yfig
-
fig
*
dfig
xfigw
yfigw
]);
...
...
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