potto216 / tds-tutorials

Ultrasound based time delay spectrometry (TDS) tutorials and learning resources
MIT License
8 stars 1 forks source link

IIR Filter in tds_generate_chirp.grc fails #7

Closed DDubbleDD closed 4 years ago

DDubbleDD commented 4 years ago

I'm trying to run the above gnuradio file and the IIR filter gives the following error: Executing: C:\Program Files\GNURadio-3.8\gr-python27\python.exe -u H:\Projects\GNU_Radio\tds-tutorials-master\gnuradio\GrCon2020\tds_generate_chirp.py

Traceback (most recent call last): File "H:\Projects\GNU_Radio\tds-tutorials-master\gnuradio\GrCon2020\tds_generate_chirp.py", line 463, in main() File "H:\Projects\GNU_Radio\tds-tutorials-master\gnuradio\GrCon2020\tds_generate_chirp.py", line 441, in main tb = top_block_cls() File "H:\Projects\GNU_Radio\tds-tutorials-master\gnuradio\GrCon2020\tds_generate_chirp.py", line 314, in init self.iir_filter_xxx_0 = filter.iir_filter_ffd(0.5, [1, -1], True) File "C:\Program Files\GNURadio-3.8\lib\site-packages\gnuradio\filter\filter_swig.py", line 1518, in make return _filter_swig.iir_filter_ffd_make(fftaps, fbtaps, oldstyle) TypeError: in method 'iir_filter_ffd_make', argument 1 of type 'std::vector< double,std::allocator< double > > const &'

Done (return code 1)

I have run a few of the other example files without issue.

DDubbleDD commented 4 years ago

I think I got this to work by changing the Feed-forward Taps from 0.5 to [0.5,0]. I found a post that said that the IIR Filter is expecting taps with the same number of elements. Can you verify that that this is still correct?

potto216 commented 4 years ago

Interesting. I just ran it with the value 0.5 as a scalar and not a list and it ran without error. I noticed your path said C:\Program Files\GNURadio-3.8\gr-python27\python.exe . Since GnuRadio 3.8 uses Python 3, what happens when you type python --version? BTW I pushed updates that changed around the directory structure for this file.

DDubbleDD commented 4 years ago

I am on Windows and the current Gun Radio installation for Windows is still only 3.8.0.0 with Python 2.7.10. I have Python 3.8.3 installed on my PC but I couldn't find any good tutorials for manually switching Gnu Radio to use it. I can look again...

potto216 commented 4 years ago

I took a look at the Windows installer page (http://www.gcndevelopment.com/gnuradio/downloads.htm) and it is odd because the v3.8.1.0/v1.7 (py2.7)(pdbs) does reference python 2. I thought everything >= 3.8 uses Python 3. What Python version do you see when you run gnuradio-companion and select Help->About? Mine is "3.8.2.0 (Python 3.8.5)". Also I'm running Windows, but I'm using the Ubuntu VM at https://wiki.gnuradio.org/index.php/UbuntuVM.

DDubbleDD commented 4 years ago

Yes it says it is using Python 2.7. Maybe someday they will post the compile for Gnuradio 3.9 with Python 3x.

potto216 commented 4 years ago

I learned that GNURadio 3.8 is both Python 2 and 3 compatible. I didn't realize that. "Python: Python 2 & Python 3 compatible. 3.8 will be the last Py2k-compatible release series" (https://github.com/gnuradio/gnuradio/blob/master/CHANGELOG.md). I guess for maximum compatibility with existing libraries they built the Window's version of GNURadio 3.8 with Python 2, while The VM I use was built with Python 3. Interesting fact of the day:)