Re: [Discuss-gnuradio] (no subject)

2015-03-12 Thread Marcus Müller
Hi Vishwanatha,

Demodulation of phase-depending modulations requires some kind of
synchronization.

There's more approaches than costas loops to phase synchronization;
however, they're usually very specific to a channel/signal model and
can't be universally applied, or very inefficient, or very complicated
to explain. So the important question here is: Why do you need something
else than a phase error feedback loop? You can of course just estimate
your phase offset once using a set of known symbols (e.g. a preamble),
and use that for as long as you think your channel and transceiver are
coherent, but I think you've already considered that, since you ask how
to get rid of the loop, and recognized that it's a good idea to
continuously account for changing phase.

Greetings,
Marcus

PS: There's not only sirs on this list, also ladies, and we're not very
formal on here, so a quick "hello" would totally be sufficient :)

On 03/12/2015 07:35 AM, Vishwanatha H G wrote:
> sir, can we achieve 16 qam demodulation constellation without using
> costas loop? if possible please send me the flow graph. thank you
>
>
> ___
> 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] Controlling File Sink

2015-03-12 Thread mleech
 

Have your packet detector set the filename on the filesink to
"/dev/null" when you don't want anything recorded, and to your output
filename when you do, and use the "append" option. 

On 2015-03-12 14:36, Richard Bell wrote: 

> Hello all,
> 
> In GRC, I've set up a packet detector that is working using the Header 
> Payload Demux block. Unexpectedly, however, it seems the payload output port 
> does not go silent when no header is detected. It outputs zeros, which the 
> file sink block I have connected to that port then stores.
> 
> I've attached a screenshot of my flowgraph. The top row generates the 
> packets. The middle row adds zeros between packets, to give the header 
> payload demux something to do. The third row detects the packets, strips the 
> header and sends the payload out to a file sink. 
> I would like the payload output port to be quiet when no header is detected, 
> or I would like a way to control what the file sink stores. Tagged File Sink 
> is not what I'm looking for, because it creates a new file every time a tag 
> is detected.
> 
> Would someone kindly recommend a way to do what I would like?
> 
> v/r, Rich 
> 
> ___
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio [1]
 

Links:
--
[1] 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] Python message passing block hangs (test file included)

2015-03-12 Thread Anderson, Douglas J.
Hi all,

I'm struggling to understand an issue I'm having with a simple python block 
with a registered message port connected to the copy block.

The python block looks like this: it literally does nothing, it just happens to 
have a message port registered:

class signal_sink(gr.sync_block):
  def __init__(self):
gr.sync_block.__init__(self, name="sink", in_sig=[np.float32], out_sig=None)
self.signal = pmt.from_bool(False)
self.port_name = pmt.intern("sig")
self.message_port_register_out(self.port_name)

def work(self, input_items, output_items):
return len(input_items[0])

Then I have a gr.unittest case that connects a vector_source, the copy block, 
and the above signal sink:

def test_copy(self):
src_data = np.arange(1000)
src = blocks.vector_source_f(src_data)
copy = blocks.copy(gr.sizeof_float)
msg_debug = blocks.message_debug()
sig_sink = signal_sink()
self.tb.connect(src, copy, sig_sink)
self.tb.msg_connect(sig_sink, "sig", copy, "en")

# Run once (this run is successful)
self.tb.run()

# Run again (this run hangs)
src.rewind()
self.tb.run()

The second time the flowgraph is "run", it hangs indefinitely. GDB shows 
sig_sink's thread state as
#0 pthread_cond_timedwait@@GLIBC_2.3.2 ()
at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S:238

Commenting out the "self.tb.msg_connect" line stops the hang, as does 
connecting sig_sink's message port to a message_debug block (which is not in 
the flowgraph).

All this even though the sig_sink block doesn't send any signals over its 
message port.

Any hints would be very much appreciated, my debugging prowess has taken me as 
far as it's going to take me.

I've attached the complete test file that you can run with "python test.py"

Thanks in advance,
-Doug
import numpy as np

from gnuradio import gr, gr_unittest, blocks
import pmt


