Thursday, January 31, 2019

Re: [Discuss-gnuradio] correlation estimator reliability problem

On 1/31/19 6:39 AM, Alban Meffre wrote:
> Hi All
> did someone make the test_corr_est.grc example work properly recently ?
> i tried the 3.7.13 gnuradio version on linux, macos and windows
> in all versions the output of the correlation estimator block is really
> a mess
> this block put tag even if there is no signal at all, with corr_est = 0

It's an easy way to find it.

Post your

test_corr_est.grc

file.

-- Cinaed


>
> yesterday i managed to transmit a realtime MPEGTS videosignal using the
> gnuradio example packet_tx ->  packet_rx. i used an analog devices ADALM
> PLUTO as an emitter and a RTLSDR as a receiver. both antenna where put
> side by side at a few centimeter distance so the received baseband
> signal had an amplitude near 0.5
>
> the problem was that the transmission did not work for more than few
> tens of second because the correlation block added misplaced tags every
> now and then and put the header/payload demux in a locked state so i got
> #f and no more packet output !
>
> another problem is that if i set the thershold to 0.9999, 0.99999 or
> more 9's, the result is not satisfying.
> is someone able to explain me how to use correlation estimation block in
> a reliable way ?
> do i need to set the thershold to ABSOLUTE mode ?
>
> thanks
> bob
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Re: [Discuss-gnuradio] Moving my antenna

In general, good quality 75 ohm (CATV) coax is perfectly acceptable for receive applications, and for that matter, most transmit applications. There's a fair bit of misconception about the amount of "loss" introduced by an impedence mismatch.

If you mentioned the frequency range you're interested in, I missed it. the higher you go (i.e., VHF vs. HF, or UHF/SHF vs. VHF), loss does start to matter. There's an effective attenuation factor at different frequency ranges in coax based on length: it's effectively a resistor. As Doug and Albin (above) note this has to be accounted for.

gerry n5jxs

On Tue, Jan 29, 2019 at 3:57 PM david vanhorn <kc6ete@gmail.com> wrote:
It would be very helpful to know the main frequency of interest.  
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


--
Gerry Creager
NSSL/CIMMS
405.325.6371
++++++++++++++++++++++
The way to get started is to quit talking and begin doing.
   Walt Disney

Re: [Discuss-gnuradio] PC requirements for DVB-S2 processing at a high bandwidth

In addition to what Ron mentioned there is an FPGA implementation of the LDPC portion of DVB-S2 that I will be releasing late February (I hoped to be ready to relase it by FOSDEM, but work got in the way) which achieves the full bitrate. The initial release will not be integrated with RFNoC, but that could be added at a later date. Right now it is mostly running on the Ultra96 board. 

--Brennan

On Thu, Jan 31, 2019, 11:56 AM Ron Economos <w6rz@comcast.net wrote:
The processing requirement for DVB-S2 are significant, especially the
receiver. Since you're using an X-series USRP, I'll guess you're
interested in satellite downlinks which can be 30 to 50 Msyms/s.

Basically, the requirement would be the most powerful system you can
afford. Something with an Intel i9 or Xeon Gold/Platinum series processor.

Even then, real-time processing for the receiver will be limited unless
you use an FPGA or GPU for the LDPC decoding.

The good news is that I've ported an SIMD optimized LDPC decoder to GNU
Radio.

https://github.com/drmpeg/gr-dvbs2rx

Which is ported from:

https://github.com/xdsopl/LDPC

However, it's still not capable of satellite bitrates.

Ron

On 1/31/19 10:33, Maria Jesus Cañavate Sanchez wrote:
> Hi there!
>
> My name is Maria and I would like to make a question regarding the
> kind of PC characteristics which would be required to be able to
> process the signal in real-time (on the PC) when using the maximum
> bandwidth available on the USRP X-series.
>
> The scenario would be the following one: we would like to use GNU
> radio to send and receive DVB-S2 signals. Hence, the PC will do all
> the processing to check the BER, constellation, EVM, etc. Do you think
> it is possible to use a PC (with SSD drive and some suggested
> requirements) which could do the processing in real time or the only
> way to achieve that bandwidth in real time would be using the FPGA of
> the USRP? If the second case, then I guess we will do the processing
> off-line =)
>
> Thank you very much in advance!
>
> Best regards,
>
> Maria Jesus
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Re: [Discuss-gnuradio] AM modulated signal using USRP2

Here's a flow graph. It's set up for an Ettus B2x0, so you'll have to change the UHD sink parameters.

Ron

On 1/31/19 12:01, Afaq Ahmed wrote:
Hello fellows,
I want to create an AM Modulator using USRP2. The setup is such that I want to use one USRP2 as AM Modulator (Transmitter) and another USRP2 to be the AM Demodulator (Receiver). Can you please point in the right direction ? May be some suggestions on how I can achieve this would be very nice?

OS: Xubuntu 18.04 LTS
PC: RAM 4 GB, Core i3
USRP2 with XCVR2450 daughterboard

Thanks a lot
BR
Afaq

_______________________________________________  Discuss-gnuradio mailing list  Discuss-gnuradio@gnu.org  https://lists.gnu.org/mailman/listinfo/discuss-gnuradio  

[Discuss-gnuradio] AM modulated signal using USRP2

Hello fellows,
I want to create an AM Modulator using USRP2. The setup is such that I want to use one USRP2 as AM Modulator (Transmitter) and another USRP2 to be the AM Demodulator (Receiver). Can you please point in the right direction ? May be some suggestions on how I can achieve this would be very nice?

OS: Xubuntu 18.04 LTS
PC: RAM 4 GB, Core i3
USRP2 with XCVR2450 daughterboard

Thanks a lot
BR
Afaq

Re: [Discuss-gnuradio] PC requirements for DVB-S2 processing at a high bandwidth

The processing requirement for DVB-S2 are significant, especially the
receiver. Since you're using an X-series USRP, I'll guess you're
interested in satellite downlinks which can be 30 to 50 Msyms/s.

Basically, the requirement would be the most powerful system you can
afford. Something with an Intel i9 or Xeon Gold/Platinum series processor.

Even then, real-time processing for the receiver will be limited unless
you use an FPGA or GPU for the LDPC decoding.

The good news is that I've ported an SIMD optimized LDPC decoder to GNU
Radio.

https://github.com/drmpeg/gr-dvbs2rx

Which is ported from:

https://github.com/xdsopl/LDPC

However, it's still not capable of satellite bitrates.

Ron

On 1/31/19 10:33, Maria Jesus Cañavate Sanchez wrote:
> Hi there!
>
> My name is Maria and I would like to make a question regarding the
> kind of PC characteristics which would be required to be able to
> process the signal in real-time (on the PC) when using the maximum
> bandwidth available on the USRP X-series.
>
> The scenario would be the following one: we would like to use GNU
> radio to send and receive DVB-S2 signals. Hence, the PC will do all
> the processing to check the BER, constellation, EVM, etc. Do you think
> it is possible to use a PC (with SSD drive and some suggested
> requirements) which could do the processing in real time or the only
> way to achieve that bandwidth in real time would be using the FPGA of
> the USRP? If the second case, then I guess we will do the processing
> off-line =)
>
> Thank you very much in advance!
>
> Best regards,
>
> Maria Jesus
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

[Discuss-gnuradio] PC requirements for DVB-S2 processing at a high bandwidth

Hi there!

My name is Maria and I would like to make a question regarding the kind
of PC characteristics which would be required to be able to process the
signal in real-time (on the PC) when using the maximum bandwidth
available on the USRP X-series.

