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
771f9195
Commit
771f9195
authored
11 months ago
by
Eric Kooistra
Browse files
Options
Downloads
Patches
Plain Diff
Support verbosity.
parent
040e1503
No related branches found
No related tags found
1 merge request
!411
Resolve RTSD-271
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/lofar2/model/rtdsp/fourier.py
+3
-2
3 additions, 2 deletions
applications/lofar2/model/rtdsp/fourier.py
with
3 additions
and
2 deletions
applications/lofar2/model/rtdsp/fourier.py
+
3
−
2
View file @
771f9195
...
@@ -34,7 +34,7 @@ from .utilities import c_rtol, c_atol, ceil_pow2, is_even
...
@@ -34,7 +34,7 @@ from .utilities import c_rtol, c_atol, ceil_pow2, is_even
# Time domain interpolation using DFT
# Time domain interpolation using DFT
###############################################################################
###############################################################################
def
fourier_interpolate
(
HFfilter
,
Ncoefs
):
def
fourier_interpolate
(
HFfilter
,
Ncoefs
,
verbosity
=
1
):
"""
Use Fourier interpolation to create final FIR filter coefs.
"""
Use Fourier interpolation to create final FIR filter coefs.
HF contains filter transfer function for N points, in order 0 to fs. The
HF contains filter transfer function for N points, in order 0 to fs. The
...
@@ -82,6 +82,7 @@ def fourier_interpolate(HFfilter, Ncoefs):
...
@@ -82,6 +82,7 @@ def fourier_interpolate(HFfilter, Ncoefs):
# K + 1 + K = N values, because N is odd and K = N // 2
# K + 1 + K = N values, because N is odd and K = N // 2
hInterpolated
=
np
.
fft
.
ifft
(
HFextended
)
hInterpolated
=
np
.
fft
.
ifft
(
HFextended
)
if
np
.
allclose
(
hInterpolated
.
imag
,
np
.
zeros
(
Ncoefs
),
rtol
=
c_rtol
,
atol
=
c_atol
):
if
np
.
allclose
(
hInterpolated
.
imag
,
np
.
zeros
(
Ncoefs
),
rtol
=
c_rtol
,
atol
=
c_atol
):
if
verbosity
:
print
(
'
hInterpolated.imag ~= 0
'
)
print
(
'
hInterpolated.imag ~= 0
'
)
else
:
else
:
print
(
'
WARNING: hInterpolated.imag != 0 (max(abs) = %e)
'
%
np
.
max
(
np
.
abs
(
hInterpolated
.
imag
)))
print
(
'
WARNING: hInterpolated.imag != 0 (max(abs) = %e)
'
%
np
.
max
(
np
.
abs
(
hInterpolated
.
imag
)))
...
...
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