From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
In a previous document (Using RTL-SDR with Labview Chapter 1 Labview on Windows), it was shown that a simple €20.00 dvb-t dongle can be used as a frontend to a labview based SDR system. This document provided a library and instructions to the user that made it possible to retrieve the IQ streams from the rtl-sdr and showed a simple spectrum display of the signal received.
After this post, there were some questions with regards to an FM demodulator to listen to FM broadcasts. In this document, I will describe a simple, mono FM demodulator which can be used to listen to FM broadcast stations. I will not go into detail on FM modulation. There are many sources that can do this way better than myself. Search on ni.com or on wikipedia for the relevant information.
In order to demodulate a broadcast FM signal, it's important to understand the structure of this signal, as there is much more information contained in the FM signal than just the mono audio information. The following image should make things clearer:
As you can see, the mono audio is only occupies a relatively small part of the channel bandwidth from 30Hz to 15kHz. This is the portion that we will be focussing on.
As the name implies, FM, or frequency modulation, uses a baseband signal to modulate the frequency of a carrier signal. The amplititude of the signal stays the same. This is an advantage over amplitude modulation, where the information to be transmitted is contained within the modulated amplitude of the carrier. If the AM signal is weakend significantly, information is lost. Since the information for FM is contained in the zero-crossings of the signal, theoretically only a small signal level is required to reconstruct the entire baseband information.
The basic structure of the used demodulator is shown in the image below:
Here is a short description of the chain:
The attached project provides an application which performs exactly these steps, allowing the user to tune to a frequency and listen to the mono part of the fm broadcast. The demodulation is handled in a subvi, aptly named FM_Demodulation.vi, which looks like this:
As you can see, all the steps for fm demodulation are present. I've tried to comment the code as good as possible, and to adhere to the Labview coding guidelines. There are some parts which could probably be further split into subvi's, but I wanted the software to be easy to read and be understandable to everyone.
If you have any questions, please feel free to ask.
Hello Albert,
Thank you for this excellent tutorial on the RTL-SDR. I have been playing around with the attached Labview code and wondered if you could help me to answer something. I am wondering why the FFT of my demodulated audio shows the noise floor moving up when the radio transmitter is powered off instead of showing the 6KHz moving down? I have disabled AGC within the RTL-SDR and successfully prevented the same behavior in my RF spectrum FFT, but I'm not quite sure why it happens in the audio spectum. Any ideas?
Thank you,
Aaron Rice
Sorry for the dumb question, very new to radio here. My first intuition was that when the radio transmitter was turned off, I would see just the noise floor on the demodulated audio FFT. After thinking it through I understand that when the radio transmitter is turned off, there is no FM modulated signal to demodulate. At that point, the demodulated audio FFT window is just displaying garbage!
Best,
Aaron
Hi Aaron,
I'm really sorry I didn't reply to your comment earlier, but I didn't get notified about your first comment, so I never knew anyone had asked a question. I usually reply so if you have another question and I don't respond two or three days later, please pn me directly...
Anyway, you there aren't any stupid questions. Regarding AGC, there are two autogain systems. One is tuner AGC and one is the RTL AGC. Both act according to their own devices. So to disable autogain completely, you must turn BOTH off... Also, you are correct, garbage in, garbage out 😉
If you want to see noise floor, you can use the basic demo example, as it computes an FFT of the raw data. Also, please keep in mind that since there is no calibration available, any sort of scaling to dbm or dbuV makes little to no sense. This means any noise floor measurements are not scaled properly. I think I used dbFS (db Fullscale) which is easy, but stupid. Technically, to get a good scaling, one would have to take the set gain into account and calibrate with a known source...
Hope this helps,
Albert
Hi! From what I can see from the specs, this device should work. The chip seems to be alright. Of course, I cannot guarantee success for a device I don't have.
I have LabView 2020 and I installed the *.vip using VIPM. However, when I try to open the RTLSDR pallet, LabView immediately crashes and closes when I click on the pallet. Any ideas for what might be the problem or possible workarounds?
Hi,
no idea. I honestly haven't tried the VIPM library with LV2020. I'll try it out this weekend though, it's supposed to rain anyway. If necessary, I'll rebuilt the package with the new VIPM and upload it as a new version.
Hello, I hope you could help me. I was very interested in this project of yours. So i tried to run the project to learn and study about this fm demodulator. I already follows all the steps and download all the files needed. I also bought the RTL-SDR devices. Unfortunately, when I run the FM_Demodulation.vi, there is an error that I could not understand. Would you mind explained it to me and where should I correct it? I already try my best to fixed the problem but i failed terribly. Here I attached a picture of the said error. Thank you in advanced.
Hi,
you need to run the host_main.vi in order to run the software. The FM_Demodulation is a subVI and is dependent on the setup of the main.vi...
I see, sorry for that silly mistake. Thank you so much sir!
Good day! Albert, please tell me how to get the phase difference from 3 SDR receivers at a given signal frequency?