# PSK Modulation-\>Demodulation

**URL:** <https://www.ruby-forum.com/t/psk-modulation-demodulation/242335>\
**Category:** GNU Radio\
**Created:** [June 16, 2015, 5:02pm UTC](https://www.ruby-forum.com/t/psk-modulation-demodulation/242335 "2015-06-16T17:02:26Z")\
**Posts on this page:** 4\
**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:** [June 16, 2015, 5:02pm UTC](https://www.ruby-forum.com/t/psk-modulation-demodulation/242335/1 "2015-06-16T17:02:26Z")

</div>

Hello,

I know a similar question has been asked before on this mailing list but  
I  
didn’t quite get a solution out of it. I am generating a random byte  
source, either ones or zeroes, modulating them with DBPSK and  
immediately  
demodulating them. The problem I am running into is that I get roughly 8  
times the number of bytes out of the demodulation block than I am  
inputting  
into the modulation block. I believe its a packed vs. unpacked byte  
problem  
but every attempt at packing the output bytes yields an output that  
doesn’t  
match the input.

Attached are the GRC file, and the output file streams.

Does anyone have any suggestions? I appreciate all of your time,

Logan Washbourne  
Electrical Engineering Graduate Student  
(Electromagnetics)

---

<div class="post-metadata">

**Author:** ![WashbourneS\_Logan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ec9cab/32.png) [@WashbourneS\_Logan](https://www.ruby-forum.com/u/WashbourneS_Logan)\
**Post date:** [June 16, 2015, 5:15pm UTC](https://www.ruby-forum.com/t/psk-modulation-demodulation/242335/2 "2015-06-16T17:15:53Z")

</div>

On Tue, Jun 16, 2015 at 11:01 AM, Washbourne, Logan \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> Attached are the GRC file, and the output file streams.
> 
> Does anyone have any suggestions? I appreciate all of your time,
> 
> Logan Washbourne  
> Electrical Engineering Graduate Student  
> (Electromagnetics)

The problem is that you don’t know which bit to put where in the byte.  
So  
just packing the output bits into 8 bits per byte doesn’t necessarily  
give  
you the right information. Say you transmit a byte with bits [a b c d e  
f g  
h]. After the delays introduced by the transmit and receiver filter and  
the  
channel, when you pack the results, you could get something like [x x x  
a b  
c d e] [f g h 0 0 0 0 0], for some unknown number of x’s.

You need some logic that knows how to discover the start of your  
information and get rid of those x’s. The framer blocks do this with  
some  
assumed formatting and expectations. Johnathan and I have been working  
on a  
better version of this, but we haven’t had a chance to finish it off.

Tom

---

<div class="post-metadata">

**Author:** ![WashbourneS\_Logan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ec9cab/32.png) [@WashbourneS\_Logan](https://www.ruby-forum.com/u/WashbourneS_Logan)\
**Post date:** [June 16, 2015, 6:07pm UTC](https://www.ruby-forum.com/t/psk-modulation-demodulation/242335/3 "2015-06-16T18:07:18Z")

</div>

So would a good solution to this be the packet encoder and packet  
decoder  
blocks? Since they utilize a preamble and access code? I tried to use  
the  
simple framer block in conjunction with the unpacked to packed byte  
block  
but was unsuccessful in getting a matching output, I will continue to  
play  
around with that configuration but for now do you think the packet  
encoder  
route would be a good solution?

Again, I really appreciate everyone’s willingness to help.

Logan Washbourne  
Electrical Engineering Graduate Student  
(Electromagnetics)

---

<div class="post-metadata">

**Author:** ![WashbourneS\_Logan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ec9cab/32.png) [@WashbourneS\_Logan](https://www.ruby-forum.com/u/WashbourneS_Logan)\
**Post date:** [June 17, 2015, 1:54am UTC](https://www.ruby-forum.com/t/psk-modulation-demodulation/242335/4 "2015-06-17T01:54:45Z")

</div>

On Tue, Jun 16, 2015 at 12:05 PM, Washbourne, Logan \<  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:

> Electrical Engineering Graduate Student  
> (Electromagnetics)

Yep, those two blocks should handle this issue for you. It’s a  
simplistic  
approach to the problem, but it should work for just what you are  
talking  
about here.

Tom