The scenario would be the following one: we would like to use GNU radio
to send and receive DVB-S2 signals. Hence, the PC will do all the
processing to check the BER, constellation, EVM, etc. Do you think it is
possible to use a PC (with SSD drive and some suggested requirements)
which could do the processing in real time or the only way to achieve
that bandwidth in real time would be using the FPGA of the USRP? If the
second case, then I guess we will do the processing off-line =)

Thank you very much in advance!

Best regards,

Maria Jesus

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

[Discuss-gnuradio] OFDM TX original example - output broken

Hey All!

I'm fighting a problem with the original GNU Radio OFDM TX example from
https://github.com/gnuradio/gnuradio/blob/master/gr-digital/examples/ofdm/tx_ofdm.grc

Nothing is changed, except adding two File Sinks writing the data to two
text files.
One File Sink is added at the random source and one at the OFDM Receiver
output (parallel to Tag Debug).

Letting it run for a short while, gives me two output files: send.txt
and received.txt
Then, I'm comparing the outputs in hex:
hexdump -C send.txt > send.txt.hex
hexdump -C received.txt > received.txt.hex
meld send.txt.hex received.txt.hex

(meld is a nicer diff tool)

Every time I do this, the received file is broken at some point. Six
lines in hexdump (i.e. 6*16=96 bytes) are missing.
It occurs at random places, sometimes multiple times, and as the pattern
is repeating but not always broken at the same point, you can see that
it is not a special magic string that is causing it.
My expectation is an error-free transmission.

Can someone explain this behaviour? Am I missing some basic aspect?
I have noticed, that the packet length is 96bytes.

Sebastian

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

[Discuss-gnuradio] Does anyone use the Sphinx (Python) Manual?

Hey All,

We are attempting to migrate the useful Sphinx documentation into Doxygen so there is less redundant documentation, and one less thing to deal with in 3.8.  If you are someone who uses or has used the Sphinx manual, we would appreciate feedback about what parts of it you use.  Hypothetically, if it disappeared tomorrow, would you notice/care?  If you don't want to reply on the mailing list feel free to email me directly, I appreciate any feedback!

Personally, in the past I have used it for:

1) Seeing docs of in-tree Python blocks, nearly all of which are hier blocks.  Although I usually just use the documentation tab within GRC.

2) Looking up the Python version of a function, like PMT/tags/msg related stuff.  That being said, more often I just pull up the Usage Manual page and jump to the example Python code. 

-Marc

[Discuss-gnuradio] correlation estimator reliability problem

Hi All
did someone make the test_corr_est.grc example work properly recently ?
i tried the 3.7.13 gnuradio version on linux, macos and windows
in all versions the output of the correlation estimator block is really a mess
this block put tag even if there is no signal at all, with corr_est = 0

yesterday i managed to transmit a realtime MPEGTS videosignal using the gnuradio example packet_tx ->  packet_rx. i used an analog devices ADALM PLUTO as an emitter and a RTLSDR as a receiver. both antenna where put side by side at a few centimeter distance so the received baseband signal had an amplitude near 0.5

the problem was that the transmission did not work for more than few tens of second because the correlation block added misplaced tags every now and then and put the header/payload demux in a locked state so i got #f and no more packet output !

another problem is that if i set the thershold to 0.9999, 0.99999 or more 9's, the result is not satisfying.
is someone able to explain me how to use correlation estimation block in a reliable way ?
do i need to set the thershold to ABSOLUTE mode ?

thanks
bob

Re: [Discuss-gnuradio] Custom Block ID as variable

Thanks for both your answers! 
The solution proposed by Marcus where a block drops samples until it receive a message  
is definitely worth a try and I think that will solve my problem also in an easier way.

I think that Glens event detection block will come in handy sometime in the future!
Cheers
Erik

Den ons 30 jan. 2019 kl 18:49 skrev Glen I Langston <glen.i.langston@gmail.com>:
The actual GitHub command is

git clone http://GitHub.com/glangsto/gr-nsf

sorry for any confusion.

Glen

> On Jan 30, 2019, at 12:37 PM, Glen I Langston <glen.i.langston@gmail.com> wrote:
>
> Thanks for both the question and the answer! 
>
> I've been puzzling over how to selectively capture data also
> and how to feed info back to gnuradio graphs, based on the detected data.
>
> I will try Marcus's message-to-variable and variable-to-message blocks.
>
> We did create general purpose data-capture blocks for radio astronomy, that identify events
> based on the significance of the input samples compared to the RMS of the
> data stream. The python code uses a circular buffer, and the output, captured, data stream
> has the event centered in the middle of the buffer, so we can look at the intensities
> before and after the _identified event_.    The writing is separated from
> detection, so that not much astronomy info is needed to detect an event.   The
> astronomy info is contained in the _event sink_ block.
>
> A counter-based capture could easily be implemented as well, based on our blocks.
> We use variable tags to send the peak, rms and event time downstream.   This is all
> done in python.   The computers I'm using can only deal with about 1MHz
> bandwidth.  I'm working on a port to C++, to allow increased sample rates.
>
> One note, our graphs did not work properly unless the data stream continuued
> after the event was detected. i.e. our (perhaps simple minded) implementation
> would hang up all data flow unless we provided the output vector continually. 
> So our block repeatedly provides the _captured_ sample output stream,
> until the next event is detected.
>
> Our event capture blocks are obtained with
> git clone http://www.github.com/gr-nsf/
>
> And the "examples" directory has eventdetect.grc and eventwrite.grc
> that use simulated data, and require no source blocks.
>
> Best regards,
>
> Glen
> <eventwrite-simulation.png>
> <eventwrite-screenshot.png>
>
>
>> On Jan 30, 2019, at 11:26 AM, Müller, Marcus (CEL) <mueller@kit.edu> wrote:
>>
>> Hi Erik,
>>
>> I'm not sure I'd do it the way you do; wouldn't something that simply
>> only lets through N samples each time after you send a message or call
>> a function be better? There's nothing "forcing" a block to "forward"
>> input to an output. On the contrary, you can just consume from the
>> input without producing on the output of your block.
>>
>> That makes things quite a bit easier. Write a block that drops all
>> samples, unless it gets a message (via a message port: see [1]), then
>> it passes N samples.
>>
>> How to send that message? Basically, you could write your own block
>> which has a <callback> attribute that gets called when a value changes,
>> and use one of the Qt GUI widgets' IDs as variable in there.
>>
>> Or you can basically use my variable to message source [2]. I haven't
>> tested it in ages, and I wrote it as a debugging tool, because I don't
>> consider it architecturally wise in the long run¹, but it might just be
>> useful for this very specific use case.
>>
>> [1]
>> https://wiki.gnuradio.org/index.php/Guided_Tutorial_Programming_Topics
>> [2]
>> https://github.com/marcusmueller/gr-msgtools/blob/master/python/variable_to_msg.py
>> ¹ The future is bright and RPC-y; I'd love GRC to migrate from sharing
>> state between blocks via random Python objects to communicating via
>> messages in general, but we're clearly not there yet.
>>
>> On Wed, 2019-01-30 at 17:06 +0100, Erik von Keyserlingk wrote:
>>> Hi,
>>> I am developing a program with GRC where I want to take N samples. (The hardware is a HackRF-one). I want to take N samples because I want to measure at certain points with a H-field probe.
>>>
>>> The way I have thought to solve it is to develop a custom block, "sampling counter" (in python), to count the number of samples that have passed and after N samples it changes its value from 1 to 0 and a "selector" block is directing other samples to /dev/null. This works with a "check box" where a user can set/unset and change where the stream goes, either into a file or to /dev/null.  See attached flowgraph.png.
>>>
>>> TLDR:
>>> Q: How to implement the ID of a custom block so that it can be used as a variable as from a checkbox, slider etc. Both in python an xml, that is what is needed to be added in the .xml file and in the .py file to use the ID as a variable?
>>>
>>> _______________________________________________
>>> Discuss-gnuradio mailing list
>>> Discuss-gnuradio@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>

