Simple FM Receiver with OsmoSDR in GNURadio

May 14th, 2012 by chris007

Finally, my 20$ EZcap USB DVB-T stick has arrived, and I wanted to start with a simple FM receiver to see how to operate this thing with OsmoSDR in GNURadio!

I’ve already installed GNURadio, RTL-SDR and OsmoSDR using the GNURadio build script on my Ubuntu 11.10 machine. To start out with the USB-receiver, you can just run the example contained in the OsmoSDR sources (./gr-osmosdr/apps/osmosdr_source.grc) to see if the stick works. It should do its job out of the box, at least it did for me. When running this example, you should see a nice FFT of the received radio signal at the defined frequency with sample-rate dependent bandwidth.

Slightly altered osmosdr_source.grc example

If this example works, you can go on and work on bigger things instantly. As already mentioned, I wanted build a very basic FM receiver. GNURadio has everything you need for that on-board, and therefore the grc model for such a receiver looks like this:

Basic FM Receiver in GNURadio Companion

Some comments on the used blocks and their parameters:

  • OsmoSDR Source: gets the desired frequency from the osmo_freq slider, samplerate is chosen in the osmo_samp_rate variable
  • Rational Resampler: gets the decimation and interpolation values from osmo_samp_rate and samp_rate
  • Frequency Xlating FIR Filter: sample rate from samp_rate, filter_taps is defined as a firdes.low_pass(1,samp_rate,100e3,1e3) (feel free to play around with the latter two parameters of the filter!). The center frequency can be changed with xlate_tune
  • WBFM Receive: Quadrature rate is samp_rate
  • For the FFTs, I’ve chosen a configurable refresh rate, you can tweak it according to the performance of your computer (as well as the FFT size…). Also, their baseband frequency is set to osmo_freq, respectively osmo_frequ+xlate_tune to change the x-axis of the FFTs according to the currently slider settings.

After putting everything together, the following GUI should appear and you can tune and listen to your favorite FM station!

Running and receiving fm_rcv

 

Known issues:

When I’m running GNURadio simultaneousely with other sound sources (e.g. a video in a browser), the grc model throws the following error:

audio_alsa_sink[hw:0,0]: Das Gerät oder die Ressource ist belegt
Traceback (most recent call last):
  File "/home/chris/ufsdr/osmosdr/fm_rcv/fm_rcv.py", line 280, in <module>
    tb = FM_rcv()
  File "/home/chris/ufsdr/osmosdr/fm_rcv/fm_rcv.py", line 201, in __init__
    self.audio_sink_0 = audio.sink(48000, "", True)
  File "/usr/local/lib/python2.7/dist-packages/gnuradio/audio/audio_swig.py", line 345, in sink
    return _audio_swig.sink(*args, **kwargs)
RuntimeError: audio_alsa_sink

I solve this problem by a forced restart of the alsa-device by identifying the process(es) using PCM currently with

lsof | grep pcm

and killing the appearing tasks by their ids with

kill <id>

 

For further (basic) information see:
OsmoSDR Wiki: http://sdr.osmocom.org/trac/wiki/rtl-sdr
GNURadio Homepage: http://gnuradio.org

Fast merge of multiple jpgs to a single pdf

May 9th, 2012 by chris007

If you want to merge several images (e.g.) jpg to a single pdf, probably after scanning them, just use

convert *.jpg output.pdf

So simple.

Installing the Xilinx Cable Drivers under Ubuntu

January 29th, 2012 by chris007

Each time I install Xilinx ISE under Ubuntu – and that happened a few times in the last months – I wonder how to get the Cable Drivers working so I can program my Spartan3E Starter Board. Although there seems to be an official Linux support, Cable Drivers do not work per default after installation. There’s a very useful link describing the process, and it works really fine for me. I bookmarked it lately and want to share, so other people can find this recipe more easily:

http://www.george-smart.co.uk/wiki/Xilinx_JTAG_Linux

It worked fine with ISE 13.1 and Ubuntu 10.10 for me.

Good luck!

 

Back in business

January 27th, 2012 by chris007

Hey folks! Some time has passed since my last activity in this blog…I was pretty busy with studies/working, but now I’m nearly finished with my Master studies. New hobbies and fields of interest appeared in the meantime – and therefore I want to share some of my experiences with you again, the cats and tubes! Hopefully, a pretty bunch of posts related to electronics, HAM (amateur radio), news of teh interwebs, tinkering for my T4 bus, linnex stuff, etc. will appear here!

 

X-Chat2 script to preserve nickname

September 26th, 2011 by BEni

I have been using X-Chat2 for quite a while now, and since my ISP cuts my line every 24h, i rejoin all IRC networks once my client detects the disconnect. This happens before the server realises, that the old connection is invalid, so my nickname is occupied by a ghost (zombie connection). There is a command to tell the server, that this situation has happened (ghosting), but not all servers support it.

Thats why i wrote this script, which listens for some events (e.g. the QUIT command, which is sent when the server realises, the other connection is dead) and then tries to change the nick back to the primary nick. It also listens to some more events and has a nickchange delay (so you dont spam the server with nickchanges in case of a problem). One could probably reduce the eventlisteners to the QUIT one.

I wrote this in perl, because i was looking at other plugins how the xchat API works, but it should be fairly easy to port it to python or c++, or whatever you want. No special license.

Install by simply renaming it to nickChanger.pl and putting it into your

~/.xchat2/

folder and ensuring that perl is installed. X-Chat will try to load it on start.

nickChanger.pl