From 1ddeb4ad99a8bbeccfbbf55cc2609cb71f23f548 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Thu, 21 Nov 2013 18:58:20 +0100 Subject: add the FIRFilter tap generation tool --- doc/fir-filter/generate-filter.py | 40 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 doc/fir-filter/generate-filter.py (limited to 'doc/fir-filter/generate-filter.py') diff --git a/doc/fir-filter/generate-filter.py b/doc/fir-filter/generate-filter.py new file mode 100755 index 0000000..e4e2d0b --- /dev/null +++ b/doc/fir-filter/generate-filter.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python +# This tool uses gnuradio to generate FIR filter taps +# that can be used for the FIRFilter function in +# CRC DabMod +# +# The MIT License (MIT) +# +# Copyright (c) 2013 Matthias P. Braendli +# http://mpb.li +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +import gnuradio +from gnuradio import gr + +gain = 1 +rate = 2.048e6 +cutoff = 810e3 +transition_width = 150e3 +taps = gr.firdes_low_pass(gain, rate, cutoff, transition_width, gr.firdes.WIN_HAMMING, beta=6.76) + +print(len(taps)) +for t in taps: + print(t) -- cgit v1.2.3