Impedance Measurement and Curve Fitting

root3

You can measure the impedance of the device under test (DUT), such as your antennas, by observing the amplitude and the phase of a sinusoid applied to the device. Of course, the measurement should be relative to some reference, so practically you need to observe the two signals at the same time.

owon7MHz20mOpen

For example, in this figure, you wish to measure the amplitude and the phase of the signal in yellow using the signal in red as a reference.

See my page Antenna for the detailed discussions.

Actually measurement can be done in various ways, such as moving a cursor manually between the two zero-cross points to know the phase difference. Here is my trial to see what happens if I use the curve fitting functions provided by ROOT

A test data set is generated with a short C program, shown as black and white circles in the figure, and the curves in red and in yellow are the obtained results.

% root -x mytest4.cc

****************************************
Minimizer is Minuit / Migrad
Chi2                      =  2.09673e-08
NDf                       =           47
Edm                       =   4.1926e-08
NCalls                    =          121
p0                        =      1.00001   +/-   4.08054e-06 
p1                        =     0.100001   +/-   3.45297e-07 
p2                        =      6.48313   +/-   8.9754e-06  

****************************************
Minimizer is Minuit / Migrad
Chi2                      =   9.1854e-10
NDf                       =           47
Edm                       =  1.83714e-09
NCalls                    =           70
p0                        =     0.500002   +/-   8.8495e-07  
p1                        =          0.1   +/-   1.29983e-07 
p2                        =      3.13999   +/-   3.40443e-06 
root [1] 

The parameters p0, p1, and p2 are the amplitude, the frequency, and the phase.

// file name = mytest4.cc
{
  TGraph *g = new TGraph("myfile4a.dat");
  g->SetMarkerStyle( 20 );
  g->SetMarkerSize( 1.0 );
  g->Draw("AP");
  TF1 *f1 = new TF1("f1", "[0]*sin([1]*x+[2])");
  f1->SetParameter(0, 0.25);
  f1->SetParameter(1, 0.11);
  f1->SetParameter(2, 3.14+0.2);
  g->Fit(f1);
  
  TGraph *h = new TGraph("myfile4b.dat");
  h->SetMarkerStyle( 24 );
  h->SetMarkerSize( 1.0 );
  h->Draw("P"); 
  TF1 *f2 = new TF1("f2", "[0]*sin([1]*x+[2])");
  f2->SetParameter(0, 0.25);
  f2->SetParameter(1, 0.11);
  f2->SetParameter(2, 3.14+0.2);
  h->Fit(f2);
}

Leave a Reply

Your email address will not be published. Required fields are marked *