examples/fir: better filter

This commit is contained in:
Sebastien Bourdeauducq 2013-02-22 23:19:56 +01:00
parent f9acee4e68
commit 3a591c358c
1 changed files with 3 additions and 3 deletions

View File

@ -52,18 +52,18 @@ class TB(PureSimulable):
def main(): def main():
# Compute filter coefficients with SciPy. # Compute filter coefficients with SciPy.
coef = signal.remez(80, [0, 0.1, 0.1, 0.5], [1, 0]) coef = signal.remez(30, [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(100) sim.run(200)
del sim del sim
in_signals += tb.inputs in_signals += tb.inputs
out_signals += tb.outputs out_signals += tb.outputs