Wednesday, January 30, 2019

Re: [Discuss-gnuradio] How to generate a bit error curve by using QT GUI Bercurve sink

On 1/29/19 3:50 PM, arefin hasib wrote:
> Hello,
> I am working with GNU Radio Companion 3.7.11 .I would like to generate a
> bit error curve by using QT GUI Bercurve sink.So I have been using
> Random source,Qpsk Modulator ,sample up,Root Raised Cosine filter ,noise
> source With (1.0 / math.sqrt(bits_per_symbol * 10**(float(EbN0) / 10))
> this para meter,sample down, Qpsk demodulate,Error rate and  QT GUI
> Bercurve sink .

See the documentation for

BER Curve Gen

It was designed to be used with the QT GUI Bercurve sink.

Also, see the FEC examples in

./share/gnuradio/examples/fec

of your gnuradio distribution. There's an example on how to use BER
Curve Gen and QT GUI Bercurve sink blocks.

And the BER block you're currently using has been depreciated - which
probably means there's something wrong with it - and it may disappear in
the next release.

-- Cinaed

>
> I am getting perfect Bit Error rate however when I am trying to generate
> a bit error curve for 0 db,15 db,10db,20,db,22db like this Unfortunately
> QT GUI Bercurve sink is not working .
> Could you please have a look about my problem that will be great .For
> better explanation here I am providing my systems Screen shorts and Top
> Block.
> Thanks in advance.
> Regards,
> Arefin 
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Re: [Discuss-gnuradio] Custom Block ID as variable

The actual GitHub command is

git clone http://GitHub.com/glangsto/gr-nsf

sorry for any confusion.

Glen

> On Jan 30, 2019, at 12:37 PM, Glen I Langston <glen.i.langston@gmail.com> wrote:
>
> Thanks for both the question and the answer!
>
> I've been puzzling over how to selectively capture data also
> and how to feed info back to gnuradio graphs, based on the detected data.
>
> I will try Marcus's message-to-variable and variable-to-message blocks.
>
> We did create general purpose data-capture blocks for radio astronomy, that identify events
> based on the significance of the input samples compared to the RMS of the
> data stream. The python code uses a circular buffer, and the output, captured, data stream
> has the event centered in the middle of the buffer, so we can look at the intensities
> before and after the _identified event_. The writing is separated from
> detection, so that not much astronomy info is needed to detect an event. The
> astronomy info is contained in the _event sink_ block.
>
> A counter-based capture could easily be implemented as well, based on our blocks.
> We use variable tags to send the peak, rms and event time downstream. This is all
> done in python. The computers I'm using can only deal with about 1MHz
> bandwidth. I'm working on a port to C++, to allow increased sample rates.
>
> One note, our graphs did not work properly unless the data stream continuued
> after the event was detected. i.e. our (perhaps simple minded) implementation
> would hang up all data flow unless we provided the output vector continually.
> So our block repeatedly provides the _captured_ sample output stream,
> until the next event is detected.
>
> Our event capture blocks are obtained with
> git clone http://www.github.com/gr-nsf/
>
> And the "examples" directory has eventdetect.grc and eventwrite.grc
> that use simulated data, and require no source blocks.
>
> Best regards,
>
> Glen
> <eventwrite-simulation.png>
> <eventwrite-screenshot.png>
>
>
>> On Jan 30, 2019, at 11:26 AM, Müller, Marcus (CEL) <mueller@kit.edu> wrote:
>>
>> Hi Erik,
>>
>> I'm not sure I'd do it the way you do; wouldn't something that simply
>> only lets through N samples each time after you send a message or call
>> a function be better? There's nothing "forcing" a block to "forward"
>> input to an output. On the contrary, you can just consume from the
>> input without producing on the output of your block.
>>
>> That makes things quite a bit easier. Write a block that drops all
>> samples, unless it gets a message (via a message port: see [1]), then
>> it passes N samples.
>>
>> How to send that message? Basically, you could write your own block
>> which has a <callback> attribute that gets called when a value changes,
>> and use one of the Qt GUI widgets' IDs as variable in there.
>>
>> Or you can basically use my variable to message source [2]. I haven't
>> tested it in ages, and I wrote it as a debugging tool, because I don't
>> consider it architecturally wise in the long run¹, but it might just be
>> useful for this very specific use case.
>>
>> [1]
>> https://wiki.gnuradio.org/index.php/Guided_Tutorial_Programming_Topics
>> [2]
>> https://github.com/marcusmueller/gr-msgtools/blob/master/python/variable_to_msg.py
>> ¹ The future is bright and RPC-y; I'd love GRC to migrate from sharing
>> state between blocks via random Python objects to communicating via
>> messages in general, but we're clearly not there yet.
>>
>> On Wed, 2019-01-30 at 17:06 +0100, Erik von Keyserlingk wrote:
>>> Hi,
>>> I am developing a program with GRC where I want to take N samples. (The hardware is a HackRF-one). I want to take N samples because I want to measure at certain points with a H-field probe.
>>>
>>> The way I have thought to solve it is to develop a custom block, "sampling counter" (in python), to count the number of samples that have passed and after N samples it changes its value from 1 to 0 and a "selector" block is directing other samples to /dev/null. This works with a "check box" where a user can set/unset and change where the stream goes, either into a file or to /dev/null. See attached flowgraph.png.
>>>
>>> TLDR:
>>> Q: How to implement the ID of a custom block so that it can be used as a variable as from a checkbox, slider etc. Both in python an xml, that is what is needed to be added in the .xml file and in the .py file to use the ID as a variable?
>>>
>>> _______________________________________________
>>> Discuss-gnuradio mailing list
>>> Discuss-gnuradio@gnu.org
>>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>> _______________________________________________
>> Discuss-gnuradio mailing list
>> Discuss-gnuradio@gnu.org
>> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
>


_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Re: [Discuss-gnuradio] Custom Block ID as variable

Thanks for both the question and the answer!  

I've been puzzling over how to selectively capture data also
and how to feed info back to gnuradio graphs, based on the detected data.

I will try Marcus's message-to-variable and variable-to-message blocks.

We did create general purpose data-capture blocks for radio astronomy, that identify events
based on the significance of the input samples compared to the RMS of the
data stream. The python code uses a circular buffer, and the output, captured, data stream 
has the event centered in the middle of the buffer, so we can look at the intensities 
before and after the _identified event_.    The writing is separated from 
detection, so that not much astronomy info is needed to detect an event.   The
astronomy info is contained in the _event sink_ block.

A counter-based capture could easily be implemented as well, based on our blocks.
We use variable tags to send the peak, rms and event time downstream.   This is all 
done in python.   The computers I'm using can only deal with about 1MHz
bandwidth.  I'm working on a port to C++, to allow increased sample rates.

One note, our graphs did not work properly unless the data stream continuued
after the event was detected. i.e. our (perhaps simple minded) implementation 
would hang up all data flow unless we provided the output vector continually.  
So our block repeatedly provides the _captured_ sample output stream, 
until the next event is detected.

Our event capture blocks are obtained with

And the "examples" directory has eventdetect.grc and eventwrite.grc 
that use simulated data, and require no source blocks.

Best regards,

Glen


On Jan 30, 2019, at 11:26 AM, Müller, Marcus (CEL) <mueller@kit.edu> wrote:

Hi Erik,

I'm not sure I'd do it the way you do; wouldn't something that simply
only lets through N samples each time after you send a message or call
a function be better? There's nothing "forcing" a block to "forward"
input to an output. On the contrary, you can just consume from the
input without producing on the output of your block.

That makes things quite a bit easier. Write a block that drops all
samples, unless it gets a message (via a message port: see [1]), then
it passes N samples.

How to send that message? Basically, you could write your own block
which has a <callback> attribute that gets called when a value changes,
and use one of the Qt GUI widgets' IDs as variable in there. 

Or you can basically use my variable to message source [2]. I haven't
tested it in ages, and I wrote it as a debugging tool, because I don't
consider it architecturally wise in the long run¹, but it might just be
useful for this very specific use case.

[1] 
https://wiki.gnuradio.org/index.php/Guided_Tutorial_Programming_Topics
[2] 
https://github.com/marcusmueller/gr-msgtools/blob/master/python/variable_to_msg.py
¹ The future is bright and RPC-y; I'd love GRC to migrate from sharing
state between blocks via random Python objects to communicating via
messages in general, but we're clearly not there yet.

On Wed, 2019-01-30 at 17:06 +0100, Erik von Keyserlingk wrote:
Hi,
I am developing a program with GRC where I want to take N samples. (The hardware is a HackRF-one). I want to take N samples because I want to measure at certain points with a H-field probe.

The way I have thought to solve it is to develop a custom block, "sampling counter" (in python), to count the number of samples that have passed and after N samples it changes its value from 1 to 0 and a "selector" block is directing other samples to /dev/null. This works with a "check box" where a user can set/unset and change where the stream goes, either into a file or to /dev/null.  See attached flowgraph.png.

TLDR:
Q: How to implement the ID of a custom block so that it can be used as a variable as from a checkbox, slider etc. Both in python an xml, that is what is needed to be added in the .xml file and in the .py file to use the ID as a variable?

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Re: [Discuss-gnuradio] Custom Block ID as variable

Hi Erik,

I'm not sure I'd do it the way you do; wouldn't something that simply
only lets through N samples each time after you send a message or call
a function be better? There's nothing "forcing" a block to "forward"
input to an output. On the contrary, you can just consume from the
input without producing on the output of your block.

That makes things quite a bit easier. Write a block that drops all
samples, unless it gets a message (via a message port: see [1]), then
it passes N samples.

How to send that message? Basically, you could write your own block
which has a <callback> attribute that gets called when a value changes,
and use one of the Qt GUI widgets' IDs as variable in there.

Or you can basically use my variable to message source [2]. I haven't
tested it in ages, and I wrote it as a debugging tool, because I don't
consider it architecturally wise in the long run¹, but it might just be
useful for this very specific use case.

[1]
https://wiki.gnuradio.org/index.php/Guided_Tutorial_Programming_Topics
[2]
https://github.com/marcusmueller/gr-msgtools/blob/master/python/variable_to_msg.py
¹ The future is bright and RPC-y; I'd love GRC to migrate from sharing
state between blocks via random Python objects to communicating via
messages in general, but we're clearly not there yet.

On Wed, 2019-01-30 at 17:06 +0100, Erik von Keyserlingk wrote:
> Hi,
> I am developing a program with GRC where I want to take N samples. (The hardware is a HackRF-one). I want to take N samples because I want to measure at certain points with a H-field probe.
>
> The way I have thought to solve it is to develop a custom block, "sampling counter" (in python), to count the number of samples that have passed and after N samples it changes its value from 1 to 0 and a "selector" block is directing other samples to /dev/null. This works with a "check box" where a user can set/unset and change where the stream goes, either into a file or to /dev/null. See attached flowgraph.png.
>
> TLDR:
> Q: How to implement the ID of a custom block so that it can be used as a variable as from a checkbox, slider etc. Both in python an xml, that is what is needed to be added in the .xml file and in the .py file to use the ID as a variable?
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

[Discuss-gnuradio] Custom Block ID as variable

Hi,
I am developing a program with GRC where I want to take N samples. (The hardware is a HackRF-one). I want to take N samples because I want to measure at certain points with a H-field probe.

The way I have thought to solve it is to develop a custom block, "sampling counter" (in python), to count the number of samples that have passed and after N samples it changes its value from 1 to 0 and a "selector" block is directing other samples to /dev/null. This works with a "check box" where a user can set/unset and change where the stream goes, either into a file or to /dev/null.  See attached flowgraph.png.

TLDR:
Q: How to implement the ID of a custom block so that it can be used as a variable as from a checkbox, slider etc. Both in python an xml, that is what is needed to be added in the .xml file and in the .py file to use the ID as a variable?

[Discuss-gnuradio] Workshop on Open Radio Platforms at Crowncom

Hi all,

the deadline for the open radio platforms workshop at Crowncom was
extended to 12 February.

Please consider submitting, if you are working on (or using) cool
hardware or software prototypes.

http://crowncom.org/workshop-open-radio-platforms/

Best,
Bastian

Tuesday, January 29, 2019

[Discuss-gnuradio] How to generate a bit error curve by using QT GUI Bercurve sink

#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Top Block
# Generated: Wed Jan 30 00:37:24 2019
##################################################

from distutils.version import StrictVersion

if __name__ == '__main__':
import ctypes
import sys
if sys.platform.startswith('linux'):
try:
x11 = ctypes.cdll.LoadLibrary('libX11.so')
x11.XInitThreads()
except:
print "Warning: failed to XInitThreads()"

from PyQt5 import Qt
from PyQt5 import Qt, QtCore
from PyQt5.QtCore import QObject, pyqtSlot
from PyQt5import Qt
from gnuradio import analog
from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio import filter
from gnuradio import gr
from gnuradio import qtgui
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from grc_gnuradio import blks2 as grc_blks2
from optparse import OptionParser
import MyCustomBlock
import math
import numpy
import sip
import sys
from gnuradio import qtgui


class top_block(gr.top_block, Qt.QWidget):

def __init__(self):
gr.top_block.__init__(self, "Top Block")
Qt.QWidget.__init__(self)
self.setWindowTitle("Top Block")
qtgui.util.check_set_qss()
try:
self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
except:
pass
self.top_scroll_layout = Qt.QVBoxLayout()
self.setLayout(self.top_scroll_layout)
self.top_scroll = Qt.QScrollArea()
self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
self.top_scroll_layout.addWidget(self.top_scroll)
self.top_scroll.setWidgetResizable(True)
self.top_widget = Qt.QWidget()
self.top_scroll.setWidget(self.top_widget)
self.top_layout = Qt.QVBoxLayout(self.top_widget)
self.top_grid_layout = Qt.QGridLayout()
self.top_layout.addLayout(self.top_grid_layout)

self.settings = Qt.QSettings("GNU Radio", "top_block")

if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"):
self.restoreGeometry(self.settings.value("geometry").toByteArray())
else:
self.restoreGeometry(self.settings.value("geometry", type=QtCore.QByteArray))

##################################################
# Variables
##################################################
self.sps = sps = 8
self.nfilts = nfilts = 64
self.samp_rate = samp_rate = 32000
self.excess_bw = excess_bw = 0.35
self.bits_per_symbol = bits_per_symbol = 2
self.EbN0 = EbN0 = 16
self.Delay = Delay = nfilts/sps

##################################################
# Blocks
##################################################
self._EbN0_options = (10, 14, 16, 18, 30, )
self._EbN0_labels = (str(self._EbN0_options[0]), str(self._EbN0_options[1]), str(self._EbN0_options[2]), str(self._EbN0_options[3]), str(self._EbN0_options[4]), )
self._EbN0_tool_bar = Qt.QToolBar(self)
self._EbN0_tool_bar.addWidget(Qt.QLabel('EbN0 (dB)'+": "))
self._EbN0_combo_box = Qt.QComboBox()
self._EbN0_tool_bar.addWidget(self._EbN0_combo_box)
for label in self._EbN0_labels: self._EbN0_combo_box.addItem(label)
self._EbN0_callback = lambda i: Qt.QMetaObject.invokeMethod(self._EbN0_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._EbN0_options.index(i)))
self._EbN0_callback(self.EbN0)
self._EbN0_combo_box.currentIndexChanged.connect(
lambda i: self.set_EbN0(self._EbN0_options[i]))
self.top_layout.addWidget(self._EbN0_tool_bar)
self.root_raised_cosine_filter_1 = filter.fir_filter_ccf(1, firdes.root_raised_cosine(
1, sps, 1.0, excess_bw, nfilts))
self.root_raised_cosine_filter_0 = filter.fir_filter_ccf(1, firdes.root_raised_cosine(
1, sps, 1.0, excess_bw, nfilts))
self.qtgui_number_sink_0 = qtgui.number_sink(
gr.sizeof_float,
0,
qtgui.NUM_GRAPH_HORIZ,
1
)
self.qtgui_number_sink_0.set_update_time(0.10)
self.qtgui_number_sink_0.set_title("")