class signal_sink(gr.sync_block):
def __init__(self):
gr.sync_block.__init__(self, name="sink", in_sig=[np.float32], out_sig=None)

self.signal = pmt.from_bool(False)
self.port_name = pmt.intern("sig")
self.message_port_register_out(self.port_name)

def work(self, input_items, output_items):
#self.message_port_pub(self.port_name, self.signal)
return len(input_items[0])


class qa_msg_passing(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()

def tearDown(self):
self.tb = None

def test_copy(self):
src_data = np.arange(1000)
src = blocks.vector_source_f(src_data)
copy = blocks.copy(gr.sizeof_float)
msg_debug = blocks.message_debug()
sig_sink = signal_sink()

self.tb.connect(src, copy, sig_sink)
self.tb.msg_connect(sig_sink, "sig", copy, "en")   # This causes problems
#self.tb.msg_connect(sig_sink, "sig", msg_debug, "print")  # This does not

# Run once (this run is successful)

self.tb.run()

# Run again (this run hangs)

src.rewind()
self.tb.start()
print("Debug: 2nd top_block run started...")
self.tb.wait()
print("Debug: 2nd top_block run exited...")


if __name__ == '__main__':
#import os
#print("Blocked waiting for GDB attach (pid = {})".format(os.getpid()))
#raw_input("Press Enter to continue...")
gr_unittest.run(qa_msg_passing)
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Controlling File Sink

2015-03-12 Thread Richard Bell
Marcus,

I'm not sure how to do what you're saying. Can you elaborate with an
example?

Rich

On Thu, Mar 12, 2015 at 11:42 AM,  wrote:

>  Have your packet detector set the filename on the filesink to
> "/dev/null" when you don't want anything recorded, and to your output
> filename when you do, and use the "append" option.
>
>
>
>
>
>
>
>
> On 2015-03-12 14:36, Richard Bell wrote:
>
>   Hello all,
>
> In GRC, I've set up a packet detector that is working using the Header
> Payload Demux block. Unexpectedly, however, it seems the payload output
> port does not go silent when no header is detected. It outputs zeros, which
> the file sink block I have connected to that port then stores.
>
> I've attached a screenshot of my flowgraph. The top row generates the
> packets. The middle row adds zeros between packets, to give the header
> payload demux something to do. The third row detects the packets, strips
> the header and sends the payload out to a file sink.
>
> I would like the payload output port to be quiet when no header is
> detected, or I would like a way to control what the file sink stores.
> Tagged File Sink is not what I'm looking for, because it creates a new file
> every time a tag is detected.
>
> Would someone kindly recommend a way to do what I would like?
>
> v/r,
> Rich
>
> ___
> Discuss-gnuradio mailing 
> listDiscuss-gnuradio@gnu.orghttps://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] Setting up GNU Radio

2015-03-12 Thread Richard Bell
Hi all,

I'm setting up a new shared laptop with multiple users who want to use GNU
Radio. I'm not sure how to set this up correctly.

Should I do it this way:

1) cd /usr/local/bin
2) git clone https://github.com/pybombs/pybombs.git && cd pybombs
3) sudo ./pybombs install gnuradio (sudo needed to give permission to
create files here)
4) ./pybombs env

5) Then instead of sourcing the setup_env.sh file from .bashrc, I will
source it from /etc/profile.

6) Finally, and this is the part I'm most unsure of, since I used sudo
./pybombs install gnuradio, root owns these files. If I remember correctly,
this caused issues for me in the past trying to run gnuradio from a
non-root account. How should I handle this?

Thanks a lot,
Rich
___
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


Re: [Discuss-gnuradio] Setting up GNU Radio

2015-03-12 Thread Marcus Müller
Hi Richard,
no, not completely.
instead of 1) you should cd somewhere in your home directory, where you
have write access
2) - 3) are correct. Choose /usr/local/ as prefix
5) could also be done by copying over setup_env.sh to
/etc/profile.d/50-setup-gnuradio-paths

6) is normal and should not result in errors.

