# Reading data from a file

**URL:** <https://www.ruby-forum.com/t/reading-data-from-a-file/230815>\
**Category:** GNU Radio\
**Created:** [July 7, 2014, 12:22pm UTC](https://www.ruby-forum.com/t/reading-data-from-a-file/230815 "2014-07-07T12:22:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![addis\_a](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@addis\_a](https://www.ruby-forum.com/u/addis_a)\
**Post date:** [July 7, 2014, 12:22pm UTC](https://www.ruby-forum.com/t/reading-data-from-a-file/230815/1 "2014-07-07T12:22:49Z")

</div>

Hi  
I did the following GRC to test psk modulation and demodulation. A text  
file is input and did modulated and demodulated. After demodulation the  
result is a pattern of \x00\ and \x08?\ where as I gave charactors 1, 2,  
3, 4, … 10 as input. where have I gone wrong. Please help me  
understand the data conversion taking place here.

---

<div class="post-metadata">

**Author:** ![sreena\_p\_h](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/47e85d/32.png) [@sreena\_p\_h](https://www.ruby-forum.com/u/sreena_p_h)\
**Post date:** [July 7, 2014, 12:43pm UTC](https://www.ruby-forum.com/t/reading-data-from-a-file/230815/2 "2014-07-07T12:43:44Z")

</div>

Hi Sreena,

If you convert uchar to float, a 20 (decimal) = 0001010 (bin) becomes a  
20.0 (decimal), which is in float representation a …ummm…  
00000000 00000000 10100000 01000001 .  
You shouldn’t convert! just set the file sink to the matching input  
type.
