Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kestrel Collaboration
Kestrel LiteX
migen
Commits
3a591c35
Commit
3a591c35
authored
11 years ago
by
Sebastien Bourdeauducq
Browse files
Options
Download
Email Patches
Plain Diff
examples/fir: better filter
parent
f9acee4e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
examples/sim/fir.py
examples/sim/fir.py
+3
-3
No files found.
examples/sim/fir.py
View file @
3a591c35
...
@@ -52,18 +52,18 @@ class TB(PureSimulable):
...
@@ -52,18 +52,18 @@ class TB(PureSimulable):
def
main
():
def
main
():
# Compute filter coefficients with SciPy.
# Compute filter coefficients with SciPy.
coef
=
signal
.
remez
(
8
0
,
[
0
,
0.1
,
0.
1
,
0.5
],
[
1
,
0
])
coef
=
signal
.
remez
(
3
0
,
[
0
,
0.1
,
0.
2
,
0.4
,
0.45
,
0.5
],
[
0
,
1
,
0
])
fir
=
FIR
(
coef
)
fir
=
FIR
(
coef
)
# Simulate for different frequencies and concatenate
# Simulate for different frequencies and concatenate
# the results.
# the results.
in_signals
=
[]
in_signals
=
[]
out_signals
=
[]
out_signals
=
[]
for
frequency
in
[
0.05
,
0.
07
,
0.1
,
0.15
,
0.2
]:
for
frequency
in
[
0.05
,
0.
1
,
0.25
]:
tb
=
TB
(
fir
,
frequency
)
tb
=
TB
(
fir
,
frequency
)
fragment
=
autofragment
.
from_local
()
fragment
=
autofragment
.
from_local
()
sim
=
Simulator
(
fragment
)
sim
=
Simulator
(
fragment
)
sim
.
run
(
1
00
)
sim
.
run
(
2
00
)
del
sim
del
sim
in_signals
+=
tb
.
inputs
in_signals
+=
tb
.
inputs
out_signals
+=
tb
.
outputs
out_signals
+=
tb
.
outputs
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment