Re: [Hackrf-dev] Precise synthesizer tuning

2019-01-13 Thread Phil Karn
I revisited this problem yesterday and have it *almost* completely
resolved. By running the synthesizer programming formulas in parallel, I
am able to determine the actual tuned frequency as a function of a
requested frequency and adjust my software local oscillator to compensate.

The synthesizers in *both* the MAX2837 and the RFFC5072 have some weird
behaviors that made it difficult to figure out what was really going on.
(My signal generator stops at 2100 MHz so I was unable to test with the
MAX2837 alone, which requires a signal between 2150-2750 MHz.)

Digging into the firmware source and the synthesizer data sheets, I
found that the tuning step for the MAX2837 is:

30 MHz / 2^20 = 28.610229492... Hz

However, the synthesizer occasionally settles one step away from the
specified one. Reprogramming the same frequency seems to usually fix it.
Could this be a timing problem in how the firmware writes the registers?

The RFFC5072 step size depends on the frequency range, but is some small
multiple (or fraction) of

50 MHz / 2^24 = 2.980232239... Hz

But the RFFC5072 synthesizer always seems to settle one *half* step
above the desired frequency. This seems very strange, but maybe there's
something I don't understand about fractional-N synthesizers. (So far my
tests have been limited to frequencies where the step is 100 MHz/2^24 Hz).

In the source file firmware/common/max2837.c is the following mysterious
comment:

/* ASSUME 40MHz PLL. Ratio = F*(4/3)/40,000,000 = F/30,000,000 */

This implies the internal synthesizer reference is 30 MHz despite 40 MHz
being applied to the part by the Si5351C. This appears correct, but I
can't find any mention of this 4/3 (or 3/4) factor anywhere in the
MAX2837 documentation or register settings. Where does it come from?

Also in the firmware, when the RFFC5071 is used, an approximate
frequency that's an integer multiple of 1 MHz is passed to
rffc5071_config_synth_int in rffc5071.c. That function returns the
actual frequency, which is then used to adjust the tuning frequency
passed to the max2837. However, rffc5071_config_synth_int returns an
integer, so this also introduces a slight error. (It should probably
return a double).

I'd like to put in a plea to the designers of SDR front end APIs: please
have your "tune" function return its best estimate of the radio's actual
tuned frequency, taking into account synthesizer step sizes and TCXO
offset estimates.

It's perfectly OK for a radio to not give me the exact frequency I ask
for *PROVIDED* I know the actual frequency, because I can then easily
compensate for it in my software local oscillator.

Thanks!

Phil Karn

PS. One of the reasons I'm interested in precise frequency knowledge is
that I'm comparing local ATSC pilot carriers to my GPSDO. ATSC pilots
have attracted some interest as poor-man's frequency references, but my
observation is that only *some* TV stations actually use high stability
oscillators to control them. The others can be a few hertz off (not
counting those still operating with transition-era frequency offsets.)

___
HackRF-dev mailing list
HackRF-dev@greatscottgadgets.com
https://pairlist9.pair.net/mailman/listinfo/hackrf-dev


[Hackrf-dev] Precise synthesizer tuning

2018-09-22 Thread Phil Karn
I would like to determine the *exact* frequency of the HackRF when set
to a given frequency. Like nearly all modern tuners they use
"fractional-N" synthesis. They can only tune to frequency steps that are
often not a simple fraction of 1 Hz, and this step size often varies
with operating band.

I'd like to have either of two things, ideally both:

A formula that gives the exact frequency to which the HackRF tunes when
set to frequency 'f'.

A frequency where the HackRF synthesizer is exactly correct (assuming an
accurate timing reference) and the minimum frequency step that will keep
the synthesizer exactly on frequency throughout the HackRF's coverage
range. (This step size may vary with band as various dividers are
changed, but using the largest step size across the full coverage is the
easiest way.)

If I know the actual frequency of the synthesizer I can easily correct
for any offset in the software oscillator I use to downconvert the low
digital IF to DC.

I could probably figure this out by digging into the firmware and the
synthesizer data sheets, but I wanted to first see if someone could save
me the trouble.

Thanks!

Phil Karn, KA9Q
___
HackRF-dev mailing list
HackRF-dev@greatscottgadgets.com
https://pairlist9.pair.net/mailman/listinfo/hackrf-dev


Re: [Hackrf-dev] advice on a txco to buy?

2018-06-24 Thread Phil Karn
On 6/24/18 09:29, Giuseppe Marullo wrote:
> Ok, found:
> 
> http://www.nooelec.com/store/tiny-tcxo.html
> 
> 20USD and will fit inside the enclosure.

Here in San Diego the local microwave ham gang gets a supply of surplus
10 MHz TCXOs from old Qualcomm Omnitracs mobile units. It helps that
most of us are retired Qualcommers...

