Hydrogen Line Radio Astronomy

There are many articles on the internet on how to measure the hydrogen line yourself with (semi) DIY equipment. For example, one particularly informative article [1] covers the construction of the antenna, signal processing using GNU Radio and an explanation of why the measured spectrum looks the way it does. However, it seems that in most of these articles the receiver hardware, excluding the antenna, consists of commercial LNAs, filters, wideband amplifiers, etc.

On this page different receiver configurations are tested using, eventually, all custom components up to the SDR dongle. The focus lies at experimenting with the receiver components and signal processing to detect the hydrogen line. Code used for the measurements and signal processing can be found on GitHub or PyPi.

A First "Look"

2024/12/13

The goal of this first attempt is to get a reference point for future improvements. To keep it simple, the first receiver consists of a standard gain horn I could borrow, an LNA, a coupled-line filter and an RTL-SDR V3. The LNA is put directly after the antenna to minimize the noise figure of the receiver. However, this does leave the LNA vulnerable to out-of-band interfering signals, potentially wrecking havoc in-band due to intermodulation distortion. For example, this particular LNA has its peak gain around 850 MHz with frankly not great linearity. Hence, cell tower signals may very well cause intermodulation mayhem. The filter's main function is to avoid out-of-band signals from passing further down the receiver chain. Additionally, the gain of the SDR is set to zero, such that the internal receiver chip R820T2 has its highest IIP3 of 35 dBm [2, p.12]; the IIP3 is only specified for the two extreme gain settings, where the maximum gain setting of 50 dB would result in an IIP3 of -7.5 dBm, dominating the overall IIP3 of the receiver.


Receiver with specifications at 1420 MHz.

The overall receiver specifications are calculated for the frequency of interest. The P1dB point seems to be missing in the datasheet of the R820T2 so it is omitted in the table. The noise figure of the R820T2 is only noted for the maximum gain setting. As the primary stage has a significant amount of gain, the actual noise figure is of less importance, due to Friis' formula.

Calculated overall receiver specifications.

F (MHz) Gain (dB) NF (dB) IIP3 (dBm)
1420 15.26 1.91 2.54

Measurement Setup

Measurements are conducted at the 12th floor of a building at the edge of a city. This makes it considerably more convenient to measure multiple days in a row and keep the hardware in a more pleasant environment. However, this means that the horn can't be pointed straight up and is in an environment with lots of electronic equipment, increasing the risk of receiving man-made interference.

Signal Processing

The SDR is configured to take 2048 samples at 2048 ksps, which are multiplied by a Hanning window and FFT'd to get the power spectral density. These are averaged by combining 100000 consecutive measurements, which takes around 2 minutes. These settings are based on a project posted on the RTL-SDR website [3].

In a first step the frequency dependent gain of the receiver is corrected through a reference measurement with 50 Ω connected at the input of the LNA instead of the antenna. The reference measurement below illustrates the significant gain variation.


PSD of the receiver reference measurement.

The now flat(ter) noise floor power is centered at zero to have the same baseline for all measured spectra. Applied to the measured spectra and plotted as a waterfall, the Doppler shifted hydrogen line appears, but the spectrum is plagued by spurious tones.


The spurious tones seem to be periodic in frequency and time and very narrow-band. A simple method to remove these is to cherry pick bins by taking the median within a small moving window across frequency and subsequently across time; taking the average would smear out the large peaks. Finally, multiple Doppler shifted hydrogen lines can be seen. Most likely, these are the most prominent peaks of a single or different arms of the Milky Way, suggesting that the remaining part sits below the noise floor of the receiver or the quantization noise of the ADC.


New LNA and Processing Gain

2025/01/31

The previous LNA is moved further down the receiver chain after the filter and a new LNA with a lower noise figure and less out-of-band gain takes its place after the antenna. More gain and a lower noise figure will help to uncover more of the hydrogen line spectrum. The lower linearity of the new LNA was a trade-off made when choosing the bias point in favor of a lower noise figure. This turned out to be a good design choice. During measurements it became clear that the barcode-like interference pattern does not increase in amplitude as much as the signal of interest when playing with the gain of the RTL-SDR. Hence, it seems that the noise source couples through the USB-cable connecting the RTL-SDR to a Raspberry Pi running the measurement code. At the RTL-SDR it might be injected through the supply lines of the RF circuitry or ADC; noise injected earlier in the chain would have increased in amplitude due to later stage gain.