labels = ['', '', '', '', '',
'', '', '', '', '']
units = ['', '', '', '', '',
'', '', '', '', '']
colors = [("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"),
("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black")]
factor = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
for i in xrange(1):
self.qtgui_number_sink_0.set_min(i, -1)
self.qtgui_number_sink_0.set_max(i, 1)
self.qtgui_number_sink_0.set_color(i, colors[i][0], colors[i][1])
if len(labels[i]) == 0:
self.qtgui_number_sink_0.set_label(i, "Data {0}".format(i))
else:
self.qtgui_number_sink_0.set_label(i, labels[i])
self.qtgui_number_sink_0.set_unit(i, units[i])
self.qtgui_number_sink_0.set_factor(i, factor[i])

self.qtgui_number_sink_0.enable_autoscale(False)
self._qtgui_number_sink_0_win = sip.wrapinstance(self.qtgui_number_sink_0.pyqwidget(), Qt.QWidget)
self.top_layout.addWidget(self._qtgui_number_sink_0_win)
self.qtgui_bercurve_sink_0 = qtgui.ber_sink_b(
numpy.arange(0.0, 4.0, .5), #range of esnos
1, #number of curves
100, #ensure at least
-7.0, #cutoff
[], #indiv. curve names
)
self.qtgui_bercurve_sink_0.set_update_time(0.10)
self.qtgui_bercurve_sink_0.set_y_axis(-10, 0)
self.qtgui_bercurve_sink_0.set_x_axis(numpy.arange(0.0, 4.0, .5)[0], numpy.arange(0.0, 4.0, .5)[-1])