If normal users (including) want to install their own OOT modules,
they'd use a local clone of pybombs, setting that gnuradio is already
installed, and install their modules into a user-prefix (e.g.
/home/user/prefix).

Greetings,
Marcus


On 03/12/2015 10:43 PM, Richard Bell wrote:
> Hi all,
>
> I'm setting up a new shared laptop with multiple users who want to use
> GNU Radio. I'm not sure how to set this up correctly.
>
> Should I do it this way:
>
> 1) cd /usr/local/bin
> 2) git clone https://github.com/pybombs/pybombs.git && cd pybombs
> 3) sudo ./pybombs install gnuradio (sudo needed to give permission to
> create files here)
> 4) ./pybombs env
>
> 5) Then instead of sourcing the setup_env.sh file from .bashrc, I will
> source it from /etc/profile.
>
> 6) Finally, and this is the part I'm most unsure of, since I used sudo
> ./pybombs install gnuradio, root owns these files. If I remember
> correctly, this caused issues for me in the past trying to run
> gnuradio from a non-root account. How should I handle this?
>
> Thanks a lot,
> Rich
>
>
> ___
> 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] Setting up GNU Radio

2015-03-12 Thread Richard Bell
Thanks for responding MarcusM,

I can't execute 'sudo ./pybombs install gnuradio' at all, because it fails
with the following output:




















*rbell@polarcode1:~/Documents/gnuradio/pybombs$ sudo ./pybombs install
gnuradioInitializing config file...Username for GIT accessgituser
[root]:Directory of git cache repositorygitcache []:Install PrefixTraceback
(most recent call last):  File "./pybombs", line 25, in from
mod_pybombs import verbosity as v  File
"/home/rbell/Documents/gnuradio/pybombs/mod_pybombs/__init__.py", line 22,
in from globals import *;  File
"/home/rbell/Documents/gnuradio/pybombs/mod_pybombs/globals.py", line 48,
in config_init(config);  File
"/home/rbell/Documents/gnuradio/pybombs/mod_pybombs/cfg.py", line 70, in
config_initif os.path.basename(pwd)=="pybombs":  File
"/usr/lib/python2.7/posixpath.py", line 121, in basenamei =
p.rfind('/') + 1AttributeError: 'NoneType' object has no attribute
'rfind'rbell@polarcode1:~/Documents/gnuradio/pybombs$ *

If I install it without sudo to a local account directory, how will other
users be able to access the install? Is it simply a matter of setting up
the environment variables correctly?

v/r,
Rich

On Thu, Mar 12, 2015 at 2:49 PM, Marcus Müller 
wrote:

>  Hi Richard,
> no, not completely.
> instead of 1) you should cd somewhere in your home directory, where you
> have write access
> 2) - 3) are correct. Choose /usr/local/ as prefix
> 5) could also be done by copying over setup_env.sh to
> /etc/profile.d/50-setup-gnuradio-paths
>
> 6) is normal and should not result in errors.
>
> If normal users (including) want to install their own OOT modules, they'd
> use a local clone of pybombs, setting that gnuradio is already installed,
> and install their modules into a user-prefix (e.g. /home/user/prefix).
>
> Greetings,
> Marcus
>
>
>
> On 03/12/2015 10:43 PM, Richard Bell wrote:
>
>  Hi all,
>
>  I'm setting up a new shared laptop with multiple users who want to use
> GNU Radio. I'm not sure how to set this up correctly.
>
>  Should I do it this way:
>
>  1) cd /usr/local/bin
>  2) git clone https://github.com/pybombs/pybombs.git && cd pybombs
>  3) sudo ./pybombs install gnuradio (sudo needed to give permission to
> create files here)
>  4) ./pybombs env
>
>  5) Then instead of sourcing the setup_env.sh file from .bashrc, I will
> source it from /etc/profile.
>
>  6) Finally, and this is the part I'm most unsure of, since I used sudo
> ./pybombs install gnuradio, root owns these files. If I remember correctly,
> this caused issues for me in the past trying to run gnuradio from a
> non-root account. How should I handle this?
>
>  Thanks a lot,
>  Rich
>
>
> ___
> Discuss-gnuradio mailing 
> listDiscuss-gnuradio@gnu.orghttps://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] Setting up GNU Radio

