[英]GNU Radio + HackRF: RuntimeError: firdes check failed: 0 < fa <= sampling_freq / 2
I just started using GNU Radio, I must say I am quite a noob but I have some background on RF related stuff.我刚开始使用 GNU Radio,我必须说我是一个菜鸟,但我对 RF 相关的东西有一些背景。 Here's the thing: I recorded a file that I now want to repeat through my HackRF and GNU Radio.
事情是这样的:我录制了一个我现在想通过我的 HackRF 和 GNU Radio 重复的文件。
This is the exact settings for the filter:这是过滤器的确切设置:
The settings you see are casual (since I cannot get it working I started testing with random values).您看到的设置是随意的(因为我无法正常工作,所以我开始使用随机值进行测试)。 This is the error I get:
这是我得到的错误:
Executing: /usr/bin/python3 -u /home/scare/LAB/RadioFrequencies/GNU Radio/reply_433.py
gr-osmosdr 0.2.0.0 (0.2.0) gnuradio 3.8.2.0
built-in sink types: uhd hackrf bladerf soapy redpitaya file
[INFO] [UHD] linux; GNU C++ version 11.1.0; Boost_107600; UHD_4.0.0.0-0-unknown
Using HackRF One with firmware 2017.02.1
Traceback (most recent call last):
File "/home/scare/LAB/RadioFrequencies/GNU Radio/reply_433.py", line 211, in <module>
main()
File "/home/scare/LAB/RadioFrequencies/GNU Radio/reply_433.py", line 187, in main
tb = top_block_cls()
File "/home/scare/LAB/RadioFrequencies/GNU Radio/reply_433.py", line 137, in __init__
firdes.high_pass(
File "/usr/lib/python3.9/site-packages/gnuradio/filter/filter_swig.py", line 124, in high_pass
return _filter_swig.firdes_high_pass(*args, **kwargs)
RuntimeError: firdes check failed: 0 < fa <= sampling_freq / 2
Done (return code 1)
Where obviously the interesting part is the RuntimeError: firdes check failed: 0 < fa <= sampling_freq / 2显然有趣的部分是RuntimeError: firdes check failed: 0 < fa <= sampling_freq / 2
Unfortunately, I don't get what that 'fa' stands for.不幸的是,我不明白“fa”代表什么。
Any idea?任何的想法?
Cheers干杯
I just got done solving this same error.我刚刚解决了同样的错误。 The error is caused by a filter's Cut-off and transition parameters being set incorrectly (in my case far too large).
该错误是由过滤器的截止和过渡参数设置不正确(在我的例子中太大)引起的。 GNU radio handles the variable 'samp_rate' differently for each block and filters seem to interpret it was a point to center the filter on (that's my take on it so don't quote me).
GNU radio 对每个块的变量 'samp_rate' 的处理方式不同,过滤器似乎将其解释为过滤器的中心点(这是我的看法,所以不要引用我的话)。
I also looked in the source code and can't find anything helpful on 'fa'我还查看了源代码,但在“fa”上找不到任何有用的信息
So try adjusting your cutoff to be something below samp_rate and make your transition width something to the tune of 250e3.因此,请尝试将您的截止值调整为低于 samp_rate 的值,并使您的过渡宽度达到 250e3 的水平。 I used GUI sliders to set the filter how I liked and I will make these permanent in the final version.
我使用 GUI 滑块来设置我喜欢的过滤器,我将在最终版本中使它们永久存在。
Screen Cap of Settings Here Slider Settings For Both Sliders此处设置的屏幕截图Slider 两个滑块的设置
Mike Ossmann's "SDR with HackRF One, Lesson 10 - Filters helped" me out here. Mike Ossmann 的“SDR with HackRF One, Lesson 10 - Filters helped”我在这里。 Also just a great SDR lecture series for GNU radio if you haven't come across them yet.
如果您还没有接触过它们,那么这也是一个很棒的 GNU 无线电 SDR 讲座系列。 (just make sure to use the QT GUI).
(只要确保使用 QT GUI)。
I hope this helped.我希望这有所帮助。 I am pretty new to GNU so sorry if the explanation is a little half-baked.
我是 GNU 的新手,如果解释有点不成熟,我深表歉意。
fa
is the cutoff_frequency in the function that is throwing the error message. fa
是抛出错误消息的 function 中的 cutoff_frequency。 The cutoff frequency has to be greater than 0 and no more than the Nyquist limit.截止频率必须大于 0 且不超过奈奎斯特极限。 There are some functions called sanity_check_xxx (xxx being whether one cutoff or 2, ie bandpass, and optionally c for complex) around line 750 in
gr_filter/lib/firdes.cc
in the GNU Radio repository on GitHub.在 GitHub 的 GNU Radio 存储库中的
gr_filter/lib/firdes.cc
的第 750 行附近有一些函数称为 sanity_check_xxx(xxx 是一个截止还是 2,即带通,可选的 c)。
In the question the samp_rate would need to be at least 800MHz to support a high pass cutoff of 400Mhz.在这个问题中,samp_rate 至少需要 800MHz 才能支持 400Mhz 的高通截止频率。 As far as I can tell sample rate is used the same way in these filter functions as anywhere else in GNU Radio.
据我所知,采样率在这些过滤器函数中的使用方式与 GNU Radio 中其他任何地方的使用方式相同。
I ran into the same error message because I used 'firdes.band_pass instead of
firdes.complex_band_pass` and the low cutoff was negative, which it should be for the complex band pass filter.我遇到了同样的错误消息,因为我使用了“firdes.band_pass
instead of
firdes.complex_band_pass”,并且低截止频率为负值,这应该用于复数带通滤波器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.