labels = ['', '', '', '', '',
'', '', '', '', '']
widths = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
colors = ["blue", "red", "green", "black", "cyan",
"magenta", "yellow", "dark red", "dark green", "blue"]
styles = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
markers = [0, 0, 0, 0, 0,
0, 0, 0, 0, 0]
alphas = [.35, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0]
for i in xrange(1):
if len(labels[i]) == 0:
self.qtgui_bercurve_sink_0.set_line_label(i, "Data {0}".format(i))
else:
self.qtgui_bercurve_sink_0.set_line_label(i, labels[i])
self.qtgui_bercurve_sink_0.set_line_width(i, widths[i])
self.qtgui_bercurve_sink_0.set_line_color(i, colors[i])
self.qtgui_bercurve_sink_0.set_line_style(i, styles[i])
self.qtgui_bercurve_sink_0.set_line_marker(i, markers[i])
self.qtgui_bercurve_sink_0.set_line_alpha(i, alphas[i])

self._qtgui_bercurve_sink_0_win = sip.wrapinstance(self.qtgui_bercurve_sink_0.pyqwidget(), Qt.QWidget)
self.top_layout.addWidget(self._qtgui_bercurve_sink_0_win)
self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char*1, samp_rate,True)
self.blocks_delay_0 = blocks.delay(gr.sizeof_char*1, Delay)
self.blocks_add_xx_0 = blocks.add_vcc(1)
self.blks2_error_rate_0 = grc_blks2.error_rate(
type='BER',
win_size=1000000,
bits_per_symbol=2,
)
self.analog_random_source_x_0 = blocks.vector_source_b(map(int, numpy.random.randint(0, 4, 1000000)), True)
self.analog_noise_source_x_0 = analog.noise_source_c(analog.GR_GAUSSIAN, 1.0 / math.sqrt(bits_per_symbol * 10**(float(EbN0) / 10)), 0)
self.MyCustomBlock_Sample_Down_0 = MyCustomBlock.Sample_Down(sps)
self.MyCustomBlock_SampleUp2_0 = MyCustomBlock.SampleUp2(sps)
self.MyCustomBlock_QPSK_Modulator_1 = MyCustomBlock.QPSK_Modulator(False)
self.MyCustomBlock_QPSK_Demodulator_0 = MyCustomBlock.QPSK_Demodulator(False)

##################################################
# Connections
##################################################
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.blks2_error_rate_0, 1))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 1))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 11))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 13))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 15))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 3))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 5))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 7))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 9))
self.connect((self.MyCustomBlock_QPSK_Modulator_1, 0), (self.MyCustomBlock_SampleUp2_0, 0))
self.connect((self.MyCustomBlock_SampleUp2_0, 0), (self.root_raised_cosine_filter_0, 0))
self.connect((self.MyCustomBlock_Sample_Down_0, 0), (self.MyCustomBlock_QPSK_Demodulator_0, 0))
self.connect((self.analog_noise_source_x_0, 0), (self.blocks_add_xx_0, 1))
self.connect((self.analog_random_source_x_0, 0), (self.blocks_delay_0, 0))
self.connect((self.analog_random_source_x_0, 0), (self.blocks_throttle_0, 0))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 0))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 10))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 12))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 14))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 2))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 4))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 6))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 8))
self.connect((self.blks2_error_rate_0, 0), (self.qtgui_number_sink_0, 0))
self.connect((self.blocks_add_xx_0, 0), (self.root_raised_cosine_filter_1, 0))
self.connect((self.blocks_delay_0, 0), (self.blks2_error_rate_0, 0))
self.connect((self.blocks_throttle_0, 0), (self.MyCustomBlock_QPSK_Modulator_1, 0))
self.connect((self.root_raised_cosine_filter_0, 0), (self.blocks_add_xx_0, 0))
self.connect((self.root_raised_cosine_filter_1, 0), (self.MyCustomBlock_Sample_Down_0, 0))

def closeEvent(self, event):
self.settings = Qt.QSettings("GNU Radio", "top_block")
self.settings.setValue("geometry", self.saveGeometry())
event.accept()

