Feed aggregator

Top Fuel Drag Racing at Sydney International Dragway

YouTube - Tue, 08/05/2012 - 00:25
Top Fuel Drag Racing at Sydney International Dragway
Everyone should experience the rumble at least once! 485km/h in 5.4s! From: balint256 Views: 80 3 ratings Time: 01:59 More in Sports
Categories: Off-site

Ultra-cheap SDR: HF with RTL2832 and transverter

YouTube - Wed, 25/04/2012 - 03:35
Ultra-cheap SDR: HF with RTL2832 and transverter
wiki.spench.net | Twitter: @spenchdotnet twitter.com ultra-cheap-sdr Google Group: groups.google.com This is a simple demonstration showing how one can receive HF using the ultra-cheap RTL2832U-based DVB-T USB dongle and a transverter (to move the HF signals into the range that the tuner in the dongle can receive). From: balint256 Views: 3941 22 ratings Time: 04:45 More in Science & Technology
Categories: Off-site

RTL2832

Wiki - Sat, 21/04/2012 - 21:55

Balint: /* External Resources */

== Introduction ==

This page details information specific to RTL2832U-based DVB-T USB dongles.

The information applies to using it with GNU Radio (using [[gr-baz#rtl_source_c|gr-baz]]), and on Windows with the [[USRP Interfaces|ExtIO plugin for HDSDR]].

== News ==

* I have created a [https://groups.google.com/forum/#!forum/ultra-cheap-sdr new discussion forum on Google Groups] as a place to discuss this code.

== Supported devices ==

RTL2832U-based USB DVB-T adapters (non-exhaustive list, see [[Zadig|here]] for how to install device driver on Windows).

The following are the names of some common devices, but others not listed here will work if their USB ID is the same:

* ezcap
* Hama nano
* Terratec Noxon 1 & 2
* Dexatek 1 (also Logilink/MSI)
* Dexatek 2 (also ZAAPA HD)
* Dexatek 3
* Peak
* Ardata MyVision/Gigabyte GT-U7300
* MyGica/G-Tek
* Lifeview
* PROlectrix
* Terratec Cinergy T 1
* DIKOM HD
* Twintech
* Genius TVGo 2
* SVEON

You can double-check the full list by inspecting the [http://svn.spench.net/main/gr-baz/lib/rtl2832.cc main librtl2832++ source file].

You can also [http://spench.net/contact contact me] with information (name/VID/PID/tuner type) regarding other devices that are not recognised automatically.

There is [http://www.reddit.com/r/RTLSDR/ a helpful subreddit] with [http://www.reddit.com/r/RTLSDR/comments/rbqfz/rtlsdr_compatibility_list_work_in_progress_please/ a more complete list].

=== Manual override ===

'''If your device is NOT recognised (missing from device table):'''

* '''Linux''': type in the VID/PID into the GRC block
* '''Windows''': add '''vid='''''0x####'' '''pid='''''0x####'' to device hint
* '''Code''': use the simple API to set these 'USB device override values'
* '''Source''': add one line to the device list in '[http://svn.spench.net/main/gr-baz/lib/rtl2832.cc rtl2832.cc]'

[[File:Ezcap EzTV668.jpg|thumb|center|800px|The ezcap EzTV668 with E4000 tuner]]

== Tuners ==

* '''Tuners are probed automatically now!'''

Supported tuners:
* Elonics E4000 (original: ''e4000'', improved: ''e4k'')
* Fitipower FC0013 (''fc0013'')
* Fitipower FC0012 (''fc0012'')
* Fitipower FC2580 (''fc2580'')

=== Manual override ===

You can override the tuner too, if you wish:

* '''Linux''': select the appropriate tuner from the list in the GRC block properties
* '''Windows''': add '''tuner='''''e4k/e4000/fc0012/fc0013/fc2580'' to the device hint

== librtl2832++ ==

This is '''[http://svn.spench.net/main/gr-baz/lib/rtl2832.cc cross-platform source code]'''. It is the [http://svn.spench.net/main/gr-baz/lib/rtl2832.h C++ interface] that abstracts the functionality of the hardware (demod & tuner).

The library compiles:
** as a [[USRP Interfaces#librtl2832++|DLL on Windows]]
** directly into the [[gr-baz]] '''baz''' module for GNU Radio

You can freely take the rtl2832-* files from the gr-baz [http://svn.spench.net/main/gr-baz/lib/ lib] directory and re-use them in any other project where you need to control an RTL2832U-based device!

== Specifications ==

{| class="wikitable" border="1"
|+ Magic numbers (ezcap EzTV)
|-
! Parameter || Notes
|-
| ADC Resolution || 8 bits
|-
| Dynamic range || (Not that great - theoretically 48 dB?, but still enough for many applications.)
This can be improved by:
# oversampling
# bandpass filtering
# decimating
See [http://www.atmel.com/Images/doc8003.pdf 1], [http://www.actel.com/documents/Improve_ADC_WP.pdf 2], [http://www-inst.eecs.berkeley.edu/~ee247/fa05/lectures/L24_f05.pdf 3].
|-
| Minimum sample rate || > 900 ksps ('''must be greater!''')
|-
| Maximum sample rate || 3.2 Msps
|-
| Nominal sample rate || 1 Msps (much higher leads to subtle signal degradation)
|-
| Clock || 28.8 MHz internal oscillator (expect large drift and phase noise)
|-
| Spectrum flatness || (Definitely not flat at centre, worse with low gain)
|-
| AGC || Disabled for E4000, but still active somewhere (in RTL2832 demod chip itself?)
You can test this by tuning a strong carrier to be near/on the centre frequency.

'''If you know about this, please [http://spench.net/contact tell me].
|-
| Sensitivity || TBD (decent all things considered)
|-
| Quality || Don't expect anything remotely close to a USRP.
|-
| Price || For ~$20 you'd be crazy not to try it!
|}

== Issues ==

=== E4000 DC offset loop ===

* '''Disabled E4000 DC offset loop to avoid period 'jumps' in time-domain signal''': I have disabled the DC offset loop in the E4000 tuner as I was seeing additional crud on the right of the centre frequency. In the time-domain, you can see it as a period jump in the incoming signal. I'll add an option to re-enable it so you can experiment (or you can modify the E4000 init function and un-comment the function call).

=== I2C errors ===

* These are avoided with the E4000 tuner by using the OsmoSDR '''e4k''' tuner code, instead of the original '''e4000''' code.
*: This can be done by using the ''tuner=e4k'' Device Hint in the ExtIO Device Hint on Windows, or, for GRC/GNU Radio, changing to the ''E4000 (OsmoSDR)'' item in the Tuners drop-down list in a RTL2832 Source (rtl_source_c) block's properties.

==== Rapid tuning ====

* '''I2C errors when tuning rapidly''': personally I haven't had this problem, except when using a GRC flowgraph where the down-stream sample rates are mismatched. However, other people have reported this in normal use. Therefore ''this issue is as yet unresolved'', as perhaps because the device wasn't designed to be rapidly re-tuned. One option is rate-limiting tune requests and/or investigating async control transfers in libusb.

* Should no longer occur with '''e4k''' tuner code ([[#I2C errors|see above]]).

==== Certain frequencies ====

* '''I2C failure when tuning certain frequencies on E4000''': For example, on both Windows and Linux if you tune to 90 MHz, then 89 MHz then back to 90 Mhz, you will see:
_I2CWriteByte: the control request was not supported by the device [-9] @ int PLL(rtl2832::tuner*, int, int):1749 "I2CReadByte(pTuner, 200, 5, writearray[0])"
* If you inspect the referenced E4000 PLL function, you will see an ''if'' blocks that set various registers depending on the requested tune frequency - this may hold the key. Otherwise, any other theories are welcome!

* Should no longer occur with '''e4k''' tuner code ([[#I2C errors|see above]]).

== Videos ==

* [http://youtu.be/FUQd9HOVTk8 GNU Radio support with rtl_source_c block] ('RTL2832 Source' block in GRC, found in [[gr-baz]])

* [http://www.youtube.com/watch?v=wShOLgW2tmI Using RTL2832 Source block in GNU Radio to receive P25]
*: An encrypted P25 transmission is received, which is decrypted and decoded by [http://op25.osmocom.org/ OP25]. Uses the [[gr-baz#op25|OP25 Decoder block]] in [[gr-baz]].

* [http://www.youtube.com/watch?v=bKzii5K3AqA Receiving aviation RADAR signals (Mode S)]
*: ADS-B transmissions are decoded by [[Modez]] and visualised with [http://spench.net/drupal/research/mode-s Aviation Mapper].

* [http://www.youtube.com/watch?v=Z0hEquzLsWU Installing and testing a dongle on Windows]
*: Covers WinUSB (libusb1) driver installation with Zadig, and testing with the [[USRP Interfaces|ExtIO plugin]] under HDSDR.

== External Resources ==

These are some helpful posts to help you get started (e.g. installation walk-thrus in different languages):

* http://sdr.osmocom.org/trac/wiki/rtl-sdr (Inspiration and original code)
* http://www.reddit.com/r/rtlsdr (Dedicated sub-reddit)
* http://www.reddit.com/r/RTLSDR/comments/s6ddo/rtlsdr_compatibility_list_v2_w (reddit compatibility list version 2)
* http://www.oz9aec.net/index.php/gnu-radio/gnu-radio-blog/465-eztv666-dvb-t-dongle-on-the-air
* http://sivantoledotech.wordpress.com/2012/04/25/dvbt-dongle/
* http://thenewtech.tv/it/dongular-deviation
* http://www.dxcoffee.com/ix1ckn/2012/04/ive-got-the-key/
* http://www.tsf70.com/forum/viewtopic.php?id=3570 (French installation guide)
* http://www.tsf70.com/forum/viewtopic.php?id=3652 (French test under Linux)
* http://sdr.ipip.cz/rtl-sdr (Czech)
* http://www.osslab.com.tw/Hardware/Hack/RTL-SDR (Taiwan)
* http://www.elektronik-labor.de/HF/NoxonSDR2.html (German)
* http://www.elektronik-labor.de/HF/NoxonSDR2_en.html
* http://radiolawendel.blogspot.com.au/2012/04/chiavette-usb-dvb-ora-si-possono.html (Italian)
* http://radiolawendel.blogspot.it/2012/04/chiavette-dvb-t-sdr-ultraeconomico-le.html (Italian)
* http://www.radiopassioni.it/pdf/Installazione%20USB%20USRP.pdf (Italian installation guide)
* http://www.ure.es/foro/6-tecnico/178786-sdr-con-receptor-tdt-usb.html?limit=10&start=100 (Spanish)
* http://www.hellocq.net/forum/read-htm-tid-291127-page-3.html (Chinese)
* http://www.divxea.tk/ (Spanish)

If you would like me to add a link, please [http://spench.net/contact contact me].

{{RF}}
Categories: Wiki

Aviation Mapper launch video - extended version

YouTube - Mon, 16/04/2012 - 15:10
Aviation Mapper launch video - extended version
maps.spench.net | Follow me @spenchdotnet twitter.com If you wish to share a feed into the system, please contact me: spench.net From: balint256 Views: 801 8 ratings Time: 07:42 More in Science & Technology
Categories: Off-site

Aviation Mapper is LIVE! (Demo at Sydney Airport next to runway 16R threshold)

YouTube - Mon, 16/04/2012 - 10:30
Aviation Mapper is LIVE! (Demo at Sydney Airport next to runway 16R threshold)
maps.spench.net | Follow me @spenchdotnet twitter.com If you wish to share a feed into the system, please contact me: spench.net From: balint256 Views: 3294 11 ratings Time: 03:36 More in Science & Technology
Categories: Off-site

World's cheapest aviation RADAR Mode S ADS-B receiver: AvMap + $20 RTL2832 Dongle

YouTube - Sat, 07/04/2012 - 02:17
World's cheapest aviation RADAR Mode S ADS-B receiver: AvMap + $20 RTL2832 Dongle
spench.net | wiki.spench.net Follow me @spenchdotnet: twitter.com RTL2832 for GNU Radio/Linux: wiki.spench.net For Windows (ExtIO plugin): wiki.spench.net Google Group: groups.google.com Remember: this is only a proof-of-concept! My previous Mode S experiments have used the USRP 1+WBX. With a good antenna and bandpass filter, AvMap has heard squitters at 514 km. Using the cheap RTL2832-based receiver results in far less range (due to poor dynamic range and other mysteries still enabled in the RF chain). From: balint256 Views: 4232 22 ratings Time: 02:48 More in Science & Technology
Categories: Off-site

World's cheapest P25 receiver w/ decryption: GNU Radio + OP25 + $20 RTL2832 DVB-T Dongle

YouTube - Thu, 05/04/2012 - 18:37
World's cheapest P25 receiver w/ decryption: GNU Radio + OP25 + $20 RTL2832 DVB-T Dongle
wiki.spench.net Follow me @spenchdotnet twitter.com OP25: op25.osmocom.org I will submit the OP25 Decoder GRC block, DES-OFB decryption support and other enhancements to the OP25 project soon! The 'Message Callback' block is part of gr-baz, and allows messages sent by blocks to trigger functions (variable 'set' updates) in the Python code generated by GRC. In this case it allows the FSK4 demodulator to fine-tune the frequency offset of its input. From: balint256 Views: 5498 46 ratings Time: 05:52 More in Science & Technology
Categories: Off-site

GNU Radio + RTL2832 DVB-T USB stick = $20 ultra-cheap Software Defined Radio

YouTube - Fri, 30/03/2012 - 01:48
GNU Radio + RTL2832 DVB-T USB stick = $20 ultra-cheap Software Defined Radio
Source code: wiki.spench.net Also for Windows: wiki.spench.net twitter.com For discussion, head to new Google Group: groups.google.com This video features the same device used with Winrad/HDSDR/WRplus: www.youtube.com Compatible devices should be: ezcap, Hama nano & Terratec NOXON (get the first two as it has a better tuner - the Elonics 4000, same as FUNcube Dongle, broadest frequency range: 64-1700 MHz). This all started here (info & code): sdr.osmocom.org From: balint256 Views: 15716 52 ratings Time: 03:23 More in Science & Technology
Categories: Off-site

$20 ultra-cheap Software Defined Radio with RTL2832 DVB-T USB stick

YouTube - Thu, 29/03/2012 - 17:04
$20 ultra-cheap Software Defined Radio with RTL2832 DVB-T USB stick
Download it here: spench.net Also: Source block for GNU Radio: wiki.spench.net twitter.com For discussion, head to new Google Group: groups.google.com Compatible devices should be: ezcap, Hama nano & Terratec NOXON (get the first two as it has a better tuner - the Elonics 4000, same as FUNcube Dongle, broadest frequency range: 64-1700 MHz). This all started here (info & code): sdr.osmocom.org My ExtIO plugin also supports all USRPs, the FUNcube Dongle and network streaming using BorIP (see it here: www.youtube.com You can also send the received baseband data over the network to GNU Radio using the UDP Source block. From: balint256 Views: 24267 101 ratings Time: 03:30 More in Science & Technology
Categories: Off-site

Gr-baz

Wiki - Sat, 24/03/2012 - 09:26

Balint: /* Updates */

== General ==

gr-baz is a GNU Radio project that adds new functionality (blocks, GRC definitions, apps, etc). It uses the standard GNU Radio block source tree layout and build process (i.e. ''./configure'', ''make'' and ''sudo make install'').

Part of the new functionality makes it easier to analyse signals. For example, performing cyclostationary analyis (see Variable Delay block below) and [[Fast Auto-correlation]]. You can then do things like:
* Blind signal analysis of satellite transmissions
** I presented this, along with my [[Modez|Mode S RADAR 3D]] airspace visualisation, in a talk entitled "Hacking the wireless world with Software Defined Radio" at Ruxcon 2011: http://www.youtube.com/watch?v=Vn-dpUegUDQ
* [[OFDM|OFDM/DRM]] analysis
** I put together a video on analysing signals on HF with these blocks in GNU Radio: http://www.youtube.com/watch?v=ZuRcaxpbYCw

'''NOTE:''' A few components will not work (e.g. BorIP client) without applying certain [[GNU Radio Patches|patches]] to your GNU Radio source. Please see below.

The module name is '''baz''', so in Python one would write:

baz.<block>(args)

To import a file (e.g. borip):

from baz import <file>

If you make any improvements on this code, please [http://spench.net/contact get in touch]!

== Source code ==

You can get the master copy here with '''SVN''', or browse with '''HTTP''':

* http://svn.spench.net/main/gr-baz/

The code is also available on github if you prefer '''git''' (and perhaps want to fork it there):

* https://github.com/balint256/gr-baz

'''NOTE''': You must have libusb-1.0 header+lib available! This is often easily installed using your favourite package manager. (I haven't yet had the time to fix the Automake configure script to check for it.)

== Components ==

== [[GNU Radio Patches|patch]] ==

Before using various blocks in gr-baz, you must apply at least some of the [[GNU Radio Patches|patches]] contained in this directory to your GNU Radio source tree. For example: you must update gr_udp_source if you wish to use it as a [[BorIP]] client.

== [http://svn.spench.net/main/gr-baz/lib/ lib] (C++) ==

=== [http://svn.spench.net/main/gr-baz/lib/baz_rtl_source_c.cc rtl_source_c] ===

==== Updates ====

----

For updates, follow me [http://twitter.com/spenchdotnet @spenchdotnet].

For feedback, please [http://spench.net/contact get in touch].

Change list (''SVN revision/git commit''):
<!--
* Added support for Hama nano (VID 0bda PID 2832)
* Locks disabled for gain/frequency setting
* ''r661/feaf6c8'': '''Greatly improved internal buffering''' (should have better performance now, although frequency/gain changes still take a moment - not sure I can do anything about that...)
* ''r663/ac9a7953b6'':
** Corrected tuning bug with FC0013 (no more I2C failures)
** Added support for Dexatek Technology dongle (1d19:1101)
** Gain range is printed, and input out-of-range gain is clipped to range supported by tuner
* ''r664/1b40f66'': Added NOXON revision 2 (0ccd:00e0). This contains the '''wrong''' tuner type - update to the next!
* ''r665/48c57ab'':
** Changed NOXON rev 2 tuner to ''correct'' E4000
** Normalised complex float output [1.0f,1.0f)
-->
* ''r668''/d03c816: Completely re-written, new GRC block
* ''r677''/47e6641: Support for FC0012/FC2580, compilation of librtl2832++ on Windows (MSVC)
* ''r679''/51ba95b: More devices (DIKOM, Dexatek 3)

----

==== General ====

* There are new demo videos showing it receiving:
*# an encrypted P25 transmission, which is decrypted and decoded by [http://op25.osmocom.org/ OP25]: http://www.youtube.com/watch?v=wShOLgW2tmI (See the screenshot below for the flowgraph and new 'OP25 Decoder' block.)
*# aviation RADAR signals (Mode S ADS-B), which are decoded by [[Modez]] and visualised with [http://spench.net/drupal/research/mode-s Aviation Mapper]: http://www.youtube.com/watch?v=bKzii5K3AqA

You can see the original demo video of this block running from GRC here: http://youtu.be/FUQd9HOVTk8

If you want to use this on Windows, get the [[USRP Interfaces]] plugin and watch this one for installation instructions and a demo: http://youtu.be/Z0hEquzLsWU

This is a straight-forward block for receiving samples directly from a USB DVB-T stick that uses the Realtek RTL2832 demodulator and associate tuners (see list below).

The demodulator itself samples at 8-bit I/Q, and then this block re-processes this to output complex values (''gr-complex'').

It also supports:
* LNA gain control (the gain range depends on the tuner)
* for the E4000: optional automatic tuner mode control (enabled via ''auto_tuner_mode''. This is activated when changing the gain and will calculate whether to use the nominal/sensitive/linear tuner mode).
<!--
----

'''A call to action:''' There are many more tuners out there! If you have an unsupported tuner, please consider getting the source code and implementing it. It's actually not much work: all the tuners' interface code has already been written for the Linux 3.0 DVB-T/V4L RTL2832 kernel driver. It's just a matter of moving and fixing the appropriate files, and calling a couple of functions! (I happened to get the ''DVB kernel driver'' code from https://github.com/mbarbon/rtl2832.git for 2.6 support, and there also https://gitorious.org/rtl2832 which I believe should work with the latest kernels - as it didn't compile on 2.6)

----
-->

==== Specs ====

{{RTL2832}}

==== Notes ====

* Internally the source block is multithreaded to ensure smooth buffering of samples from the device, and delivery to GNU Radio's runtime.

* The source code itself is based on my [[USRP Interfaces]] plugin for Winrad/HDSDR/WRplus, which is in turn based on Osmocom's [http://sdr.osmocom.org/trac/wiki/rtl-sdr rtl-sdr]. Please see the Osmocom page for more information on where to get an adapter, the original source code, etc.

* If the USB device is disconnected at runtime, the block detects this and signals EOF to the runtime.

* I have '''modified the operation of the E4000 tuner''' to yield (in my opinion) better receiver performance. Specifically I have fixed it to manual gain control and also '''disabled the DC offset loop''' as on my device it was the cause of annoying interference just to the right of 0 Hz (the LO).

* This block requires libusb-1.0 to compile. Please have the development files installed.

* The block outputs four short strings to notify you of streaming problems:
** '''rO''': Overflow inside libusb
** '''rB''': Overrun in streaming buffer (buffer consumption is too slow - have you set your resampling rates correctly?)
** '''rT''': The device did '''not''' yet submit new samples by the time it should have (i.e. the calculated libusb read interval + a little extra = 'Wait delay'), ''but'' the consumer is already asking for more samples - so we immediately give the consumer the samples from the buffer to avoid a pause in processing. Too many of these and...
** '''rU''': The internal buffer has underrun after too many consumer requests and not enough data coming in from the device via libusb. The block will now re-buffer to the 'Buffer level' (per cent) before sending any more samples to the consumer.

==== Permissions ====

To run with non-elevated privileges, choose <group name, e.g. 'dvb'>, and as root:

/usr/sbin/groupadd [group name]
/usr/sbin/usermod -G [group name] -a [user name]

Create the file:

/etc/udev/rules.d/10-[pick a name].rules

and add the following to it:

# rule to grant read/write access on USRP to group named usrp.
# to use, install this file in /etc/udev/rules.d as 10-usrp.rules
ACTION=="add", BUS=="usb", SYSFS{idVendor}=="[your VID]", SYSFS{idProduct}=="[your PID]", GROUP:="[group name]", MODE:="0660"

Then:

invoke-rc.d udev reload (or restart if you wish)

Have a look to see if the group for your device has changed (and mode should be '''crw-rw----'''):

ls -lR /dev/bus/usb

Then restart (unfortunately).

==== Issues ====

If, when you run the flowgraph, libgnuradio-baz.so.0 cannot be found, run:
sudo ldconfig

==== Interface ====

<source lang="cpp">

GR_SWIG_BLOCK_MAGIC(baz,rtl_source_c);

baz_rtl_source_c_sptr baz_make_rtl_source_c (bool defer_creation = false);

class baz_rtl_source_c : public gr_sync_block
{
private:
baz_rtl_source_c(bool defer_creation = false);
public:
void set_defaults();
bool create(bool reset_defaults = false);
void destroy();
public:
void set_vid(/*uint16_t*/int vid);
void set_pid(/*uint16_t*/int pid);
void set_default_timeout(int timeout); // 0: use default, -1: poll only
void set_fir_coefficients(const std::vector</*uint8_t*/int>& coeffs);
void set_crystal_frequency(uint32_t freq);
void set_tuner_name(const char* name);
public:
size_t recv_samples_per_packet() const;
uint64_t samples_received() const;
uint32_t overflows() const;
bool running() const;
uint32_t buffer_size() const;
uint32_t buffer_times() const;
bool buffering() const;
uint32_t read_packet_count() const;
uint32_t buffer_overflow_count() const;
uint32_t buffer_underrun_count() const;
public:
void set_verbose(bool on = true);
void set_read_length(/*uint32_t*/int length);
void set_buffer_multiplier(/*uint32_t*/int mul);
void set_use_buffer(bool use = true);
void set_buffer_level(float level);
public:
bool relative_gain() const;
bool verbose() const;
uint32_t read_length() const;
uint32_t buffer_multiplier() const;
bool use_buffer() const;
float buffer_level() const;
public:
bool set_sample_rate(double sample_rate);
bool set_frequency(double freq);
bool set_gain(double gain);
bool set_bandwidth(double bandwidth);
bool set_gain_mode(int mode);
bool set_gain_mode(const char* mode);
void set_relative_gain(bool on = true);
int set_auto_gain_mode(bool on = true);
public:
double sample_rate() const;
RTL2832_NAMESPACE::range_t sample_rate_range() const;
double frequency() const;
double gain() const;
double bandwidth() const;
int gain_mode() const;
std::string gain_mode_string() const;
bool auto_gain_mode() const;
public: // SWIG get: tuner ranges/values
RTL2832_NAMESPACE::range_t gain_range() const;
RTL2832_NAMESPACE::values_t gain_values() const;
RTL2832_NAMESPACE::range_t frequency_range() const;
RTL2832_NAMESPACE::range_t bandwidth_range() const;
RTL2832_NAMESPACE::values_t bandwidth_values() const;
RTL2832_NAMESPACE::num_name_map_t gain_modes() const;
std::pair<bool,int> calc_appropriate_gain_mode()/* const*/;
};
</source>

==== Screenshots ====

[[File:RTL2832-FM-GRC.png|center|thumb|800px|Channel selection and FM demodulation with RTL2832 Source]]

[[File:RTL2832-OP25-GRC.png|center|thumb|800px|RTL2832 Source feeding new OP25 Decoder block]]

[[File:RTL2832-GRC.png|center|frame|Example of the GRC Source block in a flowgraph]]

[[File:RTL2832 FFT.png|center|thumb|480px|The above flowgraph running]]

=== [http://svn.spench.net/main/gr-baz/lib/baz_delay.cc delay] ===

Unlike the original gr_delay block that has a fixed delay, this allows for a ''variable'' delay that can be changed at runtime. The delay can be positive or negative. If any padding is required, it uses the value of the last sample.

This block is particularly useful for investigating periodic repetitions within signals (e.g. adjusting cyclostationary lag when performing blind analysis on an [[OFDM]] signal).

<source lang="cpp">
GR_SWIG_BLOCK_MAGIC(baz,delay)

baz_delay_sptr baz_make_delay (size_t itemsize, int delay);

class baz_delay : public gr_sync_block
{
private:
baz_delay (size_t itemsize, int delay);

public:
int delay() const;
void set_delay (int delay);
};
</source>

[[File:GRC_Variable_Delay_Cyclo.png|center|frame|Using the Variable Delay block to adjust the delay of samples into Complex Conjugate/Multiply blocks in order to find the cyclostationarity of the input signal (i.e. perform cyclostationary analysis to determine the periodicity of the signal to find the symbol or baud rate of the raw modulated data - helpful for blind signal anaylsis).]]

=== [http://svn.spench.net/main/gr-baz/lib/baz_pow_cc.cc pow_cc] ===

Raise incoming signal to a power (''exponent''), and optionally divide resulting signal by 10^''div_exp'' to ensure it doesn't go too high and result in NaNs/Infinity in subsequent floating-point calculations.

<source lang="cpp">
GR_SWIG_BLOCK_MAGIC(baz,pow_cc);

baz_pow_cc_sptr
baz_make_pow_cc (float exponent, float div_exp = 0.0);

class baz_pow_cc : public gr_sync_block
{
baz_pow_cc (float exponent, float div_exp = 0.0);
public:
void set_exponent(float exponent);
void set_division_exponent(float div_exp);
float exponent() const;
float division_exponent() const;
};
</source>

[[File:GRC_Pow_Block.png|center|frame|Using the Power block to determine the order of a PSK signal (i.e. determine the ''n'' of a phase-shift keyed signal, e.g. BPSK, QPSK, 8PSK).]]

=== [http://svn.spench.net/main/gr-baz/lib/baz_print_char.cc print_char] ===

Print bytes to the console/stdout (or optionally a ''file''). The hexadecimal values of the bytes are printed, rather than the raw character interpretation of the value.

This block accepts a byte-stream input (containing the data to print), and an ''optional'' float-stream (a variable length signal to be used as the trigger for printing). The ''threshold'' can be set to only print bytes when the values in the float-stream exceed the specified threshold. To prevent too much data being printed, set ''limit'' to the total number of characters to be printed. This is reset each time the float-stream drops below the trigger threshold (i.e. it can be used to print the first ''limit'' demodulated bytes when the receiver becomes unsquelched, e.g. [[VDL Mode 2]]).

<source lang="cpp">
GR_SWIG_BLOCK_MAGIC(baz,print_char);

baz_print_char_sptr baz_make_print_char (float threshold = 0.0, int limit = -1, const char* file = NULL);

class baz_print_char : public gr_sync_block
{
private:
baz_print_char (float threshold, int limit, const char* file);
};
</source>

=== [http://svn.spench.net/main/gr-baz/lib/baz_puncture_bb.cc puncture_bb]/[http://svn.spench.net/main/gr-baz/lib/baz_depuncture_ff.cc depuncture_ff] ===

Puncture a stream of bytes after '''F'''orward '''E'''rror '''C'''orrection to reduce the code rate from that of the mother code.

Also, depuncture a stream of floats (symbols) to restore the rate of the received code to that of the mother code prior to detecting the code for errors. Missing symbol slots are marked by erasures (the value 0 is inserted into the outgoing float symbol stream).

The ''matrix'' parameter can be set at design '''and''' runtime. Here are some examples taken from ''autofec'' (see below):

<source lang="python">
_puncture_matrices = [ # Format is ('name', matrix, rate ratio)
('1/2', [1,1], (1, 2)),
('2/3', [1,1,0,1], (2, 3)),
('3/4', [1,1,0,1,1,0], (3, 4)),
('5/6', [1,1,0,1,1,0,0,1,1,0], (5, 6)),
('7/8', [1,1,0,1,0,1,0,1,1,0,0,1,1,0], (7, 8)),
('2/3*', [1,1,1,0], (2, 3)),
('3/4*', [1,1,1,0,0,1], (3, 4)),
('5/6*', [1,1,1,0,0,1,1,0,0,1], (5, 6)),
('7/8*', [1,1,1,0,1,0,1,0,0,1,1,0,0,1], (7, 8))
</source>

<source lang="cpp">
GR_SWIG_BLOCK_MAGIC(baz,puncture_bb)

baz_puncture_bb_sptr baz_make_puncture_bb (const std::vector<int>& matrix);

class baz_puncture_bb : public gr_block
{
private:
baz_puncture_bb (const std::vector<int>& matrix);

public:
void set_matrix (const std::vector<int>& matrix);
};
</source>

<source lang="cpp">
GR_SWIG_BLOCK_MAGIC(baz,depuncture_ff)

baz_depuncture_ff_sptr baz_make_depuncture_ff (const std::vector<int>& matrix);

class baz_depuncture_ff : public gr_block
{
private:
baz_depuncture_ff (const std::vector<int>& matrix);

public:
void set_matrix (const std::vector<int>& matrix);
};
</source>

=== [http://svn.spench.net/main/gr-baz/lib/baz_swap_ff.cc swap_ff] ===

Swap pairs of incoming float samples (if disabled, acts in pass-through mode).

<source lang="cpp">
GR_SWIG_BLOCK_MAGIC(baz,swap_ff)

baz_swap_ff_sptr baz_make_swap_ff (bool bSwap);

class baz_swap_ff : public gr_sync_block
{
private:
baz_swap_ff (bool bSwap);

public:
void set_swap (bool bSwap);
};
</source>

=== [http://svn.spench.net/main/gr-baz/lib/baz_test_counter_cc.cc test_counter_cc] ===

Used to check a simulated complex stream. The I and Q values are not a real signal; they are values that should count upward together. If values are dropped, or go out of sync, this block will report problems to stderr.

A source of such a test stream is the [[ExtIO_USRP]] plugin. To enable 'test mode', add the following DWORD to the registry:

HKEY_CURRENT_USER\<Winrad/HDSDR/WRplus/etc>\ExtIO_USRP\Settings\m_bTestMode = 1

<source lang="cpp">
GR_SWIG_BLOCK_MAGIC(baz,test_counter_cc);

baz_test_counter_cc_sptr baz_make_test_counter_cc ();

class baz_test_counter_cc : public gr_sync_block
{
baz_test_counter_cc ();
};
</source>

=== [http://svn.spench.net/main/gr-baz/lib/baz_unpacked_to_packed_bb.cc unpacked_to_packed_bb] ===

This is the missing combination of operations of those blocks included in the GNU Radio source tree. This one here will take ''bits_per_chunk'' from the incoming byte stream and reassemble outgoing bytes to contain ''bits_into_output'' bits from the original stream. For example: in [[VDL Mode 2]] the D8PSK demodulator outputs an unpacked byte stream (which is really the equivalent of a bit stream). This block can be used to reassemble the individual 8PSK symbols into individual bytes (i.e. 3 bits in a byte, so output value ranges from 0 to 7).

<source lang="cpp">
GR_SWIG_BLOCK_MAGIC(baz,unpacked_to_packed_bb);

baz_unpacked_to_packed_bb_sptr
baz_make_unpacked_to_packed_bb (unsigned int bits_per_chunk, unsigned int bits_into_output, /*gr_endianness_t*/int endianness = GR_MSB_FIRST);

class baz_unpacked_to_packed_bb : public gr_block
{
baz_unpacked_to_packed_bb (unsigned int bits_per_chunk, unsigned int bits_into_output, /*gr_endianness_t*/int endianness);
};
</source>

=== [http://svn.spench.net/main/gr-baz/lib/baz_agc_cc.cc agc_cc] ===

Experimental and unfinished.

== [http://svn.spench.net/main/gr-baz/python/ python] ==

=== [http://svn.spench.net/main/gr-baz/python/borip.py borip] ===

'''NOTE:''' You must apply the appropriate [[GNU Radio Patches|patch]] to enable BorIP support in gr_udp_source first!

Enables [[BorIP]] client support in GNU Radio. Either access this class directly in hand-written Python code, via the GRC block (see below), or enable seamless connection to a remote USRP exposed to your LAN with [[USRP Interfaces|BorIP server]].

BorIP has some neat features for using a USRP 1 over a network (more details in the [[BorIP]] specification):
* Data packets contain a header (optional, enabled by default) that enables the receiver to keep track of capture overruns on the server, and packets lost on the network.
* Transparent operation (see below)
* Automatically handle connection interruption without affecting the flowgraph's operation: if contact is lost with the BorIP server (e.g. network is unplugged, server power lost, etc), the UDP data stream would stop, and eventually the server would stop sending data and disconnect after the TCP control connection closes. The BorIP client can be configured to automatically reconnect to the server in the background and start streaming data again as if nothing had happened.

The UDP receiving code will process BorIP packets and output losses ('''bO''') and incorrect payload sizes ('''b!''') to stderr. '''uO''' is also output when the remote server experiences a capture overrun.

==== Operational modes ====

* Traditional UDP Source that handles BorIP data packets
** '''NOTE:''' There is no TCP control channel established (unlike the proper BorIP Source block), so control commands cannot be sent to a server. This mode is suited for use with the UDP Relay option in the [[ExtIO_USRP|ExtIO_USRP+FUNcube Dongle plugin]].

[[File:GRC UDP Source (BorIP).PNG|800px|thumb|center|The original UDP Source block with added BorIP support (also features the Test Counter block)]]

* Proper BorIP Source that also establishes a control channel to communicate radio configuration to the server
** This block operates more like a traditional USRP Source block in that one can configure parameters such as sample rate, frequency, gain and antenna:

[[File:GRC BorIP Source.PNG|center|The new BorIP Source block with additional configurable parameters]]

To enable seamless support, add the following to ''gr-usrp/src/__init__.py'':
<!-- snip -->
import sys
if not sys.modules.has_key('baz.borip'):
from baz import borip

This tells Python to import ''borip'' whenever the Python-bindings for the USRP are requested. BorIP automatically patches into ''usrp_source_c'' and will attempt to connect to a BorIP server if no local device is present. The default server address is specified in ''~/.gnuradio/config.conf'':

[borip]
server=<server address>
<!-- snip -->
The other settings are:
reconnect_attempts=<# of reconnection attempts before signalling EOF to the flowgraph, -1 to try forever, default is 0>
reconnect_interval=<seconds between connection attempts, default 5 seconds>
keepalive_interval=<seconds between sending PING keepalive, default is 5 seconds>
verbose={True,False} <i>Verbose mode prints commands sent between client and server</i>
default_port=<TCP and UDP port to use, default is 28888>

If you use the BorIP Source GRC block, the generated code will '''NOT''' honour the ''reconnect_attempts'' specified in the above config file. Instead it will always take it from the parameter set for the GRC block instance.

=== [http://svn.spench.net/main/gr-baz/python/auto_fec.py auto_fec] ===

Automatically try every combination of FEC parameters until the correct ones are found (determined by monitoring BER output by Viterbi decoder).

This uses the NASA Voyager (k=7) convolutional code.

[[File:AutoFEC-Block.png|center|Auto FEC block (MPSK symbols in, deFEC'd data out with measure of BER and FEC-lock signal]]

Leave 'sample rate' parameter at 0 to have it interpret duration/periods as number of samples (this should work fine in all cases anyway). If you specify the sample rate, you can optionally engage the internal Throttle if playing back from a file.

=== [http://svn.spench.net/main/gr-baz/python/eye.py eye] ===

This draws upon the Data Scope originally by Max (KA1RBI) from [http://op25.osmocom.org/ OP25]. The block allows for changing certain sampling/graphical parameters at runtime (see GRC block definition below).

[[File:GR_Eye_Diagram.png|480px|thumb|center|Eye diagram showing 2-level signal]]

=== [http://svn.spench.net/main/gr-baz/python/facsink.py facsink] ===

Please see [[Fast Auto-correlation]].

[[File:GRC-FAC.png|480px|thumb|center|[[Fast Auto-correlation]] block at bottom-right]]

== [http://svn.spench.net/main/gr-baz/grc/ grc] ==

GRC XML block definitions for:
* [http://svn.spench.net/main/gr-baz/grc/baz_rtl_source_c.xml '''rtl_source_c''']: RTL2832 Source
* [http://svn.spench.net/main/gr-baz/grc/baz_agc_xx.xml '''agc''']: AGC (Baz) - this is unfinished
* [http://svn.spench.net/main/gr-baz/grc/baz_auto_fec.xml '''auto_fec''']: Auto FEC
* [http://svn.spench.net/main/gr-baz/grc/baz_borip_source.xml '''borip_source''']: BorIP Source
* [http://svn.spench.net/main/gr-baz/grc/baz_delay.xml '''delay''']: Variable Delay
* [http://svn.spench.net/main/gr-baz/grc/baz_puncture_bb.xml '''puncture_bb''']/[http://svn.spench.net/main/gr-baz/grc/baz_depuncture_ff.xml '''depuncture_ff''']: Puncture/Depuncture
* [http://svn.spench.net/main/gr-baz/grc/baz_pow_cc.xml '''pow_cc''']: Power
* [http://svn.spench.net/main/gr-baz/grc/baz_swap_ff.xml '''swap_ff''']: Swap
* [http://svn.spench.net/main/gr-baz/grc/baz_test_counter_cc.xml '''test_counter_cc''']: Test Counter
* [http://svn.spench.net/main/gr-baz/grc/eye.xml '''eye''']: Eye Diagram
* [http://svn.spench.net/main/gr-baz/grc/facsink.xml '''facsink''']: [[Fast Auto-correlation|Fast AutoCorrelation Sink]]
* [http://svn.spench.net/main/gr-baz/grc/gr_mpsk_receiver_debug_cc.xml '''gr_mpsk_receiver_debug_cc''']: MPSK Receiver (Debug)
** Requires appropriate [[GNU Radio Patches|patch]] to gr_mpsk_receiver_debug.cc

Also, this contains patches for GRC to enable [[GRC Any Blocks|'any' block]] support. This enables you to use raw GNU Radio blocks by typing in the necessary Python function to create the block (without a dedicated GRC XML block definition). For example: I use it with baz.print_char

* [http://svn.spench.net/main/gr-baz/grc/baz_any_source.xml '''baz_any_source''']: Any Block Source (for source blocks)
* [http://svn.spench.net/main/gr-baz/grc/baz_any_sink.xml '''baz_any_sink''']: Any Block Sink (for sink blocks)
* [http://svn.spench.net/main/gr-baz/grc/baz_any.xml '''baz_any''']: Any Block (for blocks with I/O)

You can either apply the following two patches, OR apply one from the [[GNU Radio Patches|patch page]]:
* [http://svn.spench.net/main/gr-baz/grc/Block.py.diff Block.py.diff]
* [http://svn.spench.net/main/gr-baz/grc/Port.py.diff Port.py.diff]

[[File:GRC Any Blocks.png|800px|thumb|center|Examples of [[GRC Any Blocks]]]]

== [http://svn.spench.net/main/gr-baz/apps/ apps] ==

=== [http://svn.spench.net/main/gr-baz/apps/am_fft.py am_fft] ===

The [[AM Scope]] has the same functionality as usrp_fft.py, however the AM (magnitude) signal is shown instead of the original complex one.

Also allows for changing receive antenna in the GUI.

[[File:AM-FFT_Scope.png|480px|thumb|center|[[Modez|Mode S]] transmission in AM]]

=== [http://svn.spench.net/main/gr-baz/apps/usrp_fac.py usrp_fac] ===

Stand-alone app for using the [[Fast Auto-correlation]] Sink.

[[File:W-CDMA FAC.png|480px|thumb|center|[[W-CDMA]] mobile signal (this is actually a GRC-generated GUI, but the stand-alone app look similar and can be configured with command-line arguments)]]

{{RF}}
Categories: Wiki

GNU Radio Patches

Wiki - Fri, 23/03/2012 - 22:53

Balint: /* usrp-init */

== Overview ==

This page details modifications I have made to GNU Radio, and the patches you can use to modify your own code.

'''IMPORTANT:''' Be careful when applying patches! I have grouped my patches by the version of GNU Radio that I modified. Most of them should work on newer versions of the source tree, but make sure you backup anything important before applying them. YMMV!

== Seamless BorIP Source ==

If you wish to have seamless integration of [[BorIP]] with GNU Radio (i.e. still use all flowgraphs that would make use of a locally-connected USRP 1), do the following:

# Download [[gr-baz]]
# Apply one of the patches (depending on your version of GNU Radio) below to enable BorIP support in gr_udp_source
# Compile and install [[gr-baz]]
# Add the following to ''gr-usrp/src/__init__.py'':

import sys
if not sys.modules.has_key('baz.borip'):
from baz import borip

This tells Python to import ''borip'' whenever the Python-bindings for the USRP are requested. BorIP automatically patches into ''usrp_source_c'' and will attempt to connect to a BorIP server if no local device is present. The default server address is specified in ''~/.gnuradio/config.conf'':

[borip]
server=<server address>

'''NOTE:''' This modification is already included in the 3.4.1-13-gcb23b7a2 patches, so it is only necessary if you do not apply them (or at the very least want to know what's going on).

== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/ 3.3git-740-ge2222445] ==

Combined patch bundle: [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/gnuradio-3.3git-740-ge2222445.diff gnuradio-3.3git-740-ge2222445.diff]

'''NOTE:''' The ''bundle'' above does NOT include the following individual patches:
* baz_grc_any_blocks ([[GRC Any Blocks|GRC 'any' blocks]]):
** This is because you may have already applied the patch from gr-baz. If not, apply either this one, or the individual ones from gr-baz.
* blks_dxpsk_demod-corrected:
** The errors in this file in this version of GNU Radio were corrected in later versions. Only apply this patch if your file is in error (check the patch to see what is wrong with the old file).
* gr_udp_source-borip
** This version of the patch completely overhauls the OLD version of gr_udp_source to the version in the newer GNU Radio. Apply this manually if you still have the old version. Otherwise use the patch for the newer version below.

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/baz_grc_any_blocks.diff baz_grc_any_blocks] ===

''Not in bundle.''

Enables support for [[GRC Any Blocks|'any' blocks in GRC]].

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/blks2_dxpsk_demod-corrected.diff blks2_dxpsk_demod-corrected] ===

''Not in bundle.''

Fixes incorrect arguments supplied in GRC XML block definition. This has been fixed in later versions of GNU Radio, so check if you still need to apply this patch.

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/constsink-variable_symbol_rate.diff constsink-variable_symbol_rate] ===

Allows for changing of the symbol rate at runtime (i.e. no longer fixed from design time).

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/cpm-Numeric.diff cpm-Numeric] ===

Minor change to cpm modulator to use Numeric instead of Numpy (so it actually runs).

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/gr_clock_recovery_mm_xx-error_out.diff gr_clock_recovery_mm_xx-error_out] ===

Adds second optional output to Clock Recovery GRC block so that the error value is also output by the block.

'''NOTE:''' This is only supported by the Complex (_cc) version, and not the Float (_ff) version. (Sorry, I didn't get around to fixing the _ff one.)

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/gr_decode_ccsds_27_fb-viterbi.diff gr_decode_ccsds_27_fb-viterbi] ===

Changes the decoder to track the branch metric value, and output it as a measure of BER from the GRC block. This is good for determining whether the correct deFEC parameters have been chosen with the appropriate gr-baz blocks.

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/gr_mpsk_receiver_cc-debug.diff gr_mpsk_receiver_cc-debug] ===

Output all the internal states of the receiver through new block outputs (also shown in GRC 'Debug' block). This is useful to send the states to different files, which can then be graphed in GNU Plot to determine how well the receiver is locking on to the input PSK signal.

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/gr_udp_source-borip.diff gr_udp_source-borip] ===

''Not in bundle.''

Added [[BorIP]] support to the UDP Source block and exposes various settings in GRC.

'''NOTE:''' This patch completely overhauls the OLD version of gr_udp_source to the new version. If you already have a more recent version of GNU Radio, please consider using the appropriate newer patch below.

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/gr_vector_source_X-set.diff gr_vector_source_X-set] ===

Change the reference vector at runtime (i.e. no longer fixed from design time).

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/gr_wavfile-auxi.diff gr_wavfile-auxi] ===

Enable the reader to handle WAV files with the 'auxi' RIFF chunk (e.g. recordings from HDSDR) instead of raising an exception.

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/rational_resampler-variable.diff rational_resampler-variable] ===

Updates the rational resampler to allow for runtime changes in the interpolation and decimation factors (i.e. no longer fixed from design time). This is helpful for experimenting with different resampling rates without having to restart the flowgraph.

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.3git-740-ge2222445/Xpsk-differential_encoding.diff Xpsk-differential_encoding] ===

Changes the PSK modulators to allow for optional differential encoding (i.e. no longer permanently enabled). Helpful if differential encoding is not desired, or done beforehand.

== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.4.1-13-gcb23b7a2/ 3.4.1-13-gcb23b7a2] ==

'''NOTE:''' If you are applying the following after applying the previous one, some of the patching will fail as your code should already have been updated (so it's not an error, it should just say that it appears to have already been patched). For example, you may have already applied the ''rational_resampler-variable'' update above, but the code is the same so it should just skip it (hopefully!).

Combined patch bundle: [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.4.1-13-gcb23b7a2/gnuradio-3.4.1-13-gcb23b7a2.diff gnuradio-3.4.1-13-gcb23b7a2.diff]

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.4.1-13-gcb23b7a2/am_demod-gain.diff am_demod-gain] ===

Allows for changing audio passband and stopband, and gain, at runtime (i.e. no longer fixed from design time).

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.4.1-13-gcb23b7a2/gr_agc_cc-nan.diff gr_agc_cc-nan] ===

Experimental fixes for handling hugely varying incoming signal values that cause the AGC to fall into a degenerate state (i.e. outputting NaNs).

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.4.1-13-gcb23b7a2/gr_udp_source-borip.diff gr_udp_source-borip] ===

Adds [[BorIP]] support the gr_udp_source and GRC block.

'''NOTE:''' This patch updates the new version of gr_udp_source (so this patch is considerably smaller than the previous one above that upgrades the old un-patched version of gr_udp_source to the new version with BorIP support).

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.4.1-13-gcb23b7a2/rational_resampler-variable.diff rational_resampler-variable] ===

''As above.''

Updates the rational resampler to allow for runtime changes in the interpolation and decimation factors (i.e. no longer fixed from design time). This is helpful for experimenting with different resampling rates without having to restart the flowgraph.

=== [http://svn.spench.net/main/gr-baz/patch/gnuradio-3.4.1-13-gcb23b7a2/usrp-init.diff usrp-init] ===

Adds seamless support for BorIP (via usrp.source_c) to GNU Radio, so all flowgraphs will still work with a remote USRP accessible via BorIP server. Remember to set the default server address (see BorIP note at top)!

{{RF}}
Categories: Wiki

HF and Software Defined Radio: HDSDR + USRP + GNU Radio + RFMap

YouTube - Sun, 18/03/2012 - 04:46
HF and Software Defined Radio: HDSDR + USRP + GNU Radio + RFMap
This is a tour through using SDR to receive HF: wiki.spench.net spench.net @spenchdotnet http HF with ultra-cheap-SDR RTL2832U-based DVB-T USB dongle: www.youtube.com Files are now available on BitTorrent: spench.net Please keep seeding! To use the recordings in GNU Radio, please apply this patch to your WAV File Source first: wiki.spench.net Otherwise you will encounter a 'runtime error' as the original code doesn't like HDSDR recordings. Transmission types covered: Whistlers Ionosondes Weather fax (WEFAX) Flight Information Service Link 11 (TADIL A) RTTY Over-the-Horizon RADAR STANAG 4285 Sweepers Unknown sweeping 'blocks' ACORN (Ocean RADAR) ALE (Automatic Link Establishment) OFDM (Orthogonal Frequency Division Multiplexing) DRM (Digital Radio Mondiale) Resources: maps.spench.net wiki.spench.net wiki.spench.net wiki.spench.net www.lucabarbi.it www.wavecom.ch imos.org.au www.codar.com http en.wikipedia.org ----------------------------------------------------------------------------------------------------- Links to SDR software packages: * You can use the cross-platform GNU Radio (used to do the pop-up analyses). It's a very powerful signal processing framework, so you can do almost anything in it: gnuradio.org * HDSDR (the main one) runs on Windows: www.hdsdr.de * Sigmira (used for STANAG, but also does all the standard analog modes+some other digital ones) is cross-platform: www.saharlow.com * There are other Linux/cross-platform ones like: napan.ca www.sm5bsz.com <b>...</b> From: balint256 Views: 21440 239 ratings Time: 17:46 More in Science & Technology
Categories: Off-site

Takeoff and landing at Sydney Airport with AvMap & Google Earth streaming live over the Net

YouTube - Thu, 15/03/2012 - 23:16
Takeoff and landing at Sydney Airport with AvMap & Google Earth streaming live over the Net
A demo of AvMap running live - streaming the state of Sydney airspace over the Internet (here via 3G) to Google Earth running in a web browser. spench.net @spenchdotnet twitter.com From: balint256 Views: 494 3 ratings Time: 08:09 More in Science & Technology
Categories: Off-site

Qantas 747 VH-OQF takeoff 34L SYD to LHR via SIN

YouTube - Mon, 12/03/2012 - 10:48
Qantas 747 VH-OQF takeoff 34L SYD to LHR via SIN
Get a load of the aviation parlance! Holy mackerel! From: balint256 Views: 121 0 ratings Time: 01:57 More in Film & Animation
Categories: Off-site

Night-only accumulated timelapse of Sydney Airport departures and arrivals

YouTube - Fri, 09/03/2012 - 10:48
Night-only accumulated timelapse of Sydney Airport departures and arrivals
By popular demand: the night-only version of www.youtube.com spench.net @spenchdotnet twitter.com From: balint256 Views: 514 5 ratings Time: 02:49 More in Film & Animation
Categories: Off-site

Test 'accumulated timelapse' of planes taking off and landing at Sydney Airport (afternoon to night)

YouTube - Wed, 07/03/2012 - 19:10
Test 'accumulated timelapse' of planes taking off and landing at Sydney Airport (afternoon to night)
First test of Logitech HD webcam pointed at YSSY + custom 'accumulated timelapse' frei0r plugin for ffmpeg (night-only version: www.youtube.com spench.net @spenchdotnet twitter.com From: balint256 Views: 641 4 ratings Time: 02:49 More in Film & Animation
Categories: Off-site

Software Defined Radio Direction Finding (SDRDF)

YouTube - Sun, 04/03/2012 - 16:21
Software Defined Radio Direction Finding (SDRDF)
How to do Radio Direction Finding with a Software Defined Radio (USRP/GNU Radio) spench.net @spenchdotnet twitter.com All non-original diagrams and pictures are used with fair use rationale for educational purposes. "Transmitter hunting: radio direction finding simplified" By Joseph D. Moell, Thomas N. Curlee books.google.com.au silcom.com en.wikipedia.org en.wikipedia.org en.wikipedia.org en.wikipedia.org From: balint256 Views: 1772 15 ratings Time: 26:10 More in Science & Technology
Categories: Off-site

Aviation Mapper

Gallery - Fri, 17/02/2012 - 16:17
Categories: Gallery

Amateur Radio Experimentation

Gallery - Fri, 17/02/2012 - 16:02
Categories: Gallery

OFDM

Wiki - Sun, 29/01/2012 - 14:58

Balint: /* Analysis in GNU Radio */

== General ==

* DVB-T [http://en.wikipedia.org/wiki/Crest_factor Crest factor] is greater than 8VSB (one reason why it wasn't adopted in the US).

== Blind Analysis ==

* Ning Han, Sung Sohn, Jae Moung, '''"A Blind OFDM Detection and Identification Method Based on Cyclostationarity for Cognitive Radio Application"''', IEICE Transactions on Communications, Volume E92-B, Number 6, pp. 2235-2238, June 2009.
** Find sub-carrier spacing and duration of guard interval.
** Exploit [http://en.wikipedia.org/wiki/Cyclic_prefix cyclic prefix] and cyclostationarity of OFDM due to transmitter pulse-shaping filter.
*** [http://www.technicaljar.com/?p=237 How the Cyclic Prefix works in OFDM], [http://www.technicaljar.com/?p=276 Part 2]

== DRM ==

* [http://www.drm-sender.de/?page=drm&lang=en '''D'''igital '''R'''adio '''M'''ondiale] ([http://en.wikipedia.org/wiki/Digital_Radio_Mondiale Wikipedia], [http://www.bbc.co.uk/rd/pubs/papers/paper_15/paper_15.shtml BBC])

Most common on HF is:

{| class="wikitable" border="1"
|+ Class B
|-
! Modulation property || Value
|-
| Un-guarded symbol time || 21.33 ms
|-
| Sub-carrier spacing || 46 7/8 Hz
|-
| Guard interval || 5.33 ms
|-
| Total symbol duration || 26.66 ms
|-
| Guard interval ratio || 1/4
|-
| Symbols per frame || 15
|}

[[File:HDSDR-DRM.png|800px|thumb|center|DRM OFDM signal clearly visible with distinctive sharp drop-off (there is a sonde operating on the righthand-side too, with decreasing sweep rate)]]

After capturing a DRM signal from '''R'''adio '''N'''ew '''Z'''ealand '''I'''nternational (above) and calculating the '''C'''yclic '''A'''utocorrelation '''F'''unction (CAF), it is confirmed to be class B:

[[File:DRM_CAF-Perspective.png|800px|thumb|center|CAF]]
[[File:DRM_CAF-Tu.png|800px|thumb|center|Confirmed to be DRM signal due to symmetric peaks at lag 0 (peak at ~21.33, which is un-guarded symbol time)]]
[[File:DRM_CAF-Period.png|800px|thumb|center|At lag based on un-guarded symbol time, multiple peaks appear due pulse-shaping filter and multiple symbols in OFDM signal. First peak at ~37.84 Hz = almost 26.6 ms, which is total symbol duration.]]

The guard interval is the difference between the total symbol duration and the un-guarded symbol time. The sub-carrier spacing is the inverse of the un-guarded symbol time.

=== MATLAB ===

One can define a CAF calculation function like so (to do it properly you would use variable arguments, etc):

<syntaxhighlight lang="matlab">
function [c,lag_labels,period_labels] = caf(x,start,len,tau,step,fft_range)

decim = 1;
len = len * decim;

if (tau > start)
error('tau > start');
elseif ((start + tau + len) > length(x))
error('length error')
end

c = [];
x_labels = [];

if fft_range > 0
mid = fft_range;
else
mid = floor(len/decim/2);
end

period_labels = (-mid:mid)';

for n = -tau:step:tau
% Progress for long signals
%if length(x) > (16384*2)
% disp(n);
%end
%n

% If you want to zero-pad the signal
%if n < 0
% t = cat(1, zeros(-n, 1), x(1:end+n));
%elseif n > 0
% t = cat(1, x(n+1:end), zeros(n, 1));
%else
% t = x
%end

t = x(start-n:start-n+len-1);
%length(t)

z = x(start:start+len-1).*conj(t);
if decim > 1
z = resample(z, 1, decim);
end

f = log10(abs(fftshift(fft(z))));
%length(f)

if fft_range > 0
mid = floor(length(f)/2)+1;
f = f(mid-fft_range:mid+fft_range);
end

c = cat(2, c, f);

lag_labels = cat(1, x_labels, [n]);
end

end
</syntaxhighlight>

Then you would take the following steps to analyse a signal:

<syntaxhighlight lang="matlab">
% This function can be found in an m file in the GNU Radio source tree
x = read_complex_binary('DRM.dat');
% Calculate the CAF (refer to function above):
[c,x_lab,y_lab] = caf(x,500000,16384, 500, 1, 150);
% Finally graph the CAF (and zoom in to show the peaks of interest):
mesh(x_lab*(1/20),(y_lab*(20000/16384)),c);
</syntaxhighlight>

[[File:DRM_CAF-TopDown.png|800px|thumb|center|Top-down on CAF]]

=== Analysis in GNU Radio ===

One can use GRC (GNU Radio Companion) to construct something like this:

[[File:OFDM_FAC.grc.png|800px|thumb|center|GRC flowgraph to determine OFDM signal properties]]

Run signal through [[Fast Auto-correlation]] to find un-guarded symbol duration. Set cyclo-lag to this value in samples (i.e. change [[gr-baz|''Variable Delay'']] at runtime). Run cyclo'd signal through another Fast Auto-correlation to find total symbol duration (including guard interval) - this is an FFT for (or a 'line' cut out of) one lag in the CAF above.

[[File:DRM_FAC.png|800px|thumb|center|FAC with first peak at ~21.33 ms (un-guarded symbol time)]]

Generating the cyclo'd signal simply involves multiplying the signal by a delayed (lagged) version of itself. A new [[gr-baz|'Variable Delay']] block for GRC allows changing the delay (number of samples) during runtime.

[[File:DRM_CAF.png|800px|thumb|center|CAF with first peak at ~26.66 ms (total symbol duration)]]

== OFDM Mod GRC block ==

''packet_mod_X(ofdm_mod('''<options>'''))'' - argument is 'packet_source'

''packet_mod'':
grc/grc_gnuradio/blks2/packet.py
''packet_utils'':
<core>/python/gnuradio/packet_utils.py

=== packet_mod_X ===

* Default payload: 512 bytes (if supplied length is default 0, must be multiple of input stream size)
* Input signature: X
* Output signature: inherited from 'packet_source' stream #0 (complex for ofdm)

Starts packet encoder thread that packages incoming data into payload size and submits to 'packet_source' via 'send_pkt' call.

''packet_utils.make_packet'': preamble, access code, length of payload and CRC, (optionally whitened) payload with CRC-32, end byte.
* 'preamble' is fixed.
* 'access code' can be left as default (customisable preamble)

''ofdm_mod'':
<core>/python/gnuradio/blks2impl/ofdm.py

_pkt_input (ofdm_mapper_bcv) -> preambles (ofdm_insert_preamble) -> ifft (fft_vcc) -> cp_adder (ofdm_cyclic prefixer) -> scale (multiply_const_cc)

Padded preamble generation (for correlation in time domain):

* zeros_on_left = ceil((FFT length - occupied tones) / 2.0)
* ksfreq = take 'occupied symbols' length from known_symbols_4512_3 (randomly generated fixed list of 1/-1, 4512 items long (=4000+512 ?))
* Each item (offset by zeros_on_left) that has an odd index is zeroed.
* Padded preamble is FFT length, with zeros_on_left, then ksfreq hardcoded symbols, then remaining zeros on right.

''ofdm_mapper_bcv'': constellation based on modulation, message queue limit (default: 2), occupied tones, FFT length

''ofdm_insert_preamble'' (insert 'pre-modulated' preamble symbols before each payload): FFT length, padded preambles

''ofdm_cyclic prefixer'' (prefix output with CP length from end of input symbols): FFT length, symbol length (= FFT length + cyclic prefix length)

''multiply_const_cc'': 1.0 / sqrt(FFT length)

{{RF}}
Categories: Wiki
Syndicate content