¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: TDR Python Script


 

Jump on in, Reg, the water's fine!

Personally, I would prefer that the TDR function be built into a Windows app (e.g. NanoVNASharp) -- I find using the the NanoVNA's touchscreen more than a little frustrating (e.g. entering frequencies). But that's just me -- each to their own taste.

In lieu of a stand-alone app that incorporates the TDR function, a program could be written to run (probably real-time) under a Python or Matlab environment, for those who have either. (Rune's might be real-time -- I haven't tried any of the Python-based programs).

As for myself -- I'm just writing my Matlab code for the fun of it. (And maybe someone else might find it useful.) And, maybe someday I'll incorporate it into a GUI running under the Matlab environment. But, to be honest, I've been an engineer since '77 and have never had a need for a TDR function. So would I ever use it? Doubtful, but you never know.

- Jeff, k6jca

By the way, if you happen to already know the length of your coax cable but not its velocity factor, with just a few more lines of code you can use the TDR function to calculate the coax cable's actual VF (should one ever need it). Here's what I did, but there is probably a simpler way...

Given (variables in the TDR routine):
Vfactor: Velocity Factor that was input into the TDR routine -- if trying to find actual Vfactor, this can be set to anything (e.g. 0.5).
length_in: TDR calculated length (based on Vfactor), in inches (could be in meters, too)

%
% extra stuff for calculating velocity factor if coax length is known...
% example: my unknown coax of length 164 inches.
%
actual_length_inches = 164; % Yes, I am using inches. That's what my tape-measure measures.
actual_length_meters = actual_length_inches/39.370; % Not used -- just a check.
correction_factor = actual_length_inches/length_in; % divide actual length by TDR calculated length...
vfactor_actual = Vfactor*correction_factor; % and apply as a correction factor

Join [email protected] to automatically receive all group messages.