# Transmitting a file (txt, jpeg or audio) in FM Band

**URL:** <https://www.ruby-forum.com/t/transmitting-a-file-txt-jpeg-or-audio-in-fm-band/126933>\
**Category:** GNU Radio\
**Created:** [January 23, 2008, 3:56pm UTC](https://www.ruby-forum.com/t/transmitting-a-file-txt-jpeg-or-audio-in-fm-band/126933 "2008-01-23T15:56:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 23, 2008, 3:56pm UTC](https://www.ruby-forum.com/t/transmitting-a-file-txt-jpeg-or-audio-in-fm-band/126933/1 "2008-01-23T15:56:11Z")

</div>

I have been playing around the USRP and would like to get an Idea how I  
can transmit an FM signal in the FM Band. For example, I would like to  
transmit a file (txt, jpeg, audio or anything) using in the FM band  
88MHz-108MHz at a specific frequency.  
I have looked at the nbfm\_tx.py but it seems like I cannot generate a  
valid audio-N.dat file that could be transmitted or in other words how  
can we generate an audio-N.dat file from an .mp3 or .wav file? Also, can  
any one explain that how we can use the nbfm\_tx.py or any other method  
to transmit something over an frequency in FM band?

–  
This message was sent on behalf of removed\_email\_address@domain.invalid at  
[openSubscriber.com](http://openSubscriber.com)  
[http://www.opensubscriber.com/messages/removed\_email\_address@domain.invalid/topic.html](http://www.opensubscriber.com/messages/removed_email_address@domain.invalid/topic.html)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [January 23, 2008, 4:14pm UTC](https://www.ruby-forum.com/t/transmitting-a-file-txt-jpeg-or-audio-in-fm-band/126933/2 "2008-01-23T16:14:25Z")

</div>

On Jan 23, 2008 4:55 PM, [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I have been playing around the USRP and would like to get an Idea how I can transmit an FM signal in the FM Band. For example, I would like to transmit a file (txt, jpeg, audio or anything) using in the FM band 88MHz-108MHz at a specific frequency.  
> I have looked at the nbfm\_tx.py but it seems like I cannot generate a valid audio-N.dat file that could be transmitted or in other words how can we generate an audio-N.dat file from an .mp3 or .wav file? Also, can any one explain that how we can use the nbfm\_tx.py or any other method to transmit something over an frequency in FM band?

Using sox, it is pretty easy to write a mp3 wfm broadcasting system (I  
have made one that broadcasts a mp3 playlist). The others are also  
possible, but there are very many ways to transfer images or data over  
the air.

> sox file.mp3 -r 32000 -t raw -f -l -c 1 audio.dat

juha

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 11, 2008, 2:31pm UTC](https://www.ruby-forum.com/t/transmitting-a-file-txt-jpeg-or-audio-in-fm-band/126933/3 "2008-02-11T14:31:10Z")

</div>

Juha, you said you have built wfm broadcasting system. I am trying to  
build one myself and would really appreciate some guidlines. I am new to  
python and would like to use some built-in python modules and scripts  
that gnuradio already has. If you could please give a start up point  
I’ll be grateful.

Thank you

–  
This message was sent on behalf of removed\_email\_address@domain.invalid at  
[openSubscriber.com](http://openSubscriber.com)  
[http://www.opensubscriber.com/message/removed\_email\_address@domain.invalid/8445716.html](http://www.opensubscriber.com/message/removed_email_address@domain.invalid/8445716.html)

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 11, 2008, 3:36pm UTC](https://www.ruby-forum.com/t/transmitting-a-file-txt-jpeg-or-audio-in-fm-band/126933/4 "2008-02-11T15:36:21Z")

</div>

Hi,

Here is the quick hack that I wrote a while ago. It probably only  
works with linux, and be sure that you have all the necessary programs  
installed (check out README). Just stick some random wire antenna in  
the sma port and you should hear music.

[http://mep.fi/viewcvs/fmradio/?root=cvs](http://mep.fi/viewcvs/fmradio/?root=cvs)

The original idea was to create a super WFM radio that would  
simultaneously broadcast _many_ stations (you can probably fit about  
35-70 music streams in a 8 MHz bandwidth), so that you could chose  
what mp3 playlist you want to listen to by tuning your fm radio. But I  
have lost interest in doing this, as I rarely listen to even one  
stream of music 🙂 I suspect that a very fast disk, plenty of  
processors and a buffered and queued filesource block would be needed  
to make the super mp3 broadcast system possible. I am planning to  
write the filesource block soon, but I will use it for another  
project.

juha

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [February 13, 2008, 2:16pm UTC](https://www.ruby-forum.com/t/transmitting-a-file-txt-jpeg-or-audio-in-fm-band/126933/5 "2008-02-13T14:16:50Z")

</div>

Hi Juha! Thank you so much for your tremendous help. I looked at your  
code and using part of your fmradio.py code, wfm\_tx.py and fm\_tx4.py I  
put together something similar and am now able to transmit using my  
microphone and anything through my sound card. I am facing one problem,  
when I received the sound in an FM Radio, it comes out funny as in the  
pitch is low. So I tried changing the “audio\_rate” and making it 50KHz,  
which makes it sound better but not perfect and has clicking noises. I  
believe the soundcard I am using (Creative SB Audiy2) has a sample rate  
of 44100Hz I think. Might be 48000Hz. Either way, and I can’t make the  
audio\_rate close enough. I am basically just getting the packets from  
the audio source and putting it in the code like below inside class  
‘wfm\_tx’:

" self.fg = gr.flow\_graph()  
src = audio.source(44100, options.audio\_input)  
fmtx = blks.wfm\_tx(self.fg, self.audio\_rate, self.usrp\_rate)  
self.fg.connect(src, fmtx, gain, self.u)"

Is there a way to make it exactly the same or make it sound perfect on  
the radio? Your help would be appreciated like always.

Thank you,  
Omer

–  
This message was sent on behalf of removed\_email\_address@domain.invalid at  
[openSubscriber.com](http://openSubscriber.com)  
[http://www.opensubscriber.com/message/removed\_email\_address@domain.invalid/8445716.html](http://www.opensubscriber.com/message/removed_email_address@domain.invalid/8445716.html)
