Wednesday, November 6, 2024

Re: USRP Sink Block

Open the options for the sink, and where it says "Subdev Spec", put in "B:0". See also https://uhd.readthedocs.io/en/latest/page_configuration.html, under "Specifying the Subdevice". It's not a great API, I know.

--M

On Tue, Nov 5, 2024 at 2:30 PM Q W <qanwang83@yahoo.com.au> wrote:
Hi there,

I am new to USRP, Gnuradio and UHD. I am currently starting to use an Ettus X310 with a UBX-160, a LFTX and a LFRX daughterboards, and trying to implement a simple communications using the USRP.

I am working on a gnuradio environment and planning to send a sine wave from RF A TX/RX to RF A RX2. The TX/RX and RX 2 ports are connected to the UBX daughterboard. At the moment, the two ports are connected with a SMA cable and a 30dB attenuator.

The script for Gnuradio is shown as below.



When running the script, I can see the correct output of the signal Source, being sine wave from the GUI time and frequency sinks. However, the received signal from USRP Source looks incorrect, which is very noisy with extremely low amplitude. I suspect the sine wave seen at the output of the USRP Source is the LO leakage other than the transmitted wave. (See the waveforms below. The second diagram is the output of the USRP source which is extremely low in amplitude and very noisy.) This has been confirmed when the TX/RX port was connected to an oscilloscope which showed noise only. When the script is running, I can see the LED indicators were on, (red light for TX/RX and green light for RX2). Thus I think there should be transmissions in the wire.



One more thing I observed is that when the SMA wire is connected to other receiving ports such as RF B RX 2, the USRP still think it is RX2 of RF A is connected, and thus I can see the green LED below RX2 of RF A , other than RX2 of RF B, is on.

I suspect I didn't configure the USRP Sink and USRP Source blocks correctly in Gnuradio, but couldn't find a solution to resolve the problem.

Kind regards,
Tom
    

Tuesday, November 5, 2024

USRP Sink Block

Hi there,

I am new to USRP, Gnuradio and UHD. I am currently starting to use an Ettus X310 with a UBX-160, a LFTX and a LFRX daughterboards, and trying to implement a simple communications using the USRP.

I am working on a gnuradio environment and planning to send a sine wave from RF A TX/RX to RF A RX2. The TX/RX and RX 2 ports are connected to the UBX daughterboard. At the moment, the two ports are connected with a SMA cable and a 30dB attenuator.

The script for Gnuradio is shown as below.

Inline image

When running the script, I can see the correct output of the signal Source, being sine wave from the GUI time and frequency sinks. However, the received signal from USRP Source looks incorrect, which is very noisy with extremely low amplitude. I suspect the sine wave seen at the output of the USRP Source is the LO leakage other than the transmitted wave. (See the waveforms below. The second diagram is the output of the USRP source which is extremely low in amplitude and very noisy.) This has been confirmed when the TX/RX port was connected to an oscilloscope which showed noise only. When the script is running, I can see the LED indicators were on, (red light for TX/RX and green light for RX2). Thus I think there should be transmissions in the wire.

Inline image

One more thing I observed is that when the SMA wire is connected to other receiving ports such as RF B RX 2, the USRP still think it is RX2 of RF A is connected, and thus I can see the green LED below RX2 of RF A , other than RX2 of RF B, is on.

I suspect I didn't configure the USRP Sink and USRP Source blocks correctly in Gnuradio, but couldn't find a solution to resolve the problem.

Kind regards,
Tom
    

Monday, November 4, 2024

Re: Deprecated volk_* functions?

Ralf,

Here's an example in one of my OOT projects.

https://github.com/drmpeg/gr-atsc3/blob/master/lib/paprtr_cc_impl.cc#L488-L492

Here's the pull request that changed things.

https://github.com/gnuradio/volk/pull/695

Ron

On 11/4/24 11:42, Ralf Gorholt wrote:
Dear all,

in one of my blocks I use VOLK functions for which the compiler prints a
"deprecated" warning message (volk_32fc_s32fc_x2_rotator_32fc and
volk_32fc_s32fc_multiply_32fc).

How do I need to change my code to get rid of them? In the volk
documentation I haven't seen anything but maybe I've overlooked it. I am
currently using VOLK version 3.1.2

Thank you for your help!

Ralf

Deprecated volk_* functions?

Dear all,

in one of my blocks I use VOLK functions for which the compiler prints a
"deprecated" warning message (volk_32fc_s32fc_x2_rotator_32fc and
volk_32fc_s32fc_multiply_32fc).

