# BPSK output abnormal

**URL:** <https://www.ruby-forum.com/t/bpsk-output-abnormal/242064>\
**Category:** GNU Radio\
**Created:** [May 24, 2015, 10:55am UTC](https://www.ruby-forum.com/t/bpsk-output-abnormal/242064 "2015-05-24T10:55:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![musicdenotation](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea666f/32.png) [@musicdenotation](https://www.ruby-forum.com/u/musicdenotation)\
**Post date:** [May 24, 2015, 10:55am UTC](https://www.ruby-forum.com/t/bpsk-output-abnormal/242064/1 "2015-05-24T10:55:13Z")

</div>

Hi everyone,

I try to simulate file transfer using BPSK with block diagram

File Source --\> PSK Mod --\> PSK Demod --\> File Sink

The block setting is  
File Source :  
-file type = .jpg (282,8 kB (282.765 bytes))  
-repeat = no  
-vec length = 1

PSK Mod :  
-num of constellation = 2  
-gray code = yes  
-diff. encoding = yes  
-sample/symbol = 2  
-excess BW = 0.35  
-verbose = off  
=log = off

PSK Demod :  
-num of constellation = 2  
-diff. encoding = yes  
-sample/symbol = 2  
-excess BW = 0.35  
-frequency BW = 6.28/100.0  
-timing BW = 6.28/100.0  
-phase BW = 6.28/100.0  
-gray code = yes  
-verbose = off  
-log = off

File Sink  
-vec length = 1  
-unbuffered = on  
-append file = overwrite

The size of input file = 282,8 kB (282.765 bytes)  
but the size of output file = 2,3 MB (2.262.066 bytes)

What’s wrong with my fg?

Thank you,  
Surya A.

---

<div class="post-metadata">

**Author:** ![Surya\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8e7dd6/32.png) [@Surya\_A](https://www.ruby-forum.com/u/Surya_A)\
**Post date:** [May 24, 2015, 7:35pm UTC](https://www.ruby-forum.com/t/bpsk-output-abnormal/242064/2 "2015-05-24T19:35:44Z")

</div>

On Sun, May 24, 2015 at 4:54 AM, Surya A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> -vec length = 1  
> PSK Demod :
> 
> Thank you,  
> Surya A.

The output is unpacked. So each sample only represents a single bit. You  
have to repack them into 8 bits per byte, but you’ll also need to know  
where to start through some kind of frame synchronization.

282765\*8 = 2262120

The rest of the difference is due to delays in the filters. You can  
zero-pad the input to “push” the samples through.

Tom

---

<div class="post-metadata">

**Author:** ![Surya\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8e7dd6/32.png) [@Surya\_A](https://www.ruby-forum.com/u/Surya_A)\
**Post date:** [May 26, 2015, 10:13am UTC](https://www.ruby-forum.com/t/bpsk-output-abnormal/242064/3 "2015-05-26T10:13:52Z")

</div>

On Sun, May 24, 2015 at 4:25 PM, Surya A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Oh thank you Tom, I can recover the file size. About frame synchronization,  
> am I need Polyphase Clock Sync Block? And also I have no idea about “You  
> can zero-pad the input to “push” the samples through.”?

(please keep emails on the mailing list)

The PFB clock sync handles symbol synchronization – it finds where the  
bits are. You’ll need another level of synchronization to find the start  
of  
the frame, usually by looking for a known start pattern, preamble, etc.

And there are many ways to accomplish the zero-padding. I’ll leave that  
up  
to you to figure out 🙂

Tom

---

<div class="post-metadata">

**Author:** ![Surya\_A](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8e7dd6/32.png) [@Surya\_A](https://www.ruby-forum.com/u/Surya_A)\
**Post date:** [May 26, 2015, 11:29am UTC](https://www.ruby-forum.com/t/bpsk-output-abnormal/242064/4 "2015-05-26T11:29:16Z")

</div>

Oh sorry I forgot to reply to all.

Now there’s a new problem. I use Packet Encoder to add preamble, the  
setting is:  
Encoder

- sps = 2
- bps = 1 (bpsk)
- preamble = 1010010011110010
- access code  
= 1010110011011101101001001110001011110010100011000010000011111100
- pad for USRP = no
- payload strength = 16  
Decoder
- access code  
= 1010110011011101101001001110001011110010100011000010000011111100
- threshold = -1

both access code and preamble are from  
[http://gnuradio.org/doc/sphinx-3.7.2/digital/pkt\_utils.html](http://gnuradio.org/doc/sphinx-3.7.2/digital/pkt_utils.html)

The output now become 0kB