def get_sps(self):
return self.sps

def set_sps(self, sps):
self.sps = sps
self.set_Delay(self.nfilts/self.sps)
self.root_raised_cosine_filter_1.set_taps(firdes.root_raised_cosine(1, self.sps, 1.0, self.excess_bw, self.nfilts))
self.root_raised_cosine_filter_0.set_taps(firdes.root_raised_cosine(1, self.sps, 1.0, self.excess_bw, self.nfilts))

def get_nfilts(self):
return self.nfilts

def set_nfilts(self, nfilts):
self.nfilts = nfilts
self.set_Delay(self.nfilts/self.sps)
self.root_raised_cosine_filter_1.set_taps(firdes.root_raised_cosine(1, self.sps, 1.0, self.excess_bw, self.nfilts))
self.root_raised_cosine_filter_0.set_taps(firdes.root_raised_cosine(1, self.sps, 1.0, self.excess_bw, self.nfilts))

def get_samp_rate(self):
return self.samp_rate

def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.blocks_throttle_0.set_sample_rate(self.samp_rate)

def get_excess_bw(self):
return self.excess_bw

def set_excess_bw(self, excess_bw):
self.excess_bw = excess_bw
self.root_raised_cosine_filter_1.set_taps(firdes.root_raised_cosine(1, self.sps, 1.0, self.excess_bw, self.nfilts))
self.root_raised_cosine_filter_0.set_taps(firdes.root_raised_cosine(1, self.sps, 1.0, self.excess_bw, self.nfilts))

def get_bits_per_symbol(self):
return self.bits_per_symbol

def set_bits_per_symbol(self, bits_per_symbol):
self.bits_per_symbol = bits_per_symbol
self.analog_noise_source_x_0.set_amplitude(1.0 / math.sqrt(self.bits_per_symbol * 10**(float(self.EbN0) / 10)))

def get_EbN0(self):
return self.EbN0

def set_EbN0(self, EbN0):
self.EbN0 = EbN0
self._EbN0_callback(self.EbN0)
self.analog_noise_source_x_0.set_amplitude(1.0 / math.sqrt(self.bits_per_symbol * 10**(float(self.EbN0) / 10)))

def get_Delay(self):
return self.Delay

def set_Delay(self, Delay):
self.Delay = Delay
self.blocks_delay_0.set_dly(self.Delay)


def main(top_block_cls=top_block, options=None):

if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"):
style = gr.prefs().get_string('qtgui', 'style', 'raster')
Qt.QApplication.setGraphicsSystem(style)
qapp = Qt.QApplication(sys.argv)

tb = top_block_cls()
tb.start()
tb.show()

def quitting():
tb.stop()
tb.wait()
qapp.aboutToQuit.connect(quitting)
qapp.exec_()


if __name__ == '__main__':
main()
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
##################################################
# GNU Radio Python Flow Graph
# Title: Top Block
# Generated: Wed Jan 30 00:37:24 2019
##################################################

from distutils.version import StrictVersion

if __name__ == '__main__':
import ctypes
import sys
if sys.platform.startswith('linux'):
try:
x11 = ctypes.cdll.LoadLibrary('libX11.so')
x11.XInitThreads()
except:
print "Warning: failed to XInitThreads()"

from PyQt5 import Qt
from PyQt5 import Qt, QtCore
from PyQt5.QtCore import QObject, pyqtSlot
from PyQt5 import Qt
from gnuradio import analog
from gnuradio import blocks
from gnuradio import eng_notation
from gnuradio import filter
from gnuradio import gr
from gnuradio import qtgui
from gnuradio.eng_option import eng_option
from gnuradio.filter import firdes
from grc_gnuradio import blks2 as grc_blks2
from optparse import OptionParser
import MyCustomBlock
import math
import numpy
import sip
import sys
from gnuradio import qtgui


class top_block(gr.top_block, Qt.QWidget):

def __init__(self):
gr.top_block.__init__(self, "Top Block")
Qt.QWidget.__init__(self)
self.setWindowTitle("Top Block")
qtgui.util.check_set_qss()
try:
self.setWindowIcon(Qt.QIcon.fromTheme('gnuradio-grc'))
except:
pass
self.top_scroll_layout = Qt.QVBoxLayout()
self.setLayout(self.top_scroll_layout)
self.top_scroll = Qt.QScrollArea()
self.top_scroll.setFrameStyle(Qt.QFrame.NoFrame)
self.top_scroll_layout.addWidget(self.top_scroll)
self.top_scroll.setWidgetResizable(True)
self.top_widget = Qt.QWidget()
self.top_scroll.setWidget(self.top_widget)
self.top_layout = Qt.QVBoxLayout(self.top_widget)
self.top_grid_layout = Qt.QGridLayout()
self.top_layout.addLayout(self.top_grid_layout)

self.settings = Qt.QSettings("GNU Radio", "top_block")

if StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"):
self.restoreGeometry(self.settings.value("geometry").toByteArray())
else:
self.restoreGeometry(self.settings.value("geometry", type=QtCore.QByteArray))

##################################################
# Variables
##################################################
self.sps = sps = 8
self.nfilts = nfilts = 64
self.samp_rate = samp_rate = 32000
self.excess_bw = excess_bw = 0.35
self.bits_per_symbol = bits_per_symbol = 2
self.EbN0 = EbN0 = 16
self.Delay = Delay = nfilts/sps

##################################################
# Blocks
##################################################
self._EbN0_options = (10, 14, 16, 18, 30, )
self._EbN0_labels = (str(self._EbN0_options[0]), str(self._EbN0_options[1]), str(self._EbN0_options[2]), str(self._EbN0_options[3]), str(self._EbN0_options[4]), )
self._EbN0_tool_bar = Qt.QToolBar(self)
self._EbN0_tool_bar.addWidget(Qt.QLabel('EbN0 (dB)'+": "))
self._EbN0_combo_box = Qt.QComboBox()
self._EbN0_tool_bar.addWidget(self._EbN0_combo_box)
for label in self._EbN0_labels: self._EbN0_combo_box.addItem(label)
self._EbN0_callback = lambda i: Qt.QMetaObject.invokeMethod(self._EbN0_combo_box, "setCurrentIndex", Qt.Q_ARG("int", self._EbN0_options.index(i)))
self._EbN0_callback(self.EbN0)
self._EbN0_combo_box.currentIndexChanged.connect(
lambda i: self.set_EbN0(self._EbN0_options[i]))
self.top_layout.addWidget(self._EbN0_tool_bar)
self.root_raised_cosine_filter_1 = filter.fir_filter_ccf(1, firdes.root_raised_cosine(
1, sps, 1.0, excess_bw, nfilts))
self.root_raised_cosine_filter_0 = filter.fir_filter_ccf(1, firdes.root_raised_cosine(
1, sps, 1.0, excess_bw, nfilts))
self.qtgui_number_sink_0 = qtgui.number_sink(
gr.sizeof_float,
0,
qtgui.NUM_GRAPH_HORIZ,
1
)
self.qtgui_number_sink_0.set_update_time(0.10)
self.qtgui_number_sink_0.set_title("")

