Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tuning bug at ~1230MHz where RF second harmonic appears at IF #1256

Open
karriforesthermit opened this issue Jan 9, 2023 · 8 comments
Open
Assignees
Labels

Comments

@karriforesthermit
Copy link

What would you like to know?

I am a beginner at SDR. I have new HackRF One running 2022.09.01 firmware. The following spectrum from the UHF L-Band is essentially from

hackrf_sweep -a 0 -l 16 -g 16 -f 1220:1250 -w 40000 -N5000

UHF-LBand

There are a number of signal peaks here. For example, the small one about 1227MHz, in the middle of the first trough, which I assume is a GPS signal.

I have two questions:

  1. Why does the spectrum have those two unlikely looking troughs?

  2. Why do I not see these troughs nor the big peak at 1225MHz when I use Gnuradio Companion to examine the spectrum around these frequencies? That is, using an Osmocom Source (20M sample rate, centre frequency at say 1226Mhz, bandwidth 40kHz) piped into a Frequency Sink.)

Is this something to do with the hardware configuration?

@karriforesthermit karriforesthermit added the question question from the community that is not technical support label Jan 9, 2023
@mmm545
Copy link

mmm545 commented Jan 9, 2023

I believe those are LTE signals, GPS signals are much weaker than that and take more bandwidth

@karriforesthermit
Copy link
Author

OK. That makes sense.

@martinling
Copy link
Member

Something odd is definitely happening there but it makes a bit more sense if you know how the sweep mode works.

At each tuning step, we actually measure two 5MHz wide bands of spectrum, with a 5MHz gap in between them. So those two troughs are actually from the same batch of samples, covering 1225-1230 and 1235-1240 MHz. The big peak at ~1225 MHz looks like it is actually just within the first band so probably part of the same problem.

When capturing these two bands, the HackRF will have been tuned to a centre frequency of 1232.5 MHz. If you tune to that centre frequency in GRC, do you also see anomalous results?

@mossmann
Copy link
Member

I think you have found a tuning bug. I can reproduce the 1225 MHz spike when I sweep over the same frequency range. Do you get different results if you start the sweep at 1199 MHz instead of 1200 MHz?

@karriforesthermit
Copy link
Author

Hello Mike, impressive suggestion. Starting the sweep at 1199MHz the big spike is greatly diminished, although the two troughs are still evident.

UHF-LBand2

To Martin's suggestion, tuning to a centre frequency of 1232.5MHz does not appear to make any difference. On the other hand, in GRC I find that even the "High" averaging in the Frequency Sink is not a sufficiently long period to identify any of the peaks seen in the sweeps.

@mossmann
Copy link
Member

What's happening here is that for RF in the vicinity of 1230 MHz, the firmware chooses an IF that is approximately double the RF. When this happens, a mixing product of the two LOs appears in the received bandwidth. The effects of this spur vary depending on the precise tuning frequency, the version of firmware, and probably also on characteristics of the actual signal you are trying to receive. With hackrf_transfer you can work around this by explicitly setting the front-end LO and the IF, but hackrf_sweep doesn't give you this option as tuning decisions must be made in firmware. It is worth trying various frequencies from 1181 to 1200 MHz as the start-of-sweep frequency to see which one works best for your situation, but that is just a workaround for the poor choice of IF made by the firmware.

I'm marking this as a bug. We should fix the tuning algorithm in firmware so that it avoids choosing an IF that is very close to double or half of the RF.

@mossmann mossmann added the bug label Jan 12, 2023
@martinling martinling changed the title UHF L-Band spectrum sweep Tuning bug at ~1230MHz where RF second harmonic appears at IF Jan 12, 2023
@karriforesthermit
Copy link
Author

OK Thank you guys for your attention to this. I'll await the firmware update.
PS Mike, your YouTube lessons on HackRF are great and got me inspired to start on an SDR project. :)

@martinling martinling removed the question question from the community that is not technical support label Feb 3, 2023
@straithe
Copy link
Member

straithe commented Apr 2, 2023

@karriforesthermit have you tried the latest firmware?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants
@martinling @mossmann @straithe @karriforesthermit @mmm545 and others