diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2013-11-21 18:58:20 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2013-11-21 18:58:20 +0100 |
commit | 1ddeb4ad99a8bbeccfbbf55cc2609cb71f23f548 (patch) | |
tree | 9391b64f8890408efc53a849c752c66db4c9b4aa /doc/fir-filter/generate-filter.py | |
parent | 597789f152f446449ae1878904860d0563d5ef09 (diff) | |
download | dabmod-1ddeb4ad99a8bbeccfbbf55cc2609cb71f23f548.tar.gz dabmod-1ddeb4ad99a8bbeccfbbf55cc2609cb71f23f548.tar.bz2 dabmod-1ddeb4ad99a8bbeccfbbf55cc2609cb71f23f548.zip |
add the FIRFilter tap generation tool
Diffstat (limited to 'doc/fir-filter/generate-filter.py')
-rwxr-xr-x | doc/fir-filter/generate-filter.py | 40 |
1 files changed, 40 insertions, 0 deletions
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) |