labels = ['', '', '', '', '',
'', '', '', '', '']
units = ['', '', '', '', '',
'', '', '', '', '']
colors = [("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"),
("black", "black"), ("black", "black"), ("black", "black"), ("black", "black"), ("black", "black")]
factor = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
for i in xrange(1):
self.qtgui_number_sink_0.set_min(i, -1)
self.qtgui_number_sink_0.set_max(i, 1)
self.qtgui_number_sink_0.set_color(i, colors[i][0], colors[i][1])
if len(labels[i]) == 0:
self.qtgui_number_sink_0.set_label(i, "Data {0}".format(i))
else:
self.qtgui_number_sink_0.set_label(i, labels[i])
self.qtgui_number_sink_0.set_unit(i, units[i])
self.qtgui_number_sink_0.set_factor(i, factor[i])

self.qtgui_number_sink_0.enable_autoscale(False)
self._qtgui_number_sink_0_win = sip.wrapinstance(self.qtgui_number_sink_0.pyqwidget(), Qt.QWidget)
self.top_layout.addWidget(self._qtgui_number_sink_0_win)
self.qtgui_bercurve_sink_0 = qtgui.ber_sink_b(
numpy.arange(0.0, 4.0, .5), #range of esnos
1, #number of curves
100, #ensure at least
-7.0, #cutoff
[], #indiv. curve names
)
self.qtgui_bercurve_sink_0.set_update_time(0.10)
self.qtgui_bercurve_sink_0.set_y_axis(-10, 0)
self.qtgui_bercurve_sink_0.set_x_axis(numpy.arange(0.0, 4.0, .5)[0], numpy.arange(0.0, 4.0, .5)[-1])

labels = ['', '', '', '', '',
'', '', '', '', '']
widths = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
colors = ["blue", "red", "green", "black", "cyan",
"magenta", "yellow", "dark red", "dark green", "blue"]
styles = [1, 1, 1, 1, 1,
1, 1, 1, 1, 1]
markers = [0, 0, 0, 0, 0,
0, 0, 0, 0, 0]
alphas = [.35, 1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0, 1.0]
for i in xrange(1):
if len(labels[i]) == 0:
self.qtgui_bercurve_sink_0.set_line_label(i, "Data {0}".format(i))
else:
self.qtgui_bercurve_sink_0.set_line_label(i, labels[i])
self.qtgui_bercurve_sink_0.set_line_width(i, widths[i])
self.qtgui_bercurve_sink_0.set_line_color(i, colors[i])
self.qtgui_bercurve_sink_0.set_line_style(i, styles[i])
self.qtgui_bercurve_sink_0.set_line_marker(i, markers[i])
self.qtgui_bercurve_sink_0.set_line_alpha(i, alphas[i])

self._qtgui_bercurve_sink_0_win = sip.wrapinstance(self.qtgui_bercurve_sink_0.pyqwidget(), Qt.QWidget)
self.top_layout.addWidget(self._qtgui_bercurve_sink_0_win)
self.blocks_throttle_0 = blocks.throttle(gr.sizeof_char*1, samp_rate,True)
self.blocks_delay_0 = blocks.delay(gr.sizeof_char*1, Delay)
self.blocks_add_xx_0 = blocks.add_vcc(1)
self.blks2_error_rate_0 = grc_blks2.error_rate(
type='BER',
win_size=1000000,
bits_per_symbol=2,
)
self.analog_random_source_x_0 = blocks.vector_source_b(map(int, numpy.random.randint(0, 4, 1000000)), True)
self.analog_noise_source_x_0 = analog.noise_source_c(analog.GR_GAUSSIAN, 1.0 / math.sqrt(bits_per_symbol * 10**(float(EbN0) / 10)), 0)
self.MyCustomBlock_Sample_Down_0 = MyCustomBlock.Sample_Down(sps)
self.MyCustomBlock_SampleUp2_0 = MyCustomBlock.SampleUp2(sps)
self.MyCustomBlock_QPSK_Modulator_1 = MyCustomBlock.QPSK_Modulator(False)
self.MyCustomBlock_QPSK_Demodulator_0 = MyCustomBlock.QPSK_Demodulator(False)

##################################################
# Connections
##################################################
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.blks2_error_rate_0, 1))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 1))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 11))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 13))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 15))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 3))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 5))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 7))
self.connect((self.MyCustomBlock_QPSK_Demodulator_0, 0), (self.qtgui_bercurve_sink_0, 9))
self.connect((self.MyCustomBlock_QPSK_Modulator_1, 0), (self.MyCustomBlock_SampleUp2_0, 0))
self.connect((self.MyCustomBlock_SampleUp2_0, 0), (self.root_raised_cosine_filter_0, 0))
self.connect((self.MyCustomBlock_Sample_Down_0, 0), (self.MyCustomBlock_QPSK_Demodulator_0, 0))
self.connect((self.analog_noise_source_x_0, 0), (self.blocks_add_xx_0, 1))
self.connect((self.analog_random_source_x_0, 0), (self.blocks_delay_0, 0))
self.connect((self.analog_random_source_x_0, 0), (self.blocks_throttle_0, 0))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 0))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 10))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 12))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 14))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 2))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 4))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 6))
self.connect((self.analog_random_source_x_0, 0), (self.qtgui_bercurve_sink_0, 8))
self.connect((self.blks2_error_rate_0, 0), (self.qtgui_number_sink_0, 0))
self.connect((self.blocks_add_xx_0, 0), (self.root_raised_cosine_filter_1, 0))
self.connect((self.blocks_delay_0, 0), (self.blks2_error_rate_0, 0))
self.connect((self.blocks_throttle_0, 0), (self.MyCustomBlock_QPSK_Modulator_1, 0))
self.connect((self.root_raised_cosine_filter_0, 0), (self.blocks_add_xx_0, 0))
self.connect((self.root_raised_cosine_filter_1, 0), (self.MyCustomBlock_Sample_Down_0, 0))

def closeEvent(self, event):
self.settings = Qt.QSettings("GNU Radio", "top_block")
self.settings.setValue("geometry", self.saveGeometry())
event.accept()

def get_sps(self):
return self.sps

def set_sps(self, sps):
self.sps = sps
self.set_Delay(self.nfilts/self.sps)
self.root_raised_cosine_filter_1.set_taps(firdes.root_raised_cosine(1, self.sps, 1.0, self.excess_bw, self.nfilts))
self.root_raised_cosine_filter_0.set_taps(firdes.root_raised_cosine(1, self.sps, 1.0, self.excess_bw, self.nfilts))

def get_nfilts(self):
return self.nfilts

def set_nfilts(self, nfilts):
self.nfilts = nfilts
self.set_Delay(self.nfilts/self.sps)
self.root_raised_cosine_filter_1.set_taps(firdes.root_raised_cosine(1, self.sps, 1.0, self.excess_bw, self.nfilts))
self.root_raised_cosine_filter_0.set_taps(firdes.root_raised_cosine(1, self.sps, 1.0, self.excess_bw, self.nfilts))

def get_samp_rate(self):
return self.samp_rate

def set_samp_rate(self, samp_rate):
self.samp_rate = samp_rate
self.blocks_throttle_0.set_sample_rate(self.samp_rate)

def get_excess_bw(self):
return self.excess_bw

def set_excess_bw(self, excess_bw):
self.excess_bw = excess_bw
self.root_raised_cosine_filter_1.set_taps(firdes.root_raised_cosine(1, self.sps, 1.0, self.excess_bw, self.nfilts))
self.root_raised_cosine_filter_0.set_taps(firdes.root_raised_cosine(1, self.sps, 1.0, self.excess_bw, self.nfilts))

def get_bits_per_symbol(self):
return self.bits_per_symbol

def set_bits_per_symbol(self, bits_per_symbol):
self.bits_per_symbol = bits_per_symbol
self.analog_noise_source_x_0.set_amplitude(1.0 / math.sqrt(self.bits_per_symbol * 10**(float(self.EbN0) / 10)))

