# Bug in DBPSK blocks

**URL:** <https://www.ruby-forum.com/t/bug-in-dbpsk-blocks/237854>\
**Category:** GNU Radio\
**Created:** [December 3, 2013, 7:53pm UTC](https://www.ruby-forum.com/t/bug-in-dbpsk-blocks/237854 "2013-12-03T19:53:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [December 3, 2013, 7:53pm UTC](https://www.ruby-forum.com/t/bug-in-dbpsk-blocks/237854/1 "2013-12-03T19:53:27Z")

</div>

Hi all,

There’s a bug in the block for the DBPSK modulator. The “differential”  
param isn’t set to True in dbpsk\_mod; it’s just left to default, and  
differential defaults to False in the bpsk\_mod block. So it really acts  
like a BPSK modulator. QPSK was the same. Here’s a patch.

diff --git a/gr-digital/python/digital/bpsk.py  
b/gr-digital/python/digital/bpsk.py  
index 57cf253…92f3254 100644  
— a/gr-digital/python/digital/bpsk.py  
+++ b/gr-digital/python/digital/bpsk.py  
@@ -117,7 +117,7 @@ class dbpsk\_mod(bpsk\_mod):

```
 def __init__ (self, mod_code=None, *args, **kwargs):

```

- 

```
   super(dbpsk_mod, self). __init__ (*args, **kwargs)

```

- 

```
   super(dbpsk_mod, self). __init__ (differential=True, *args, 

```

\*\*kwargs)

# 

/////////////////////////////////////////////////////////////////////////////

# DBPSK demodulator

@@ -139,7 +139,7 @@ class dbpsk\_demod(bpsk\_demod):

```
 def __init__ (self, mod_code=None, *args, **kwargs):

```

- 

```
   super(dbpsk_demod, self). __init__ (*args, **kwargs)

```

- 

```
   super(dbpsk_demod, self). __init__ (differential=True, *args,

```

\*\*kwargs)

# 

# Add these to the mod/demod registry

diff --git a/gr-digital/python/digital/qpsk.py  
b/gr-digital/python/digital/qpsk.py  
index 859d981…1ed3357 100644  
— a/gr-digital/python/digital/qpsk.py  
+++ b/gr-digital/python/digital/qpsk.py  
@@ -149,7 +149,7 @@ class dqpsk\_mod(qpsk\_mod):  
**doc** += shared\_mod\_args

```
 def __init__ (self, mod_code=_def_mod_code, *args, **kwargs):

```

- 

```
   super(dqpsk_mod, self). __init__ (mod_code,

```

- 

```
   super(dqpsk_mod, self). __init__ (mod_code, True,
                                   *args, **kwargs)

```

# 

/////////////////////////////////////////////////////////////////////////////  
@@ -171,7 +171,7 @@ class dqpsk\_demod(qpsk\_demod):  
**doc** += shared\_demod\_args

```
 def __init__ (self, mod_code=_def_mod_code, *args, **kwargs):

```

- 

```
   super(dqpsk_demod, self). __init__ (mod_code,

```

- 

```
   super(dqpsk_demod, self). __init__ (mod_code, True,
                                     *args, **kwargs)

```

# 

Incidentally, I question the need for the DBPSK mod GRC block now that  
we  
have the generic PSK mod GRC block. Might make sense to deprecate it.

–n

---

<div class="post-metadata">

**Author:** ![nickfaraday](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b2d939/32.png) [@nickfaraday](https://www.ruby-forum.com/u/nickfaraday)\
**Post date:** [December 4, 2013, 3:42pm UTC](https://www.ruby-forum.com/t/bug-in-dbpsk-blocks/237854/2 "2013-12-04T15:42:23Z")

</div>

On Tue, Dec 3, 2013 at 1:52 PM, Nick F. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Hi all,
> 
> There’s a bug in the block for the DBPSK modulator. The “differential” param  
> isn’t set to True in dbpsk\_mod; it’s just left to default, and differential  
> defaults to False in the bpsk\_mod block. So it really acts like a BPSK  
> modulator. QPSK was the same. Here’s a patch.

Thanks for the report and patch, Nick. I should get to it today, but  
in the meantime, I opened ticket #624 in case it slips my timeline  
today. In the future, best to put these things up on the Issues  
tracker.

> - 
> 
> ```
> super(dbpsk_mod, self). __init__ (differential=True, *args, **kwargs)
> 
> ```
> 
> \*\*kwargs)
> 
> ```
> def __init__ (self, mod_code=_def_mod_code, *args, **kwargs):
> 
> ```
> 
> - 
> 
> ```
> super(dqpsk_demod, self). __init__ (mod_code,
> 
> ```
> 
> - 
> 
> ```
> super(dqpsk_demod, self). __init__ (mod_code, True,
> *args, **kwargs)
> 
> ```
> 
> # 
> 
> Incidentally, I question the need for the DBPSK mod GRC block now that we  
> have the generic PSK mod GRC block. Might make sense to deprecate it.
> 
> –n

I quite agree. I have a note to myself to clean this up with 3.8.

Tom

---

<div class="post-metadata">

**Author:** ![nickfaraday](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/b2d939/32.png) [@nickfaraday](https://www.ruby-forum.com/u/nickfaraday)\
**Post date:** [December 7, 2013, 11:14pm UTC](https://www.ruby-forum.com/t/bug-in-dbpsk-blocks/237854/3 "2013-12-07T23:14:13Z")

</div>

Thanks - I reported this as a bug months ago and nobody took any notice

- so I assumed it was me.

Mike