2015-03-12 Thread Marcus Müller
> If I install it without sudo to a local account directory, how will
> other users be able to access the install? Is it simply a matter of
> setting up the environment variables correctly?
The idea is to install GNU Radio globally, and let users handle their
own modules in their own home directories. So you'd install GNU Radio
with sudo as root into /usr/local, and each user installs private
modules into /home//prefix

When does the error you paste below occur? Before you get the chance to
enter /usr/local as prefix, or after?
Anyway, I'd recommend deleting your pybombs folder and cloning it
cleanly again, running pybombs without root. It should ask you for the
prefix. after that, it should print a warning that you should re-run it
with sudo. Do that. Does the error still occur?

Greetings,
Marcus



On 03/12/2015 11:02 PM, Richard Bell wrote:
> Thanks for responding MarcusM,
>
> I can't execute 'sudo ./pybombs install gnuradio' at all, because it
> fails with the following output:
>
> /rbell@polarcode1:~/Documents/gnuradio/pybombs$ sudo ./pybombs install
> gnuradio
> Initializing config file...
> Username for GIT access
> gituser [root]:
> Directory of git cache repository
> gitcache []:
> Install Prefix
> Traceback (most recent call last):
>   File "./pybombs", line 25, in 
> from mod_pybombs import verbosity as v
>   File
> "/home/rbell/Documents/gnuradio/pybombs/mod_pybombs/__init__.py", line
> 22, in 
> from globals import *;
>   File
> "/home/rbell/Documents/gnuradio/pybombs/mod_pybombs/globals.py", line
> 48, in 
> config_init(config);
>   File "/home/rbell/Documents/gnuradio/pybombs/mod_pybombs/cfg.py",
> line 70, in config_init
> if os.path.basename(pwd)=="pybombs":
>   File "/usr/lib/python2.7/posixpath.py", line 121, in basename
> i = p.rfind('/') + 1
> AttributeError: 'NoneType' object has no attribute 'rfind'
> rbell@polarcode1:~/Documents/gnuradio/pybombs$ /
>
> If I install it without sudo to a local account directory, how will
> other users be able to access the install? Is it simply a matter of
> setting up the environment variables correctly?
>
> v/r,
> Rich
>
> On Thu, Mar 12, 2015 at 2:49 PM, Marcus Müller
> mailto:marcus.muel...@ettus.com>> wrote:
>
> Hi Richard,
> no, not completely.
> instead of 1) you should cd somewhere in your home directory,
> where you have write access
> 2) - 3) are correct. Choose /usr/local/ as prefix
> 5) could also be done by copying over setup_env.sh to
> /etc/profile.d/50-setup-gnuradio-paths
>
> 6) is normal and should not result in errors.
>
> If normal users (including) want to install their own OOT modules,
> they'd use a local clone of pybombs, setting that gnuradio is
> already installed, and install their modules into a user-prefix
> (e.g. /home/user/prefix).
>
> Greetings,
> Marcus
>
>
>
> On 03/12/2015 10:43 PM, Richard Bell wrote:
>> Hi all,
>>
>> I'm setting up a new shared laptop with multiple users who want
>> to use GNU Radio. I'm not sure how to set this up correctly.
>>
>> Should I do it this way:
>>
>> 1) cd /usr/local/bin
>> 2) git clone https://github.com/pybombs/pybombs.git && cd pybombs
>> 3) sudo ./pybombs install gnuradio (sudo needed to give
>> permission to create files here)
>> 4) ./pybombs env
>>
>> 5) Then instead of sourcing the setup_env.sh file from .bashrc, I
>> will source it from /etc/profile.
>>
>> 6) Finally, and this is the part I'm most unsure of, since I used
>> sudo ./pybombs install gnuradio, root owns these files. If I
>> remember correctly, this caused issues for me in the past trying
>> to run gnuradio from a non-root account. How should I handle this?
>>
>> Thanks a lot,
>> Rich
>>
>>
>> ___
>> 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