def get_EbN0(self):
return self.EbN0

def set_EbN0(self, EbN0):
self.EbN0 = EbN0
self._EbN0_callback(self.EbN0)
self.analog_noise_source_x_0.set_amplitude(1.0 / math.sqrt(self.bits_per_symbol * 10**(float(self.EbN0) / 10)))

def get_Delay(self):
return self.Delay

def set_Delay(self, Delay):
self.Delay = Delay
self.blocks_delay_0.set_dly(self.Delay)


def main(top_block_cls=top_block, options=None):

if StrictVersion("4.5.0") <= StrictVersion(Qt.qVersion()) < StrictVersion("5.0.0"):
style = gr.prefs().get_string('qtgui', 'style', 'raster')
Qt.QApplication.setGraphicsSystem(style)
qapp = Qt.QApplication(sys.argv)

tb = top_block_cls()
tb.start()
tb.show()

def quitting():
tb.stop()
tb.wait()
qapp.aboutToQuit.connect(quitting)
qapp.exec_()


if __name__ == '__main__':
main()

Hello,
I am working with GNU Radio Companion 3.7.11 .I would like to generate a bit error curve by using QT GUI Bercurve sink.So I have been using Random source,Qpsk Modulator ,sample up,Root Raised Cosine filter ,noise source With (1.0 / math.sqrt(bits_per_symbol * 10**(float(EbN0) / 10)) this para meter,sample down, Qpsk demodulate,Error rate and  QT GUI Bercurve sink .

I am getting perfect Bit Error rate however when I am trying to generate a bit error curve for 0 db,15 db,10db,20,db,22db like this Unfortunately QT GUI Bercurve sink is not working .
Could you please have a look about my problem that will be great .For better explanation here I am providing my systems Screen shorts and Top Block.
Thanks in advance.
Regards,
Arefin 

Re: [Discuss-gnuradio] Moving my antenna

It would be very helpful to know the main frequency of interest.  

Re: [Discuss-gnuradio] Moving my antenna


On 01/29/2019 03:16 PM, Albin Stigö wrote:
Loss will be proportional to the length of coax, type of coax, impedenace match and frequency. Higher frequency, higher loss. For example at 10MHz the loss in in 100m RG58 would be around 3.7dB, at 1000MHz 48dB, a factor 27000 difference.

It's normally best practice to put the receiver/transmitter as close to the antenna as possible.


--Albin

That's quite true, however the higher and more in the clear outdoors you can put it will improve the signal considerably. For coax, you should use a 50 ohm cable, preferably the Times Microwave

types LMR-240 or, better, LMR-400. You can look up the specs on these cables on the Internet and calculate cable loss versus length from the information found there. You will need to adapt the

cable connectors to the small ones on your radio. Commercial adapters are available for all combinations of interface. I suggest terminating either of the cables I recommend in type N male.

Doug, WA2SAY, retired RF Engineer

On Tue, Jan 29, 2019, 21:07 Tarquin <tarquin.roode@gmail.com wrote:

Hi

 

If you want to go “cheap” use coax intended for satellite TV reception. Be carefull about 75ohm, as the Hack RF is a 50 ohm system, you can use RG58U not to costly, don’t expect good performance above 1.2 GHz. Not sure what you want to intercept, if it VHF UHF you will be ok, else you could try RG213 but that ½ inch thich and you will have to adapt.

 

The thinner coax RG179 /178 will be fairly lossy.

 

I suggest personaly start with RG58 its cost effective and maybe an LNA near the antenna

 

Regards

 

Zr1tR

 

From: Discuss-gnuradio [mailto:discuss-gnuradio-bounces+tarquin.roode=gmail.com@gnu.org] On Behalf Of david vanhorn
Sent: Tuesday, January 29, 2019 9:52 PM
To: cliff palmer
Cc: Discuss-gnuradio@gnu.org
Subject: Re: [Discuss-gnuradio] Moving my antenna

 

Coax loss can be a big issue.

Given the low power levels you will suffer less loss on a long run using 75 ohm coax cable which is designed for low loss, even assuming you do nothing about the mismatch at the ends of the run.  All that is good up to about 1ghz where more specialized coax is needed for minimum loss.

 

The antenna is a significant part of the equation and you are well advised to use an antenna suited for the frequency of interest. Broadband antennas like discones have very low gain, and they pull in other strong signals you don't want.

 

On Tue, Jan 29, 2019, 12:40 PM cliff palmer <palmercliff@gmail.com wrote:

I have a HackrfOne with an Ant500 antenna connected to my workstation in my basement (where the internet connection lives).  I need to move the antenna out of the basement to improve reception, so I thought I would use coax to connect the antenna from upstairs to the HackrfOne.

I'm too new to SDR to be confident about just moving the antenna and using a spare length of cable coax.  Please provide some help on selecting, sizing and connecting coax between the HackrfOne and the Ant500.

Thanks

 

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Virus-free. www.avg.com
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


_______________________________________________  Discuss-gnuradio mailing list  Discuss-gnuradio@gnu.org  https://lists.gnu.org/mailman/listinfo/discuss-gnuradio  

Re: [Discuss-gnuradio] Moving my antenna

I bought a bag of bias tees on ebay and use them to power some LNAs hanging out near the antennas. I've got 30-50ft of coax and some bandpass filters between the antenna and my receivers...


On Tue, Jan 29, 2019 at 12:07 PM Tarquin <tarquin.roode@gmail.com> wrote:

Hi

 

If you want to go "cheap" use coax intended for satellite TV reception. Be carefull about 75ohm, as the Hack RF is a 50 ohm system, you can use RG58U not to costly, don't expect good performance above 1.2 GHz. Not sure what you want to intercept, if it VHF UHF you will be ok, else you could try RG213 but that ½ inch thich and you will have to adapt.

 

The thinner coax RG179 /178 will be fairly lossy.

 

I suggest personaly start with RG58 its cost effective and maybe an LNA near the antenna

 

Regards

 

Zr1tR

 

From: Discuss-gnuradio [mailto:discuss-gnuradio-bounces+tarquin.roode=gmail.com@gnu.org] On Behalf Of david vanhorn
Sent: Tuesday, January 29, 2019 9:52 PM
To: cliff palmer
Cc: Discuss-gnuradio@gnu.org
Subject: Re: [Discuss-gnuradio] Moving my antenna

 

Coax loss can be a big issue.

Given the low power levels you will suffer less loss on a long run using 75 ohm coax cable which is designed for low loss, even assuming you do nothing about the mismatch at the ends of the run.  All that is good up to about 1ghz where more specialized coax is needed for minimum loss.

 

The antenna is a significant part of the equation and you are well advised to use an antenna suited for the frequency of interest. Broadband antennas like discones have very low gain, and they pull in other strong signals you don't want.

 

On Tue, Jan 29, 2019, 12:40 PM cliff palmer <palmercliff@gmail.com wrote:

I have a HackrfOne with an Ant500 antenna connected to my workstation in my basement (where the internet connection lives).  I need to move the antenna out of the basement to improve reception, so I thought I would use coax to connect the antenna from upstairs to the HackrfOne.

I'm too new to SDR to be confident about just moving the antenna and using a spare length of cable coax.  Please provide some help on selecting, sizing and connecting coax between the HackrfOne and the Ant500.

Thanks

 

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Virus-free. www.avg.com
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


--
GDB has a 'break' feature; why doesn't it have 'fix' too?