GPS And SDR Combine Forces

Software-defined radio (or SDR) is a relatively new (to average tinkerers, at least) way of sending and receiving radio signals. The interest in SDR exploded recently with the realization that cheap USB TV tuner cards could be used to start exploring the frequency spectrum at an extremely reduced cost. One of the reasons that this is so advantageous is because of all of the options that a general-purpose computer opens up that go beyond transmitting and receiving, as [Chris] shows with his project that ties SDR together with GPS.

The goal of the project was to automatically tune a radio to the local police department’s frequency, regardless of location. To do this, a GPS receiver on a computer reports information about the current location. A JavaScript program feeds the location data to the SDR, which automatically tunes to the local emergency services frequencies. Of course, this relies on good data for what those frequencies are, but this is public information in most cases (at least in the US).

There are a lot of opportunities here for anyone with SDR. Maybe an emergency alert system that can tune to weather broadcasts if there’s a weather alert, or any of a number of other captivating projects. As for this project, [Chris] plans to use Google’s voice recognition software to transcribe the broadcasts as well. The world of SDR is at your fingertips to do anything you can imagine! And, if you’re looking to get started in it, be sure to check out the original post covering those USB TV tuner dongles.

33 thoughts on “GPS And SDR Combine Forces

    1. Every GPS enabled phone I have ever owned heats up and sucks battery when you turn the GPS on. I always thought that must be the result of the calculations it makes the CPU do. Take that job and make the RF chain software defined too… I’m thinking that might take too much processing power.

  1. My goal for SDR to do inexpensively, what otherwise would be expensive, not to duplicate what can be do relatively inexpensively via home brew.A $30 SAME receiver and program in the codes that can’t be retrieved from the internet handily, IMO it doesn’t make sense to use SDR to duplicate that. While costing several time more I’d purchase a scanning radio if monitoring local LE & PS is important to me. I believe they do come reprogrammed, and can quickly be set for any US jurisdiction. However SDR can bring monitoring LE & PS post “wide band” into the realm of affordability, a route I’d consider for use in the home.However for mobile and portal use compact and ruffed manufactured units come back into consideration.

    1. I would say the point of SDR is versatility. An all-in-one approach. You can do most things with a good cheap alternative. But with SDR you can have an AM receiver AND a GPS receiver AND … fill in the gaps, which together would cost much more.

    2. Doug – True. However, companies like BearCat and others have devices similar to mine but require user input. I am not trying to compete with them. I just like tinkering around and automating stuff. I could care less if BearCat wants to take this I.P. and run with it. It would be nice if they included me but if not I would understand. I’m not financially driven. I just like HACKING.

      My project has a BUNCH of L.E.O. – monitoring problems right up front. It does not know how to do TRUNKING or the new P25 Digital many Public Safety operations use today. That’s not a major gap as there are SDR software hacks that can overcome that. However, that just makes my brain hurt right now. I’m only aiming at old-fashion L.E.O.s that can’t afford that fancy stuff yet. My police dept is TRUNKED. My State Police are P25 digital. Oh well I’ll worry about that later. I’ll just be lucky to hear Podunk P.D. (we actually have a PODUNK in my state too).

      I won’t be able to use SDR for GPS as the data is serial RS232 at 4800 baud, and that’s OK, but the math is daunting. The inventor uses something called “ephemeral” math (???) from 12+ satellites. I am far too stupid to figure that out! So Delorme Corp already did that with their little yellow dongle (EarthMate – discontinued). They have a great app to capture the data and output lat/lon. Just need to figure out how to capture that and do the math I envision. There must be other external GPS usb dongle devices besides Delorme. EarthMates can be picked up on Ebay, Amazon,. Ham Swaps, thrift stores, etc.

      The only real user input I envision right now is setting the miles (kilometer) range you want, as you have overlap when you cross town or county lines and you might not want to monitor Podunk when you cross the town line into East Bumphuq. Also you might want to do some lock outs too. Sometimes some LEO’s get too chatty like with phone-patches (they still do this in Hartford). Or the incessant license checks, NCIC, etc, This doesn’t have to be limited to Public Safety either. The FCC database breaks it down into many services.

      1. Shouldn’t it be possible to ping a cell tower (either w/ an SDR & tricks or a SIM enabled mobile hot spot) to get the right metro area?
        In the US at least it’s hard these days to find a dead zone.

      2. This needs an internet connection anyway to map the location to the frequency as far as I understand so no difference…

        And yes, you could just use osmocombb to get on the GSM frequency and find out your nearest tower IDs. Or you could use the SDR to go on the GPS frequency and get rough location but that is very unreliable with SDR yet.

        Here I was hoping that the article was going to be about using an SDR as a GPS judging from the title… there’s actually some code somewhere that implements GPS but a typical setup won’t give you any precision.

        1. Andrew – “Here I was hoping that the article was going to be about using an SDR as a GPS judging from the title… there’s actually some code somewhere that implements GPS but a typical setup won’t give you any precision.”

          I WAS TOO!!! :-D

          I had no idea this article was about me! I just came here for the same reasons you did and then found out, nope, this is my project. Anyway Bryan did an excellent job…

          I would really like to know what “osmocombb ” is. I’ve never heard of it.!

          I have to disagree with you about the Internet Connection. My original idea does not require one. The local PC has a large downloaded text database of Public Safety antenna coordinates for my state. It is pre-loaded BEFORE you go out on the road. And then the GPS dongle figures out where you are. Then all that is needed is a JavaScript trigonometry function to compute how far in miles or Km you are from EACH antenna in the database. Based on your RANGE setting, it decides which antenna you are the closest too within your RANGE parameters.

          It then word-parses out the frequency of all that apply to your range and inputs them to the SDR. If the SDR detects a carrier, it stops and listens to that frequency, displaying who it is and where they are (mailing address). It not only can vocalize who you are listening to (You are monitoring PONDUNK PUBLIC SAFETY channel), it also should be able to use your PC’s built-in speaker-independent voice recognition to display what is being said on the screen. I think you can download Google’s speech recog too.

        2. Shameless plug but my blog talks about using SDR as GPS. Three open source packages to check out are gnss-sdr GNSS-SDRLIB and OpenGNSS. gnss-sdr is definitely the most complete and robust but OpenGNSS is good for learning once you squish the bugs out of it.

    1. siluxmedia – I read that and said WOW! Good idea. And it is. However, Darren is correct. I would need some sort of Internet connection while driving. Sometimes that’s not possible in remote areas. BUT I have another .IO that does MESH NETWORKING using FireFox’s Wi-Fi Manager plug in.

      I could write an app with FFWM to look for an open unlocked wi-fi AP/HotSpot, login, and then do the geolocation routines, It’s an idea for later. I have not too much information on Javascript geolocation yet, Any references would be appreciated.

      Leithoa – You’d be surprised how many deadspots there are in Connecticut. They say we have the most trees of any state on the eastern seaboard. We have a lot of mountains (aka foot hills above 2,000′) and plenty of valleys. We have a lot of city skyrises too. We can have a few miles of farmland or lakes with no cell phone towers for miles. However, a lot of companies are buying mountain top plots, water tower space, and commercial building leases. But if your carrier is “piggy-backing” off of an obscure tower carrier then you’d be SOL sitting right next to an AT&T or Verizon tower and you were just a Virgin Mobile, Tracphone, or Boost, customer. VM uses Sprint.

    1. hmmm_42 – Receiving the GPS signals is not the real problem. The post-reception maths is amazingly hard! But not impossible. I think it is called “ephermal math” – not sure. I think it is some sort of Fourier Transform thing. I’m not good with that sort of maths.

      You have to collect data from several satellites, have the correct time set on your PC, then do some maths only NASA could do. I think you also need to download location in space data on each bird. It’s waaaay over my pay grade.

      1. An ephemeris is a set of variables which describe the orbit of a satellite, it’s part of the message you decode from the GPS signal. Yes, a Fast Fourier Transform (FFT) is used to acquire the satellite – it’s how you determine the doppler offset – but after that it is pretty straightforward to recover the bitstream (BPSK modulation). Once you have the bitstream, it’s just a matter of understanding the protocol, like any other digital signal over the air, to recover the information and then use a few equations to calculate your relative position. You do not need an accurate time on your computer – part of the process in decoding is determining the true time.

          1. Yes trivial is correct. However, I’m going with the JavaScript geolocation method. I may also use [Philip Hahn’s] method of using a 2nd SDR dongle to get the GPS satellite data. But I’m going with the easier method right now. It requires no learning curve as it’s already solved by [siluxmedia] up above there somewhere. Just have to supply an Internet access while driving. Should be trivial enuf’ ! :-)

  2. The number of options a general purpose computer opens up goes beyond TX and RX…yet it only has a Bell Handicap keyboard to use onscreen. This was done to slow accountants and secretaries from fast dialing on the new Touch Tone dialing, which required a tenth of a second for the tones for each digit. POS terminals with phone keypads have high errors. Math wins. 1 is bigger and above 0. Nine is not next to zero unless below. These SDR’s interest me till I see a fubar interface.
    I will stick to a 10 turn pot tuning the VCO in the tuner, which usually out perform SDR’s. Years ago I took a bag phone thru the forbidden band in this very analogue way and could execute cell handovers hardly missing a word following by eye on a spectrum display (sweep and an o’scope) and dialing the next part of the com. Given there were probably only a dozen signals in the band at the time.

    1. echodelta – Youre a RETRO dude like me!

      What you said about a 10-turn potentiometer for VCO is all well and good for fine resolution on a RX, however SDR’s open up a whole new world to us beyond that. These SDR guys are talking about taking one of those old TV station USB dongles for about $20 USD and turning it into a super-wideband instant (random) access RX. It can scan like one of those Harvard Univ radio telescopes that can scan billions of frequencies almost instantly (well not that good but close enuf’ for government work)… They can be used as a spectrum analyzer too!

      I like your bag phone idea. I want to set up something so two bag phones can talk to each other full duplex. I found out how to do it but it requires some creative Motorola bag phone reprogramming in service mode. So I went out and bought one of those Harris (?) analog bag phone testers for $150 USD surplus. Normally costs THOUSANDS!!! It allows you to just dial up the other bag phone and it rings it. No cell service needed as it emulates it. You just need some creative external antennas to extend it’s range. But I’m not going to do that as I don’t think it is legit with Foxtrot Charlie Charlie. D’oh!

  3. I would have thought we would see more law enforcement agencies switching to digital radios (with encryption and stuff) that can’t be easily snooped on by the bad guys…

    1. Don’t worry, it’s happening. Thanks to the morons over at “radio reference” streaming scanner audio so fellow morons can receive it on their smartphones, police chiefs are adding encryption to their systems. It’s one thing for the local community to have scanners, but when you take that radio traffic and send it way beyond your borders it draws unwanted attention. I know of 2 communities that will have mandatory encryption on a new system they ordered, specifically because of the idiots on radio-reference streaming their audio. Exact (off the record) quote from one chief (friend of mine)… “fuck ’em, let’s see them stream it now!”….of course, it doesn’t affect me, since I’m employed by the vendor that sold them the new P25 system. We threw in encryption since it’s a minimal (fractional) cost option.

      They were perfectly fine with local citizens monitoring radio traffic, but when this “streaming” crap started. It caused a lot of unneeded attention when any thug with a smart phone could download a ‘scanner app’ (before, they needed to buy a physical scanner) and said thug is using the scanner app while committing a burglary.

      Anyone that supports “streaming” of scanner audio are putting nails in the coffin of the hobby. It won’t be long before all agencies point the finger to these smart phone scanner apps as an excuse to go 100% encrypted. It’s happening now.

      1. First and foremost, I support streaming 100% in my community for the simple fact that our law enforcement actively refuses to release *ANY* information as to why they are called out, or what they are doing. If it wasn’t for my scanner providing a broadcast for a newspaper 100 miles away (the closest news outlet that cares) nobody would have known about the girl that was molested by a carnival worker this week, among many other crazy things that has happened here.

        On the side of Radio Reference, the signals are delayed, and any law enforcement that broadcasts non-public information over a trunked system are morons. Sure, there are two very different views on it, but the majority of radio reference streams are VERY useful for quite a few of us!

        > “Anyone that supports “streaming” of scanner audio are putting nails in the coffin of the hobby.”

        This has been the single largest point of contact for radio frequencies since the majority of people started using the internet – it’s been around for damn near 20 years and there hasn’t been ‘nails in the coffin’ yet… ;)

        And on a side note – there aren’t many law enforcement agencies that order a trunking system that doesn’t have the ability to encrypt transmissions for sensitive broadcasts. P25 is decodable relatively easily for a while now, so that’s not stopping anybody…

    2. Jonathan Wilson – They have. However, the economy is not so good and there are not so many LEO grants from the old LEAA any more for P25 Digital systems. Trunking is the latest craze but it does NOT thwart monitoring. You can still monitor trunked systems with a plain old scanner. However, you have to listen to a lot of beeping, data, and unrelated conversations from various city departments.

      Even the FBI doesn’t encrypt all the time. There are too many Luddites at FBI (old timers) who just hate complicated radios and computers. Also Spread Spectrum tends to have synch problems occasionally, and a disgruntled agent might throw the damn thing in the river rather than try to figure out how to simply resynch after calling in his team and no one replies.

      The “other” guys are not found of VOICE systems at all. Voice allows too many chances for audio interception at the microphone or loudspeaker and is usually undocumented when you need to “finger-point” (i.e. blame game) later. They prefer digital PDA gadgets like this:

      https://cnet3.cbsistatic.com/hub/i/r/2009/01/12/4d0e9154-f8de-11e2-8c7c-d4ae52e62bcc/thumbnail/670×503/f2603016472dba5fe980addae17406e1/obama4.jpg

  4. Lets think about this encryption issue. I think it presents a great new technical challenge. Most of these encrypted PTT radios are a pain in the ass to re-key – so the keys are fairly static. P25 is notoriously suseptible to jammers when encrypted. Its so bad that more often than not the users switch off the encryption. I think this is a great oppertunity for the community to take snap shots of the encrypted traffic and community-break out the keys via massive community GPU paralell attack. Sort of a “bit coin of public service monitoring”.

    Sent from my Timex Sinclair ZX-81

    1. Typical geek “let’s-make-it-complicated” mentality (also you don’t know wtf you’re talking about). “If” a dufus adversary wanted to waste time and ‘jam’ a system, you don’t need anything fancy. Just a couple of transmitters to block the receive frequencies near the system receiver sites will pretty much knock those sites off the air (something called an “illegal carrier” alarm will remove the channels – remove enough, and the site is dead). Nothing complicated.

      Enough with the “oh we can decrypt their key” shit.

      Most police chiefs I work with have no problem with their community monitoring their radio traffic. The problem arises when some dickhead begins to stream the audio so any numbskull with a smart phone app can listen to it. The barrier to entry in the past was, you had to buy a scanner, and program it. Now, any thug with a smartphone can monitor their traffic.

      So go ahead, keep streaming the audio, it’ll give plenty of excuses for the next budget request to include AES encryption, OTAR (and the associated infrastructure to support it), all because some f’in fool wants to stream audio. The few ruining it for the many.

      1. I am not at all advocating any sort of jammig — especially of the public safety networks!!! Lets get that straight, But the fact is (do the research dude – DSP comm system development has been my job for the past 15 years) that P25 requires 30dB more SNR when encrypted. (That means “allot whole lot more”) So, as it turns out, when users find them selfs in fringe areas / in crappy multi-path environments (that means “in-doors “) they often have to shut off the encryption. It turns out that this is a HUGE gift to the adversary providing much unencrypted info, that will some time later (or earlier) have been encrypted. This is called “depth” – and it is what lets crypto attacks become possible. A classic example of this mistake is the 3rotor broadcast of the weather reports by the germans during ww2 – and then they would switch to 4 rotor for the rest of the day. This turned a needle in a haystack problem to a one in 26 problem. Anyway the point is that it can, and will be broken. Period.

        As far as your opinions on whether or not the traffic should be encrypted, or what the police chiefs think, it’s irrelevant. it’s political. Your opinion simply don’t matter to those who make the decisions. Personally I agree that the traffic should not be encrypted. But nobody in the decision tree cares what I think. So the point is, if you ever want to monitor this radio traffic, stop complaining about it and start figuring out how to program on your GPU. I don’t like it anymore than you do, but that’s the only way I see anyone monitoring this traffic in the future.

    2. Lou – Albeit I do not share nm4927 vitriol and angst, I do like your opinion. If the LEO’s wanted to really hide their operational security from bad guys, there are OTHER ways to do it. Yes Spread Spectrum Frequency Hopping is a really good method as you just don’t hear ANYTHING on your police scanner. But they are talking to each other on their police radios. Jamming is a lot harder but not impossible. I don’t recommend doing that as when your own mother is calling 911 while those local thugs are breaking down her door, I’m sure you would NOT be recommending jamming the police frequencies.

      How do the “other” guys hide in plain site? Google: NUMBERS STATIONS. Yes they transmit in the open audible sequence of numbers over and over again. They don’t give 2 -shi** whose listening as the numbers are ciphers which can be deciphered into a real dispatch instruction.

      But you might say: “Who the frick wants to sit in the squad car trying to dicpher coded instructions?” Well this is the 21st century. There is technology with voice recognition and syntheses to do it for you. And it doesn’t have to be voice. It can be typed data from the dispatcher to your police car terminal. They already do this today but it is not unbreakable code. A bad guy can probably still decrypt a police terminal transaction. Heck they can unscramble a simple voice scrambler too.

      So if the LEO’s would use a rolling 10-code system they can transmit in the open with no encryption. Just have the 10-code library randomly change every day based on a changing private key. NO ONE like your buddy or wife has a copy of the code on paper like the old days. You would need a PC or Smartphone to figure out what the dispatcher is trying to tell you (no more memorization of 10-codes). If someone gets mixed up and looses synch, cell phone dispatcher, give your authentication id, and ask her what is the private-key number today? You punch it in and your back on synch!

      Bad guys are going “WTF???!!! I thought a 10-85 was suspicious car! Now I have no idea what a 10-85 is!” 10-85 could be coffee break today and traffic violation tomorrow. I know the old-timers are going to b*tch about it. Just scream back at them IT’S PROGRESS MR. RETRO!!! :-)

  5. Wow! I’m reading this and saying wow this sounds interesting. Maybe I can learn a few tips from this “Chris” guy on what I’m working on. I click the .IO link and BLAM! Wait a minute! THIS IS ME!!! My wife goes amazing! I’m saying wow! Good job Bryan. Good write up. I really like what you said.

    Here’s an update on “good data”. I tried RADIO REFERENCE but they did not have what I wanted. So I went to the FCC to see what they could offer. I think I got it here. They are compiling a text download right now for free. I’m just waiting to see if it has lat/lon data on it. If so I need to parse it out and make a JavaScript math manipulation on it. I’ll start with a flowchart so I can get my brain around this thing. I would love to see others to parallel work like [Colin Vallance] says he wants to do with Amateur Radio. Here’s the link:

    http://wireless2.fcc.gov/UlsApp/UlsSearch/searchAdvanced.jsp

    OK they just notified me it is done. I’m going to go look at it in a few minutes.

  6. For everyone disappointed that this article was not about using SDR to acquire GPS, allow me to leave a shameless plug for my blog, sdrgps.blogspot.com. On the blog I have examples with several different GPS SDR codes (GNSS-SDRLIB, gnss-sdr, and by end of week SoftGNSS) along with other SDR demos, tricks and tips. Not to mention a dataset from an RTLSDR stick flown on a high power rocket…

  7. It appears that my Delorme EarthMate LT-20 will not work on a 64-bit system (Windows 10) per an old 2015 post from [Galane]. Also can’t figure out how to get a text file log from it. So I’m going to go with another HaD’s idea [siluxmedia] with having Internet access and using JavaScript Geolocation to get my present lat/lon. If you want to play with it go to TRYIT EDITOR v3.0 (http://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation) and past in this javascript:

    Click the button to get your coordinates.

    Try It

    var x = document.getElementById("demo");

    function getLocation() {
    if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(showPosition);
    } else {
    x.innerHTML = "Geolocation is not supported by this browser.";
    }
    }

    function showPosition(position) {
    x.innerHTML = "Latitude: " + position.coords.latitude +
    "Longitude: " + position.coords.longitude;
    }


    _______________________________
    UPDATE ON FCC DOWNLOAD: Complete fail! The FCC will supply whatever you want on the output file EXCEPT the lat/lon coordinates. Can not figure out how to get the coords which you can see in the search results out to the text file download. So what I did I had to “hand massage” the text files, by using MS EXCEL, USPS Zipcode / Lat/Lon download, and Radio References break downs for my state. I had to just take the town/city names and reference the coords from the USPS file if the =if(match) command in Excel. It really does not matter that the coord of the police base station antenna is not accurate. Just as long as your inside the town/city. Close enough for government work!

    It resulted in a huge text file for just my state (Connecticut). But I think I got every town. If you make one for your state you should post it somewhere as a zip file. Maybe a github site? We could share them by state. Does not take long. It’s just busy work. Probably Texas or California would be the biggest file. Maybe I’ll post the Connecticut zip file in my .IO project.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.