How do I need to change my code to get rid of them? In the volk
documentation I haven't seen anything but maybe I've overlooked it. I am
currently using VOLK version 3.1.2

Thank you for your help!

Ralf

Saturday, November 2, 2024

Re: Regarding the use of file sink module

Hi Yuhe,

On 01.11.24 02:29, 徐雨荷 wrote:
> The txt file cannot fully display the data

It's not a text file. Please read

https://wiki.gnuradio.org/index.php?title=File_Sink#What_is_the_file_format_of_a_file_sink?_How_can_I_read_files_produced_by_a_file_sink?

Best regards,
Marcus

Friday, November 1, 2024

Re: "forecast" function error in Embedded Python basic_block

I guess I answered my own question:

The forecast function definition has changed in gnuradio 3.10 and it is now defined in such a way that the second argument is only the number of input ports.
So a correct forecast looks like this.

    def forecast(self, noutput_items, ninputs):
        ninput_items_required = [0] * ninputs
        for i in range(ninputs):
            ninput_items_required[i] = noutput_items * self.sps
        return ninput_items_required

Achilleas

On Fri, Nov 1, 2024 at 1:36 PM Achilleas Anastasopoulos <anastas@umich.edu> wrote:
Hi everyone,

I am running a simple flowgraph where I use an embedded python block.

I have rewritten a forecast function.

When I run the code I get:
============
Executing: /usr/bin/python3 -u top_block.py

thread_body_wrapper :error: ERROR thread[thread-per-block[15]: <block MF sampler and diff decoder(7)>]: TypeError: 'int' object does not support item assignment

At:
  /n/higgins/z/anastas/GNURADIO_LAB/Final Draft Lab 8/top_block_epy_block_0.py(39): forecast
  /usr/lib/python3/dist-packages/gnuradio/gr/gateway.py(149): handle_forecast
===============

It thinks that the second argument in forecast is an "int" instead of a list to be populated 
by the function.

What am I missing? (I am using gnuradio 3.10.1.1 (Python 3.10.12))
Also, where can i find the exact Python bindings for each of these functions?

thanks 
Achilleas

Here is the relevant code:
=====================================
class blk(gr.basic_block):  # other base classes are basic_block, decim_block, interp_block
    """Embedded Python Block example"""

    def __init__(self, datalength=10, sps = 8):  
        """arguments to this function show up as parameters in GRC"""
        gr.basic_block.__init__(
            self,
            name='MF sampler and diff decoder',   
            in_sig=[np.int8, np.complex64],  
            out_sig=[np.int8]             
        )
        self.datalength = datalength
        self.sps = sps
        self.set_output_multiple(self.datalength)
        self.state=1

    def forecast(self, noutput_items, ninput_items_required):
        ninput_items_required[0] = noutput_items*self.sps
        ninput_items_required[1] = noutput_items*self.sps
   

"forecast" function error in Embedded Python basic_block

Hi everyone,

I am running a simple flowgraph where I use an embedded python block.

I have rewritten a forecast function.

When I run the code I get:
============
Executing: /usr/bin/python3 -u top_block.py

thread_body_wrapper :error: ERROR thread[thread-per-block[15]: <block MF sampler and diff decoder(7)>]: TypeError: 'int' object does not support item assignment

At:
  /n/higgins/z/anastas/GNURADIO_LAB/Final Draft Lab 8/top_block_epy_block_0.py(39): forecast
  /usr/lib/python3/dist-packages/gnuradio/gr/gateway.py(149): handle_forecast
===============

It thinks that the second argument in forecast is an "int" instead of a list to be populated 
by the function.

What am I missing? (I am using gnuradio 3.10.1.1 (Python 3.10.12))
Also, where can i find the exact Python bindings for each of these functions?

thanks 
Achilleas

Here is the relevant code:
=====================================
class blk(gr.basic_block):  # other base classes are basic_block, decim_block, interp_block
    """Embedded Python Block example"""

    def __init__(self, datalength=10, sps = 8):  
        """arguments to this function show up as parameters in GRC"""
        gr.basic_block.__init__(
            self,
            name='MF sampler and diff decoder',   
            in_sig=[np.int8, np.complex64],  
            out_sig=[np.int8]             
        )
        self.datalength = datalength
        self.sps = sps
        self.set_output_multiple(self.datalength)
        self.state=1

    def forecast(self, noutput_items, ninput_items_required):
        ninput_items_required[0] = noutput_items*self.sps
        ninput_items_required[1] = noutput_items*self.sps