SignalHound SA44 GNURadio Windows Interface

Some time ago I read a fascinating article about software defined radio. What was intriguing is that one can implement virtually any type of demodulator without a single solder just by writing several lines of code. So I studied some theory, read about FIR Filtering and Bandwidth Decimation techniques. Unfortunately there's not a lot of information you can find on the web if you want to study this topics deeper. For example I was wondering how FIR filter function coefficients or "tap weights" are determined. So not being satisfied with what I was able to dig on the web I built my own little 3 tab fir.xls spreadsheet where I used forward and backward Fourier Transforms to estimate FIR coefficients for high-pass and low-pass filter implementations. When I got a good grasp on Software Defined Radio theoretical aspects I became interested in exploring its concepts in practice. And here I had to make a difficult choice. What software defined radio hardware will best suit my needs? It seemed initially that an obvious choice was Universal Software Radio Peripheral (USRP). However it had more Cons than Pros for applications that I wanted it to use. Growing up in analogue era, with toys like legendary ICOM IC-R20 in my crib, I definitely wanted my future SDR to be "DC to Light" (very wideband) receiver. USRP configuration package that fits to $1000 budget could cover from 50MHz to 2400MHz (with TVRX and DBSRX dughter boards installed). Signal Hound (SA44) covered from 1Hz to 4.4GHz (even better than IC-R20). Since I didn't want to transmit anything I didn't want to waste money on USRP transmit path. USRP had ADCs with 12bit resolution and DACs with 14bit resolution. SA44 had 24bit ADCs and 24bit DACs (However by some strange reason SA44 Windows and Linux APIs constrained resolution of I/Q channels to 16bits). In addition I always wanted to buy Spectrum Analyzer, but unfortunately couldn't afford one. So the idea of buying new Spectrum Analyzer and Software Defined Receiver for only $795 (SA44 price at that time) was very appealing to me. As a minor benefit it was powered from USB bus and didn't require a separate power supply (as USRP) and hence was also more suitable for mobile use. There was only specification parameter which made USRP to clearly stand out comparing to SA44. It was maximum bandwidth of processed RF signals. USRP was capable to process 8MHz wide signals, whereas SA44 could only do 256KHz wide bandwidth. But I wasn't interested in projects that required wide bandwidth such as building software GPS receiver which will require an ability to process signals with 2MHz bandwidth. So I chose SA44. There was only one small problem with SA44. It didn't have have open source API. Download section of http://www.signalhound.com/ only offered DLL and header files for MS Windows. I sent email to support team asking whether they will be willing to release Linux API in a future and they responded to me that it will be out in a summer of 2010. But due to numerous delays SignalHound released Linux API only in a summer of 2011. Back in 2010, excited with my new toy I didn't want to wait until it will be finally released and decided to interface GNURadio software with SA44 hardware on MS Windows platform via closed source SA44 API. Looking at GNURadio I found instructions how to build GNURadio framework under MINGW and MSYS. Since SA44 API DLL was compiled using MSVC++ it was binary incompatible with MINGW g++. So I had to write code for a simple wrapper DLL that added some logic on top of SA44 C++ API calls and imposed C style calling convention on its own exported function signatures. C style function signature demangling is standardized and hence binary objects compiled by MSVC and MINGW gcc are compatible and could be linked with either linker. I downloaded a free version of MSVS 2010 from Microsoft website and built my wrapper shapic.dll. Then I used MINGW libtool to generate linkable stub object libshapic.a. Using MINGW ld I produced MINGW style libshapic.dll(see sa44.zip for code and gnuradio-3.3.0+SA44.zip for binaries). Borrowing a lot from an existing gnuradio-3.3.0\gr-usrp module I created gnuradio-3.3.0\gr-sa44 interface module. In addition I created simple WFM, NFM and AM SA44 receivers (again heavily borrowing from the respective USRP examples) and placed them under gnuradio-examples\python\sa44 section (see source code in gnuradio-3.3.0+SA44.zip). Somehow I get much better sensitivity and selectivity when I use GNURadio framework instead of native SA44 software which is based on LabVIEW stack. This is probably due to more superior FFT and FIR implementations.