Posts Tagged HAM
I recently got a pair of the Nuand BladeRF SDR transceivers, and I’ve got about a days worth of experience with them. Of course, first thing’s first, I had to print the BladeRF Coaster by Piranha32. This is especially so because there are a few large tantalum-looking capacitors on the bottom. Before I had this printed, I used some small machine screws with bolts and made a quick set of standoffs. The package came with a nice blue USB3 cable and a pair of SMA jumpers; I assume these would go to their transverter, which I don’t have, but they’re nice to have anyway. There aren’t any instructions in the box, but for a product like this the assumption is that the user knows what they’re getting and how to use it. This is a reasonable assumption, and I had no problem finding all the relevant documentation.
I’m an ardent mac user, and this sometimes poses a problem while using specialized hardware and applications. It wasn’t until the last few months that the recent versions of GNURadio worked through MacPorts. Luckily it does now, as does all the BladeRF software. Going from nothing to a working software environment took minutes. One thing that you have to make sure and do it download the most recent FPGA code, as you’ll have to re-load it every time you boot the BladeRF.
All software defined radios have an Achilles’ heel. If the DC offset of the I and Q baseband signals isn’t minimized a constant “tone” at zero Hz will be up-converted to whatever frequency the final spectrum is. Also, if the relative magnitude and phase of I and Q aren’t matched (and precisely 90 degrees) there will be a image of the desired signal mirrored across the up-converter frequency. The BladeRF wiki has a short article that shows how to measure the correction factors to use to minimize these effects. This article documents my attempt of deriving the correction factors for one of the two boards.
To start, I tuned the board to 450MHz. Then, I decided that a 100KHz sine would be appropriate as a baseband tone. What happens is that, in software, the 100KHz tone is generated, then it is up-converted to 450.1MHz. The spectrum below is the result of that test without any corrections applied. The spur resulting from the DC error is about 25dB down from the desired carrier, and the image is closer to 35dB down. It’s not really that great.
Playing around with the values according to the instructions, I was able to improve these results quite a bit. The DC error is now 58dB down from the carrier (ignore the marker table) and the image is almost 63dB down. This is pretty respectable. Now, there is another troubling question. What’s up with the spikes in the phase noise?
I asked on the #bladerf room on freenode, and they agree that it’s not normal. The spikes are exactly 7.8 KHz apart, so I would start looking for things that happen at that frequency. I wish I had measured how distant the largest one was from the carrier and zero. That could have been good to know.
Oh, wait, I did :). The main tone is 63KHz away from the main carrier and 37KHz away from zero. There was some speculation that it could be artifacts from the quantization of the software-generated sine wave or that the tuning algorithm could be at fault. For fun, I ran the same test without generating any sine wave at all, so all you’re seeing is a large zero tone from a constant DC offset. I do think that the quantization explanation makes sense because that would manifest as phase noise, and the spikes are centered about the modulated tone, rather than the zero-spur.
The same artifacts should still appear there if there was any kind of a problem with the power supplies of the board, for example. It seems very clean, and I’m happy with the phase noise performance of the board. You’re probably seeing the phase noise of the rigol in this plot rather than the BladeRF.
In all, so far, I’m very happy this these. I’m very excited about their potential.
It has been a while since I played with the Sky65116 amplifier boards that I built and wrote about. Since getting my own spectrum analyzer, I’m now able to make much better absolute measurements. The DSA-815-TG analyzer is specified as having 1dB of uncertainly across the span, and the SA that I have at work is essentially uncalibrated.
Not only do I now know that the absolute power out of the video transmitter at the fundamental frequency is about 5.5dBm, I can also see the first and second harmonics. I don’t know why I didn’t see them with the other analyzer, but they are disturbingly large. I believe the FCC requirement is that these harmonics should be more than 40dB below the fundamental. By this criterion, the transmitter should not even be sold in the US.
The SKY65116 amplifier has close to 36dB of gain, and a 1dB compression point of 32.5dB. The 1dB compression point is specified as the output power level at which the gain is reduced by 1dB. The easiest way to show this is with the graph from the Sky65116 data sheet, shown below. You can see that as the output power begins to approach 32dB gain drops quickly. The goal is to not force the amplifier to operate in this region. If you do, you’re likely introduce harmonic distortion and other nasty nonlinear effects (i.e. intermodulation products).
So, knowing that the output is +5.5dBm, and we want about +30dBm out of an amplifier with a gain of 36dB, we need to introduce 11.5dB of attenuation (30dBm – 36dB – 5.5dBm = -11.5dB) between the transmitter and the amplifier, at a minimum. It’s easy to make 14dB attenuators with standard value resistors (4×150 ohm and 1×120). I’ve been playing around with QUCS a lot lately, so I’ve provided a model for the attenuator. It’s just about the most boring S-parameter model you’ll ever see… Perfectly flat response at -14dB, but that’s what we’re after.
A while back, I had a bunch of these simple 5-pole filter PCBs made up. I just left them blank until I needed them, and I made two of them into 14dB attenuators using the circuit above. I had two extra poles, so I filled one with a 0 ohm resistor and the other with a 1uF DC-blocking capacitor. The capacitor reduces the low frequency performance, but only less than about 1.5MHz. It’s worthy the trade-off in my mind.
I went ahead and covered one of the attenuators with copper sheet just to make it more of a completed package. I’m sure I’ll need to use it many times in the future. I left the other open so I could unsolder it and make it something else if needed. An interesting thing happened when I installed the cover. The small ripple in the attenuation (around 500 MHz, see below) occurred only after I installed the cover. I assume this is due to parasitic capacitance between the components and the copper covering. It’s still only about 1dB of ripple, so I’m satisfied with it.
Anyway, back to the amplifier. I’ve now got about -8.5dBm going into the amp ( +5.5dBm – 14dB), so with its 36dB of gain, I should expect to see +27.5dBm out of the amp. That’s getting very close to the maximum input power on my SA (+30dBm). It’s always better to be safe with these things, so I used the other 14dB attenuator between the amp and the SA. Now, I should expect to see +13.5dBm on the input. I maxed-out the input attenuation on the analyzer (another 30dB) and gave it a shot. Note that the internal attenuation is calibrated out of what’s shown on the display, and I told the SA about the other 14dB of attenuation, so the power values shown on the display are referencing the amplifier’s output.
In the above image, you can see that we’re getting 27.5dBm out of the amplifier! I love it when a plan comes together! This is the value I calculated, right on the nose. I promise that I didn’t work the math backward! 🙂 Again, it’s so painfully obvious that the transmitter is AM, rather than the VSB signal that it should be.
Now, just for fun, let’s dive back into the video signal coming out of the transmitter. In the image above, I’ve put some markers on the various carriers present in the signal. The luma carrier is in the center at 433.85MHz, which is where we expect it to be. Marker 2 is at 437.45MHz, which is 3.6 (let’s call it 3.57) MHz away, matching exactly where the chroma carrier is supposed to be. There’s no audio carrier, which isn’t a surprise because there’s no audio, though I wouldn’t be surprised to see the carrier. Marker 3 is 19 MHz away; I have no idea what this is or why it’s there. It’s not supposed to be. Same with marker 4. Oh, well… that’s what you get with a shitty transmitter.
Now, what about those pesky harmonics? The Sky65116 is a 390-500 MHz amplifier, so my hope is that the reduced gain by the first harmonic will attenuate the harmonics enough to bring them into compliance. The graph above is the gain v. frequency graph from the data sheet. It’s neither encouraging nor discouraging. It’s difficult to infer what’s going to happen at 800 MHz when the graph stops at 500 MHz. In the image below, it appears that I lucked out. The first harmonic is 42dB down from the fundamental. If I were selling a product, there’s no way I would send this out for compliance testing. It would just be too risky, I’m not that confident in my measurements. By my math, it would cost less than $2 in parts (single unit quantities) to make a decent low pass filter. That’s the right thing to do. When I modeled it (in QUCS, again), I calculated that the harmonics would be within compliance even without the rolloff of the amplifier. With the rolloff, the harmonics would be well below the noise floor.
I’ve had a ton of fun redoing this experiment with my new spectrum analyzer. I’m going to write lots more about the analyzer in the future, and I’m really looking forward to it. Coming soon is an exploration of the skyworks low noise amplifiers. Between these two products, I expect to have a solid video link over 1000 feet or so.
Relating to the rtl-sdr work that has been done, the E4000 tuner was the standard barer for a long time. However, Elonics has discontinued this part, and it’s becoming difficult to find. The popularity, and scarcity, of this part has encouraged sellers to offer products claiming to be built with the E4000 and are not. Luckily, someone discovered the code for using the R820t tuner in the Linux V4Lin drivers. They ported this code into the rtl-sdr source maintained by osmocom.
I just finished porting their code into Cocoa Radio. Now, it’s possible to use my software with both the E4000 and the R820t. On startup, Cocoa Radio will automatically detect which tuner you’re using and perform the appropriate actions.
It did take a little while to finish this work, and there are several more tuners out there. If you are desperate for support of a specific tuner, you can donate a device for the cause and I’ll try to support it. By the way, Softshell uses the same code for tuning as Cocoa Radio, if you recompile softshell, it should include this new code.
Well, I’m back from vacation and I want to tell everyone about a new version of Cocoa Radio (my application for demodulating radio signals using the rtlsdr dongles on mac os x, written in Objective C). This version seems to be running really well. I’ve set the sample rate to 1024000 samples per second for the moment (though this value can be changed in the code), and at this rate everything seems really stable. Please give it a try and create issues at the github issues page if you find any problems. I should say that I’m a little tired of working on it, so unless there are major issues I’ll be working on other projects for a while. I encourage others to take a look at the code if they’re interested in SDR. It’s not as scary as it looks!
Also, the sliders are a little buggy (especially the bandwidth ones). Move the a little bit once the app starts up and they’ll work correctly.
Finally, I don’t have any support for AM (amplitude modulation) yet. It’s an easy modulation type, and I may add it soon.
It has been a little while since I released the very early code for softshell (not that the code has advanced much), and I’ve received a few requests for a bit more information about how it’s intended to be used.
I admit that I hacked it together very quickly so that I could make some basic use of the rtlsdr dongles on my mac. To be very clear, Softshell does no actual SDR itself. You can really look at it more like a driver for the rtlsdr. Softshell opens a connection to the rtl device, allows you to tune its internal oscillator, and puts the data on the network.
To start, install the rtl device in your USB port, then open Softshell.
If you see a similar window, it means that Softshell has found your device (the ezcap in this case). It is, perhaps, a good time to mention that I’ve only ported the tuner code for the Elonics E4000 tuner. Click the “Open” button to have the program open the connection to the device. If it detects that you have the E4000 the “Tuner type” field will be filled in with “Elonics E4000.”
Once this is done, changes to the sample rate and center frequency will take effect with the “Update” button is clicked. The Center frequency is provided in Hz.
Now, that’s all fine and good, but you’re just tuning the device. To actually get the data out of it, you need to setup the network settings. Choose a port number for Softshell to listen to, I use “12345,” and click the “Running” checkbox.
Finally, in GnuRadio, you need to use a “TCP Source” block setup as a client with the same port number you used before.
Once that’s done you should be up & running. Note that, natively, the rtl device actually outputs unsigned bytes and that Softshell converts these to floats centered around zero. Some GnuRadio examples include the blocks that perform this conversion. If you come across this, just remove those blocks.
Good luck! Please feel free to comment with any questions or issues!