Lushprojects Blog

Projects in music, video, art, technology and learning
RSS icon Home icon
  • Spectrum Analysis and GSM Broadcast Decoding in 2013

    Posted on November 17th, 2013 Iain No comments

    This post is about the low-cost SDR systems becoming available. I am afraid it’s not going to be very beginner friendly so I am going to assume that you have a general understanding of radio technology and SDR. In the last post I talked about the massive and expensive spectrum analyzers I used in the 1980s. In fact, even in that era I worked on SDR. Using a PDP 11 we analysed batch files of samples from radar systems to test new processing algorithms.

    So why is SDR a hot topic now? Basically a combination of new hardware and the increasing power of desktop PCs has brought powerful SDR solutions within the reach of hobbyists and low budget researchers. There are two main strands:

    Firstly, there is what we might call serious low-cost SDR. This consists of hardware boards in the spirit of something like the Arduino or Raspberries Pie which provide experimental but capable SDR platforms in a relatively low-cost package. Typically though these are not what you could call “cheap” as they still may cost hundreds or thousands of pounds. What you get is something with fairly good RF performance and perhaps the possibility of transmitting as well as receiving.

    Secondly, there is what we might call seriously-low-cost SDR. This reuses very cheap USB TV receivers as SDR receivers. It is this ultra-low-cost SDR that I am going to talk about here.

    My SDR Hardware!

    My SDR Hardware!

    Two key points make ultra-low-cost SDR possible. Firstly it was discovered that certain chipsets widely used in USB TV receivers had a much wider tuning range than was needed for TV. The chipsets can also send the intermediate frequency I and Q samples directly over USB to the host computer. Secondly it was found that the processing power on normal PCs was sufficient to perform, in real time, SDR functions on the I and Q samples coming from the USB receiver.

    I bought a dongle based on the RTL2832U+R820T chipset from Amazon for £12.50. This was a slight mistake as it was despatched from the Far East and took several weeks to arrive so my first advice would be to order locally. So what does a cheap USB TV receiver like this provide in terms of performance? According to this very useful stream of consciousness this chipset can tune from 24 – 1700 MHz. That covers FM, ham radio and GSM. It uses a 3.57 MHz intermediate frequency and has a tuning error of perhaps 30 ppm which is relatively stable for a particular dongle when it is warm.

    The intermediate frequency sampling is 8-bit and around 2MS/s is an achievable sampling rate. The dynamic range is about 45 dB. My experience is that the biggest problem is various spurious signals appearing that seem to by primarily due to interference at the intermediate frequency. There are various homebrew solutions to improve screening described on the web but I haven’t tried these.

    My 1st experiment was using SDR# running on Windows. This was easy to install using a recipe I found on the web. I just hooked up a few meters of wire to use as an antenna. I was easily able to scan the FM and air bands to receive various stations. Once the “Correct IQ” option was checked I was able to receive sounds. I also looked around 900 MHz and saw what I thought were probably GSM cells. It’s not really fair to compare my 2013 technology to the spectrum analyzers of 1986, but as a way of visualising common radio signals it serves the same purpose for 0.07% of the cost (less allowing for inflation)! On its own I find this fascinating.

    Radio 4 FM spectrum using SDR# with stereo pilot tone clearly visible

    Radio 4 FM spectrum using SDR# with stereo pilot tone clearly visible

    Though SDR# is easy to use I think the Windows environment is fairly limited for SDR and if I was starting again I would probably go straight to Linux. Most of the serious SDR tools are primarily developed for Linux.

    Having seen what looked like GSM BCCHs I was really keen to try and decode them. I found this guide which I basically followed. I didn’t want to set up a dedicated machine for SDR so I decided to go down the virtual machine route. I installed the free version of VMware player and installed Kali Linux version 1.0.5. Though Kali Linux download page has an image for VMware it is an old version so I created a new VM and installed 1.0.5 from the ISO. This was very easy. Version 1.0.5 has many SDR tools already installed and as many of the tools seem difficult to install this is a significant advantage. I was very impressed with the performance of VMware player and the ease with which it was possible to connect the USB dongle.

    Having created the virtual machine I followed the recipe linked above to decode the GSM broadcast channel. If you start from version 1.0.5 you don’t need to install GNU radio but when you install Airprobe you will need to add the additional dependencies as explained in the recipe.  The only issue I found was that apt-get didn’t like the “-y” option so omit this from the dependency install and manually accept the installation.

    The Airprobe tool used to decode the GSM BCCH seems pretty buggy and is still a work in progress. Though it has a GUI it doesn’t appear to respond to any clicks in my version so you need to set everything from the command line. The command I used was:

    ./ -s 1e6 –f 948000000

    948000000 is the frequency of the GSM BCCH I found using SDR# in Hz. You can see GSM downlink channels as fairly broad peaks around 900MHz in SDR#. Check the downlink centre frequencies used by GSM to get the exact centre for any candidate.

    I immediately started getting decoded GSM cell data from Airprobe, but it seems to quickly loose sync or tuning and stop producing output. I suspect there is some kind of bug in its tracking algorithm, but it could also be a peculiarity of my configuration. When the program gets stuck use control-C in the starting terminal to kill it.

    GSM BCCH decoded using wireshark

    GSM BCCH decoded using wireshark

    Anyway, for £12.50 and a load of free software I think the ability to receive GSM cells is pretty impressive.

  • Spectrum Analysis in 1986

    Posted on November 17th, 2013 Iain No comments

    I have heard that when you use a tool your brain treats it like an extension of the body and, effectively, it becomes part of you. I don’t know if this applies to electronic test equipment, but certainly some of my strongest memories of learning practical electronics are the equipment I used in different periods.

    In 1986 I joined the Communications Lab at GEC Research as a student apprentice, or “intern” as people would probably say now. It turned out to be a fateful decision because I worked on early trials for the GSM cellular system and that defined the future direction of my career. The labs were proper research spaces with long wooden benches and lots of hand-made hardware which was cutting edge for the date. They also had a lot of fancy test equipment.

    We had a raft of impressive Tek mainframe scopes on trolleys, but sometimes more exotic equipment was needed. Doing radio work a spectrum analyzer comes in handy and the most common one around the site was the Marconi Instruments 2382. Marconi was part of GEC so it made sense to buy in the family, but I think Marconi had genuinely produced a product that had a price/performance ratio that lead the industry. Using a computer-driven display (controlled by the good old 8085 CPU) to replace the storage-tube traditionally used for spectrum analyzers reduced costs and provided exciting features like GP-IB based plotter output.

    Marconi2382 Spectrum Analyzer

    Marconi2382 Spectrum Analyzer

    The 2382 was a massive instrument of two brown boxes for the analyzer and the display. The combination was a foot tall (30cm) and nearly 2 feet deep. It was build like a tank. I am pretty sure that if it fell on you it would probably kill you. The controls included a vast field of clicky switches with embedded LEDs (no membrane keyboards for this monster). In fact my recollection of operating the device involves a lot of clicking. It had some kind of internal relay-driven attenuator and some operations would unleash vast sequences of clicks from the interior.

    I think the 2382 was regarded as pretty cheap for what it did. This piece from IEEE Electronics and Power in May 1985 says the prices start at £18,500. £18,500 in 1985! Probably enough for a small house.

    Learning to drive the 2382 was not just about learning to navigate its many controls. It also taught me a lot about how radio works in practice. Just looking at FM stations gave you a real visual model of ideas like noise, sidebands and carriers.

    Marconi Analyzer - IEEE Comms and Power May 1985

    Despite it’s bulk and cost the 2382 had one major problem – a maximum operating frequency of 400MHz. Not enough for us to use it on the GSM baseband operating at 900MHz and pretty limiting for a lot of comms use. In the comms lab we often had to use even more expensive and exotic HP Analyzers. HP was pioneering the use of screen-menu driven interfaces so though their stuff was the bees knees it never matched the 2382 in terms of button-load shock and awe.

     For those that want to dig deeper, try the Marconi 2382 Data Sheet, or the service manual for the RF unit.

  • Azymbol from Belgium – LushOne case builder extraordinaire

    Posted on November 16th, 2013 Iain No comments

    One of the joys of running LushProjects is seeing some of the imaginative work that people put in to building cases for my circuits. Recently Azymbol from Belgium sent me some photos of his LushOne system case which breaks new ground in design and craftsmanship.

    Working in MDF and recycled materials including placemats and tennis ball tins Azymbol has created a design that evokes 60s futurism displaying the controls to maximum advantage on a dramatically curved frame. The colour is applied in acrylic paint and creates carefully judged dramatic contrasts.

    Azymbol LushOne

    Azymbol LushOne

    Azymbol LushOne Front

    Azymbol LushOne Front

    Azymbol LushOne Side

    Azymbol LushOne Side

    Azymbol LushOne Back

    Azymbol LushOne Back

    Technically Azymbol has used the LushOne base, Contour and Inca modules to build the synth and a Velleman P8042 symmetric power supply he sourced himself.

    The design and build are magnificent. Bravo!

  • PCB Layout Tools – I am a KiCAD fan

    Posted on September 24th, 2013 Iain No comments

    From the postbag:

    Was thinking about a project building front panels for various DIY synth projects out of PCB material and mounting all the control components (pots, switches) on the PCB itself like on the Lush (eliminating most of the point to point wiring). What PCB design package do you use and how difficult was it to learn?



    Dear Tom,

    As I’ve said elsewhere I hate point-to-point wiring so I made it a feature of LushOne to have all the components mounted on the board. I had previously used Eagle but the LushOne the board was too big for the low-cost edition. In any case, I like to use open source software when I can even though a lot of it is not that user-friendly. The LushOne was the 1st project I laid out in KiCAD and I’ve actually found it a really effective design tool.

    Like all CAD systems it has a bit of a learning curve, but generally I’ve found it easier to use than Eagle. It’s not as powerful as Eagle and lacks the scripting capabilities but it is perfectly adequate for my projects.

    The worst part of KiCAD is the Gerber viewer. I tend to use the online Gerber viewers like the one at OSHPark.

  • Building a LushOne system

    Posted on September 17th, 2013 Iain No comments

    LushOne system

    It has always been my intention that it should be possible to use the LushOne to build big systems. Now we’ve got three modules designed we’ve got the basics of a capable modular synthesizer. The building blocks available in the three modules are functionally very similar to those found in classic systems like the mini Moog and MS20. Still, it’s natural to want more of everything and it is particularly helpful to have more oscillators and more mixers in any synthesizer. Over the last few months I’ve been working on my own LushOne system.

    The physical design is very simple. It’s just a piece of plywood with holes on a grid to mount LushOne boards on spacers. The layout is set up for a 3 x 3 grid of boards. I’ve designed a special board to hold the RECOM DC to DC converter. Power is distributed by “chocolate block” terminal strips under the LushOne circuit boards. Currently there are two LushOne base modules, one LushOne Contour and two LushOne Inca modules.


    Power supply – hand made board

    The boards have been somewhat modified for my own requirements. The same MIDI input controls both LushOne Base modules. This allows four oscillators to be controlled from the keyboard. The LushOne Base modules are running the prototype version 2 software which provides additional wave shapes as well as the ability to run the OSC2 to an octave higher or lower than the main oscillator. One of the LushOne base modules has been modified so that the OSC2 output is at a signal level rather than at a control voltage level. This makes is really easy to have textured base notes with several harmonics.

    The LushOne Contour module is standard. But, one of the LushOne Inca modules has a potentiometer and photo cell fitted instead of the joystick as an alternative way to provide input.

    The additional flexibility of the system with so many oscillators and signal processors is great. When I get time I’ll write up in detail some of the modifications. At the moment I am playing with digital delays using the PT2399 chip and I really must build a second LushOne Contour to get a second ADSR.

    It may not be the prettiest synth in the world, but I think it looks cool and the bang-for-the-buck is hard to beat.

  • LushOne Base – What should we have in revision 2 firmware?

    Posted on August 11th, 2013 Iain No comments

    I’ve been prototyping some new firmware for the LushOne base revision 2. I am using my experience with the original to add features that make it easier to create an even bigger variety of sounds and to use the LushOne as a serious instrument. I also wanted to add features that would help with building the LushOne in to bigger systems.

    Here’s what I have added so far:

    • Settings memory so that selections are saved when the LushOne is powered off. LushOne will return to its previous state allowing you to pick-up from where you left off.
    • Three new waveforms for the oscillators. 30% and 15% duty-cycle square wave and combined saw/square (like the MiniMoog). New base sounds enhance the range of capabilities.
    • +/- One octave settings for OSC2 in OSC mode. Get really rich, deep tones when mixing with a LushOne Inca.
    • Selection of MIDI input channel for use in more complicated MIDI systems.
    • Ability to get MIDI velocity output as a control voltage (substitutes for the “log f” out). Allows for touch sensitivity.

    What features would you like?

  • LushOne Base – High pass filter mod

    Posted on June 20th, 2013 Iain No comments
    Changes to convert the LushOne Base filter from low-pass to high-pass

    Changes to convert the LushOne Base filter from low-pass to high-pass

    Once the LushOne had a fairly complete set of basic synthesizer functions available I always intended to built a powerful multi-oscillator and multi-filter system. You may laugh, but in the back of my mind I had the brief-case sized systems built on the boutique Mattson Mini Modular components.

    Once you start thinking about building a full system then you are going to want a high pass filter option to complement the low pass filter in the LushOne Base. Fortunately it is easy to modify the LushOne Base filter to be high pass instead of low pass. Here are the changes:

    • Omit R218 and C210 and instead link the two footprints with a wire as shown on the left.
    • Change the value of C208 to 2.2nF. This is the same value as C210 so you can do a substitution there. Obviously this capacitor is now non-polar so ignore the polarity markings on the PCB.
    • Change R221 to 4.7k
    • Change R220 to 47k

    That’s all there is to it! Sit back and enjoy some new sounds.

    Generally the low pass filter is more useful so if you only have one LushOne Base then I wouldn’t make this a permanent change. However if you want to build a system with more than one LushOne base, or if you want to take the LushOne Base schematic and build your own filter on vero-board then it’s well worth having a high pass option.

    If you are using both the filters I recommend putting the high pass first in the signal path and then the low pass. This will reduce the risk of any high-frequency noise getting though in to the output. This arrangement can produce quite natural sounding instruments from the LushOne oscillators.

    Remember that with both a high pass and a low pass filter it is rather easy to cut the signal off all together by having non-overlapping filter bands!

    Here’s a little multi-tracked sample from a dual-filter LushOne:

  • Equation for op-amp sum/difference amps

    Posted on June 2nd, 2013 Iain No comments

    Warning: this post contains maths

    I can never find on the web or in my text books the general equations for op-amps used as combined multi-input summing and difference amplifiers (ie they have several positive and negative inputs). It makes designing mixers for synthesizers annoyingly awkward as I have to rederive the equations each time. So, to save myself having to work everything out from scratch again, here are my derivations and notes on multi-input Op-Amp circuits. I will also take the opportunity to point out some interesting parts of the results.

    Main Results

    Op Amp Sum/Difference Amplifier

    So, here’s the setup:

    We have an op-amp circuit with “N” negative inputs and “M” positive inputs as shown above. All the positive and negative inputs are identical.

    For an ideal op-amp the output is:

    Or, in other words the negative gain is:

    The positive gain is:


    Positive and negative gain

    The negative gain is nice and easy and only depends on the input and feedback resistors and not on any other variables, like the number of inputs. Why is this? Well the inverting input of the op-amp is a virtual ground and the voltage isn’t changed by the negative inputs. Therefore the current through each negative input only depends on its input voltage. You can have as many or as few negative inputs as you like and it works the same.

    The positive inputs are not in this lucky position! Voltages at the positive inputs change the voltage at both the inverting and non-inverting inputs of the op-amp. The non-inverting input voltage changes because of the voltage drop over Rg. The inverting input voltage changes due to the feedback action of the op-amp keeping the input voltages ideally identical. This means that currents flowing through all the input branches depend on the positive input voltages and hence the complicated positive gain equation.


    Limits on positive gain values

    Once the negative gain is set, this configuration limits the range of values of the positive gain depending on the number of positive and negative inputs. One particular example:
    If the negative gain G- > 1 and number of negative inputs N < M, the number of positive inputs then G+ < G-.

    To derive this then consider that the maximum positive gain is when the input resistors R+ = 0 (obvious from the circuit and also by inspection of the equation).


    Special cases and derivation

    There are several interesting special cases from these equations (including the basic op-amp single input amplifiers) and the derivation is worth reading. So I don’t fill the blog with equations you can read it all in this pdf file.

  • Third LushOne module – development report

    Posted on May 16th, 2013 Iain No comments

    The last few weeks I’ve been busy working on the third module for the LushOne synth. This module is going to be all about signal processing and noise effects.

    This is what’s planned to go in:

    • Four channel mixer/signal processor – combine CVs or audio signals within the LushOne or change signal levels for compatibility with external equipment.
    • Noise source for percussive and random effects
    • Sample and hold function for interesting effects
    • Extra square wave LFO, primarily intended to drive the Sample and Hold
    • 3.5 mm jack breakout for easy interfacing to Eurorack modular synths
    • Joystick for dynamic control of two analog control voltages

    All this packed on to the same size board as the LushOne base and the LushOne Contour.

    All the circuits are prototyped on breadboard. Just finishing the first PCB layout over the next few days.

    Suggestions for a suitable name for this module are welcome.

  • Could be the smartest Vibrati Punk Console ever

    Posted on May 16th, 2013 Iain No comments

    Lovely work from David Mead encasing his Vibrati Punk Console. It looks like a very smart and very expensive piece of Hi Fi. He says that it is his first project. Great job!