Forums › General Discussions › Reconciling bin size, span, trace length, center frequency, and start frequency
- This topic has 4 replies, 2 voices, and was last updated 8 years, 9 months ago by
andrewclegg.
- AuthorPosts
andrewcleggParticipantI’m trying to reconcile the bin size, span, trace length, center frequency, and trace start frequency values that are contained in the bbr header.
I would have expected that span = (bin size) * (trace length), but I’m finding that’s not the case. Here’s a specific example from a bbr header (read using 8-byte double-precision floats in python, except for trace length, which is read as a 4-byte integer):
Span = 50000.0
Bin size = 59.33973524305556
Trace length = 842
Center frequency = 3557000000.0
Trace start frequency = 3556975017.9714627Here, (bin size) * (trace length) = 49964.0570747, which is 35.9429253472 Hz (~0.6057 bin size) less than the span. However, the difference between the center frequency and the start frequency (24982.0285373 Hz) is an integer number of bin sizes (exactly 421). This leads me to suspect that the header’s span value is approximate (perhaps it’s the requested span size, as opposed to actual?), and in this case the actual span is 49964.0570746 Hz, not 50000 Hz. Or is there something else going on that I’m not taking into account?
Also, does the start frequency refer to the center of the lowest bin, or to the lower edge of the lower bin (i.e., 0.5 * bin size below the center frequency of the lowest bin)? I suspect the former (because otherwise the math gets even stranger), but want to be sure.
Sorry to be so detailed, but I am building a general purpose analysis pipeline that will need to correctly set the frequency axis regardless of the various combinations of span, trace length, etc., that might be encountered. I want to make sure I am understanding these values correctly from the get-go. I’m also running the Signal Hound off of a ~0.5 PPB frequency reference, so in deriving accurate frequencies from the bbr data, very small differences matter.
Thanks very much.
Andy
AndrewModeratorHi Andy,
I apologize for the confusion. The span found in the bbr file is the span that was entered by the user. Due to a number of reasons we aren’t able to hit the span,start,stop entered by the user exactly, so we return the frequency of the first bin and the bin size. If you need to calculate the frequency of any bin in the sweep, use the bin size and trace start frequency. The bbr file stores the user entered values so that we can display those nice round numbers on the UI when the user replays their sweep.
Let me know if you have follow up questions.
Regards,
A.J.
andrewcleggParticipantThat makes sense. Now I can go forth with confidence that I am assigning the right frequency to each bin. 🙂
Just to be sure, the frequency of the first bin (that is, the trace start frequency) corresponds to what is effectively the center of the first bin, not the lower edge of the first bin, correct?
Thanks for the quick reply!
Andy
AndrewModeratorHi Andy,
Yes, you can think of it as the center frequency of that bin.
Regards,
A.J.
andrewcleggParticipantGreat, thanks!
Andy
- AuthorPosts
You must be logged in to reply to this topic.