Phil

___
HackRF-dev mailing list
HackRF-dev@greatscottgadgets.com
https://pairlist9.pair.net/mailman/listinfo/hackrf-dev


Re: [Hackrf-dev] advice on a txco to buy?

2018-06-23 Thread Phil Karn
On 6/23/18 03:40, Giuseppe Marullo wrote:
> I was needing (and still searching) for a txco for the HackRf but I
> would like something internal to the box, not sure about what is sold on
> Ebay. Anyone could recommend something that surely would fit inside the
> Standard enclosure?

I got this GPSDO. Works very well so far. It's not inside the box, but
the stability and near foolproof nature of GPS make it worthwhile.

https://www.ebay.com/itm/NEW-10MHz-Sinwave-PLL-GPSDO-GPS-DISCIPLINED-OSCILLATOR-adapter-GPS-ANT/262038924752

Perhaps some Nth generation HackRF should have one built in. It just
takes another antenna connector.

Phil
___
HackRF-dev mailing list
HackRF-dev@greatscottgadgets.com
https://pairlist9.pair.net/mailman/listinfo/hackrf-dev


Re: [Hackrf-dev] Determining exact tuning frequency

2018-06-23 Thread Phil Karn
On 6/22/18 22:28, Chuck McManis wrote:
> Hi Phil,
> 
> What I've done is that I center tune into the neighborhood of where I
> want to tune, and then use either a DDC or a soft mixer function (in GRC
> or another module) to tune exactly where I want. If you're trying to
> homodyne to the precise frequency then I agree you'll not always be
> successful.

Yup, that's exactly what I already do with the AMSAT UK Funcube Dongle
Pro+. If the RF channel I want is outside the front end's passband, I
calculate a front end tuner frequency to park it at a nominal baseband
frequency, typically +/- Fs/4 so I can avoid DC artifacts. The Funcube
has a fixed 192 kHz sample rate, so I typically choose +/- 48 kHz.

Then I ask the front end to go there. Although the API lets me specify a
tuner frequency in 1 Hz steps, the fractional-N synthesizer can't
actually give them to me; the actual tuning step for that hardware and
choice of TCXO frequency is (IIRC) 1000/2048 Hz or some small integer
multiple thereof depending on the synthesizer's frequency-dependent
output divisor.

The Funcube's API doesn't tell me its actual exact frequency, so I
extracted the synthesizer programming formulas from its firmware and
execute them myself. Then I take the difference between the actual and
requested tuner frequency and fold it into my software oscillator (the
one running near +/-48 kHz).

As a fallback, I found that if I always request multiples of 125 Hz,
I'll get them exactly. (I can use smaller steps in the lower frequency
ranges, but it was easier to just pick 125 Hz as a worst case.)

Once the front end is close to the desired frequency I can make minor
tuning changes entirely in software, leaving the front end tuning alone.

I'd like to do the same thing(s) with the HackRF. I.e., if I can't get
the exact frequency for any requested frequency, I'd like to find the
smallest tuning step that will always give me exactly the frequency I
request.

> The other advantage of doing the tuning after you've got your pass band
> is that you can run multiple receivers off the same pass band data if
> they are all within range. One of my examples I show people is an FM
> radio with 5 different tuners. The HackRF is tuned to the center of the
> FM band and then I can move the 5 tuners anywhere within that band,
> demodulate them, and mix and match the audio. Nothing like having a bit
> of Classic Rock 98.5 in the background when listening to KFRC (KCBS FM)
> 106.9. 

Yup, I do exactly the same thing. I use multicast RTP to convey my IQ
data from the SDR front end to my software receiver, so I can simply run
multiple copies of the latter as long as they're tuned closely enough to
each other. I used it recently to receive APRS position reports from a
balloon that transmitted on both 144.39 and 144.34 MHz. Worked great.

Phil

___
HackRF-dev mailing list
HackRF-dev@greatscottgadgets.com
https://pairlist9.pair.net/mailman/listinfo/hackrf-dev


[Hackrf-dev] Determining exact tuning frequency

2018-06-22 Thread Phil Karn
Since the HackRF One (like most SDRs) uses fractional-N synthesizers, it
can't always give you the exact tuner frequency you ask for. I would
like to write a function to determine the actual frequency from the one
I ask for so I can compensate for the difference in a later point in my
processing chain. (I'm using a GPSDO clock so these small frequency
offsets are actually quite noticeable.)

I'm looking at the spec sheets and firmware for the various PLL
constants but I'd like to know if anyone has already done this. Thanks.

Phil

___
HackRF-dev mailing list
HackRF-dev@greatscottgadgets.com
https://pairlist9.pair.net/mailman/listinfo/hackrf-dev