discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Are there firls and kaiser filter methods for C++ OOT?


From: George Edwards
Subject: Re: Are there firls and kaiser filter methods for C++ OOT?
Date: Tue, 22 Feb 2022 18:42:27 -0600

Hi Marcin and Vasil,

Thank you guys very much!

Marcin: I did as you suggested and left out win_type and beta. 
Vasil: Based on the conversation exchanges between you Marcin, I followed your suggestion to link in the gnuradio-filter library - in lib/CMakeLists.txt in target_link_libraries() by adding gnuradio-filter.
Thus, the target_link_libraries in the original OOT lib/CMakeLists.txt file was:
target_link_libraries(gnuradio-ge_filters gnuradio::gnuradio-runtime)
and I added to it as shown below:
target_link_libraries(gnuradio-ge_filters gnuradio::gnuradio-runtime gnuradio-filter)
The OOT program compiles and makes the intended Gnuradio block for me to load in a GRC flowgraph. For experimental purposes, I made the OOT block to output the filter coefficients. When I run the grc, the lowpass filter outputs all zeros, so something is wrong! 
Marcin: You had written a piece of code to print "Hello World". Please run your code to print out the returned filter coefficients and let me know if it works well because mine is having some problems. 

This is how I invoked the filter method (all parameters are defined):
vector <float> lpfilter;     //vector variable will contain the filter coeff's
lpfilter = gr::filter::firdes::low_pass(gain, sampling_freq, cutoff_freq, transition_bandwidth);

Thank you guys!

George


On Tue, Feb 22, 2022 at 3:41 PM Marcin Puchlik <m.puchlik@is-wireless.com> wrote:
Geroge,
I posted the working code a few messages ago. Try to check this out. BTW as far as I can see those two arguments are optional (window type and beta). Try to run your code without them and check if it works.


wt., 22 lut 2022 o 19:25 George Edwards <gedwards.eng@gmail.com> napisał(a):
Hello Vasil and Marcin,

Thanks very much for your help.

I have all the relevant #include header files and invoke the low_pass filter as follows:
lpfilter = gr::filter::firdes::low_pass(gain, sampling_freq, cutoff_freq, transition_bandwidth,
fft::window::win_type::WIN_HAMMING, beta);

Observations:
Using the mouse to hover over WIN_HAMMING, I can see that it interprets the win_type enum variable and correctly assigns it a value of "0" (which is the value stated in the Gnuradio C++ API Reference manual). However, there is a squidly under beta. Hovering over beta, the error message is: 
Argument of type "double" is incompatible with parameter of type "gr::fft::window::win_type" 

If one of you has a working code fragment using one of the C++ Gnuradio filter methods that you can cut, paste and send in your next email I would appreciate it. 

Thanks for your help.

George

On Tue, Feb 22, 2022 at 6:15 AM Vasil Velichkov <vvvelichkov@gmail.com> wrote:
Hi George,

On 21/02/2022 18.31, George Edwards wrote:
> lpfilter = gr::filter::firdes::low_pass(gain, sampling_freq, cutoff_freq, transition_bandwidth,
> fft::window::win_type <https://www.gnuradio.org/doc/doxygen/classgr_1_1fft_1_1window.html#a599d7e9625d6cc77203a8b877c4911e2>window = fft::window::win_type::WIN_HAMMING, beta = 6.76);
>
> This failed and showed a squidly across the line with fft::window::win_type....!

Try adding "gr::" before "fft::window" and make sure gnuradio/fft/window.h is included.

  #include <gnuradio/fft/window.h>

  lpfilter = gr::filter::firdes::low_pass(gain, sampling_freq, cutoff_freq, transition_bandwidth,
        gr::fft::window::win_type window = fft::window::win_type::WIN_HAMMING, beta = 6.76);

If this does not fix it then provide the exact error you are getting.

Regards,
Vasil

reply via email to

[Prev in Thread] Current Thread [Next in Thread]