Receiver with specifications at 1420 MHz.

Calculated overall receiver specifications.

F (MHz) Gain (dB) NF (dB) IIP3 (dBm)
1420 33.36 1.07 -31.34

Another improvement opportunity was found by looking at the ADC of the RTL-SDR and the processing of the acquired samples. According to the datasheet of the RTL-SDR V3 its ADC has 8 bits [4]. However, the datasheet of the RTL2832U only mentions 7 bits [5]. Continuing with the most conservative value, the SNR of a 7 bit ADC is 43.9 dBFS, according to [6]

$$ \mathrm{SNR} = 6.02\cdot \# \mathrm{bits} + 1.76 \, \mathrm{dB}$$

This seems quite impractical. However, the RTL2832U first samples the analog signal at 28.8 Msps and later resamples this to the sample rate we define, e.g. the 2048 ksps from the first measurements. This can be seen as digital filtering, resulting in a processing gain, which allows to increase the SNR of the ADC [6]. Thus, by limiting the sample rate we benefit twice, i.e. by taking in less noise and increasing the processing gain.

Furthermore, it is also preferable to increase the number of samples, or equivalently the number of FFT frequency bins, as this results in a processing gain that lowers the FFT noise floor. For a fixed measurement time frame it is then better to increase the number of samples passed to the FFT over the number of FFT averages, as the latter only decreases the amplitude variation in the PSD [6].

Results

For these measurements the center frequency is changed to the frequency of the Hydrogen Line. The sample rate is kept at 2048 ksps, while the number of samples is increased significantly to 2^16, or 65536. To keep the total measurement time for a single PSD plot to two minutes, the increased number of samples is traded-off against less averaging over FFTs, which is decreased to 3749. While the SNR of the ADC remains unaltered, due to the same sampling rate, the FFT noise floor decreases. This can be verified in the 50 Ω reference measurement below compared to that of the previous measurement.

Below, the spectrum is shown accompanied by the part the of universe visible at that time; the antenna was pointed towards the center of the image.

The waterfall plots below are taken from a measurement campaign spanning multiple days. The stationary tones (barcode-like pattern) from the previous measurement were no longer present, so no moving median needed to be applied. With the increased gain in the receiver this made me conclude that these tones must be coming from the RLT-SDR. More gain was thus the solution to this problem.

Despite the good news, there are some peculiarities in the measurements. One oddity, the wraparound of the signal around the frequency axis, can be designated to aliasing; slightly increasing the sample rate will mitigate this, but it will decrease the ADC SNR. Alternatively, the center frequency can be changed back to 1420 MHz, as the Doppler shift is mostly negative.

There seems to be very little repeatability in the measurements. I would expect slight variations, but similar trends, every 24 hours. The cause remains unknown to me.

References

  1. Two D&D nerds. "Welcome to... The Astronomy Zone!" physicsopenlab. https://physicsopenlab.org/wp-content/uploads/2020/07/Hydrogen-Line-Project-Documentation.pdf (accessed December 2024).
  2. R820T2 Datasheet
  3. "Cheap and Easy Hydrogen Line Radio Astronomy with an RTL-SDR, WiFi Parabolic Grid Dish, LNA and SDRSharp" (accessed December 2024)
  4. RTL SDR V3 datasheet
  5. “RTL2832U.” Realtek, Nov. 01, 2010. [Online]. Available: https://homepages.uni-regensburg.de/~erc24492/SDR/Data_rtl2832u.pdf (accessed January 2025)
  6. W. Kester, “Taking the Mystery out of the Infamous Formula, ‘SNR = 6.02N + 1.76dB,’ and Why You Should Care.” Analog Devices. [Online]. Available: https://www.analog.com/media/en/training-seminars/tutorials/MT-001.pdf (accessed January 2025)