Drawing the Smith chart with ROOT (3)

smithroot3

smithroot4

With my ATU, ICOM AH-4, the VSWR value becomes very close to 1.0 with the same antenna.

freq1=7.02387 MHz, freq2=7.02408 MHz
amp(v2/v1)=0.985099, phase(v2/v1)=0.00860836 rad
v1=(1,0i), v2=(0.985063,0.00847999i), v3=(1.01494,-0.00847999i)
z=(0.970428,0.0164633i), z50=(48.5214,0.823164i)
gamma=(-0.0149372,0.00847999i), abs=0.0171765, arg=150.416 deg
vswr=1.03495
cable_length=20 m, velocity_factor=0.67 , phase_toward_load=143 deg

Drawing the Smith chart with ROOT (2)

smithroot2

If you would like to know not only the Z(DUT) but also the radiation impedance of your antenna, you must go around toward load (counter clockwise rotation) on the Smith chart according to the length and the velocity factor of your cable.

In the figure, the blue dot shows the Z(DUT), and the green one the radiation impedance.

freq1=7.02687 MHz, freq2=7.02978 MHz
amp(v2/v1)=0.778415, phase(v2/v1)=-0.53185 rad
v1=(1,0i), v2=(0.670893,-0.394757i), v3=(1.32911,0.394757i)
z=(0.382788,-0.410701i), z50=(19.1394,-20.535i)
gamma=(-0.329107,-0.394757i), abs=0.51395, arg=-129.818 deg
vswr=3.1148
cable_length=20 m, velocity_factor=0.67 , phase_toward_load=143 deg
// file name = mytest46.cc
{
  ifstream finput("owondata.txt");
  Int_t iskip=8;
  std::string s;

  for(Int_t i=0;i<iskip;i++) {
    getline(finput, s);
  }

  const Int_t icount_max=8192;
  Int_t icount=0;
  Double_t dummy, data1[icount_max], data2[icount_max], data3[icount_max];
  while(icount < icount_max) {
    finput >> data1[icount] >> dummy >> data2[icount] >> data3[icount];
    if(finput.eof()) break;
    icount++;
  }

  TCanvas *c1 = new TCanvas("c1","Test",0,0,800,600);
  TGraph *g = new TGraph(icount, data1, data2);
  g->SetMarkerStyle( 20 ); 
  g->SetMarkerSize( 0.5 );
  g->Draw("AP");
  TF1 *f1 = new TF1("f1", "[0]*sin([1]*x+[2])-[3]");
  f1->SetParameter(0, 2000.0);
  f1->SetParameter(1, 0.022);
  f1->SetParameter(2, 0.0);
  f1->SetParameter(3, 0.0);
  f1->SetLineColor(kRed);
  g->Fit(f1);

  TGraph *h = new TGraph(icount, data1, data3);
  h->SetMarkerStyle( 24 ); 
  h->SetMarkerSize( 0.5 );
  h->Draw("P");
  TF1 *f2 = new TF1("f2", "[0]*sin([1]*x+[2])-[3]");
  f2->SetParameter(0, 2000.0);
  f2->SetParameter(1, 0.022);
  f2->SetParameter(2, 0.0);
  f2->SetParameter(3, 0.0);
  f2->SetLineColor(kYellow);
  h->Fit(f2);

  Double_t freq1, freq2;
  const Double_t fsample = 2000.0; // MHz (interpolated)
  freq1 = fsample / ( 2.0*TMath::Pi() / f1->GetParameter(1) );
  freq2 = fsample / ( 2.0*TMath::Pi() / f2->GetParameter(1) );
  std::cout << "freq1=" << freq1 << " MHz, freq2=" << freq2 << " MHz" << std::endl;

  Double_t amp, phase;
  amp   = f2->GetParameter(0) / f1->GetParameter(0);
  phase = f2->GetParameter(2) - f1->GetParameter(2);
  std::cout << "amp(v2/v1)=" << amp << ", phase(v2/v1)=" << phase << " rad" << std::endl;

  TComplex v1, v2, v3, Z, z50;
  v1  = TComplex(1.0, 0.0);
  v2  = TComplex( amp*TMath::Cos(phase), amp*TMath::Sin(phase) );
  v3  = 2.0*v1 - v2;
  z   = v2/v3;
  z50 = 50.0*z;
  std::cout << "v1=" << v1 << ", v2=" << v2 << ", v3=" << v3 << std::endl;
  std::cout << "z=" << z << ", z50=" << z50 << std::endl;

  TComplex gg;
  Double_t gg_rho, gg_theta, vswr;
  gg  = (z-1.0)/(z+1.0);
  vswr = (1.0+TComplex::Abs(gg)) / (1.0-TComplex::Abs(gg));

  std::cout << "gamma=" << gg 
            << ", abs=" << gg.Rho()
            << ", arg=" << gg.Theta()*360.0/(2.0*TMath::Pi()) << " deg" << std::endl;
  std::cout << "vswr=" << vswr << std::endl;

  TCanvas * CPol = new TCanvas("CPol", "Test", 900, 0, 600, 600);
  const Int_t ncircle = 36000;

  Double_t radius[ncircle];
  Double_t theta [ncircle];
  for (Int_t i=0; i<ncircle; i++) {
    radius[i] = gg.Rho();
    theta [i] = TMath::Pi()*2.0*(Double_t)i/(Double_t)(ncircle-1);
  }

  Double_t radius_r[ncircle];
  Double_t theta_r [ncircle];
  Double_t r_center = z.Re() / (z.Re()+1.0);
  Double_t r_radius = 1.0    / (z.Re()+1.0);
  for (Int_t i=0; i<ncircle; i++) {
    Double_t th = TMath::Pi()*2.0*(Double_t)i/(Double_t)(ncircle-1);
    Double_t re = r_center + r_radius*TMath::Cos(th);
    Double_t im =            r_radius*TMath::Sin(th);
    TComplex ww = TComplex(re, im);
    radius_r[i] = ww.Rho  ();
    theta_r [i] = ww.Theta();
  }

  Double_t radius_x[ncircle];
  Double_t theta_x [ncircle];
  TComplex x_center = TComplex(1.0, 1.0/z.Im());
  Double_t x_radius = 1.0/ z.Im();
  for (Int_t i=0; i<ncircle; i++) {
    Double_t th = TMath::Pi()*2.0*(Double_t)i/(Double_t)(ncircle-1);
    Double_t re = x_center.Re() + x_radius*TMath::Cos(th);
    Double_t im = x_center.Im() + x_radius*TMath::Sin(th);
    TComplex ww = TComplex(re, im);
    radius_x[i] = ww.Rho  ();
    theta_x [i] = ww.Theta();
  }

  TGraphPolar * grP1 = new TGraphPolar(ncircle, theta, radius);
  grP1->SetTitle("Smith Chart");
  grP1->SetMarkerStyle(20);
  grP1->SetMarkerSize(2.0);
  grP1->SetMarkerColor(4);
  grP1->SetLineColor(2);
  grP1->SetLineWidth(3);
  grP1->Draw("C");
  CPol->Update();

  grP1->GetPolargram()->SetToRadian();
  grP1->GetPolargram()->SetRangeRadial(0,1);

  TGraphPolar * grP2 = new TGraphPolar(ncircle, theta_r, radius_r);
  grP2->SetMarkerStyle(20);
  grP2->SetMarkerSize(2.0);
  grP2->SetMarkerColor(4);
  grP2->SetLineColor(9);
  grP2->SetLineWidth(3);
  grP2->Draw("C");

  TGraphPolar * grP3 = new TGraphPolar(ncircle, theta_x, radius_x);
  grP3->SetMarkerStyle(20);
  grP3->SetMarkerSize(2.0);
  grP3->SetMarkerColor(4);
  grP3->SetLineColor(6);
  grP3->SetLineWidth(3);
  grP3->Draw("C");

  TMarker *m0 = new TMarker(gg.Re(), gg.Im(), 20);
  m0->SetMarkerSize(2.0);
  m0->SetMarkerColor(4);
  m0->Draw();

  Double_t freq = (freq1+freq2)/2.0; // MHz
  Double_t cable_length = 20.0; // meter
  Double_t velocity_factor = 0.67;
  Double_t wave_length = velocity_factor * (300.0 / freq);
  Double_t phase_toward_load = 2.0 * 2.0 * TMath::Pi() * (cable_length / wave_length);
  std::cout << "cable_length=" << cable_length
            << " m, velocity_factor=" << velocity_factor
            << " , phase_toward_load=" << (Int_t) ( phase_toward_load * 360.0 / (2.0*TMath::Pi()) ) % 360
            << " deg" << std::endl;

  TComplex gg_toward_load = gg * TComplex::Exp(TComplex(0.0, phase_toward_load));

  TMarker *m1 = new TMarker(gg_toward_load.Re(), gg_toward_load.Im(), 20);
  m1->SetMarkerSize(2.0);
  m1->SetMarkerColor(8);
  m1->Draw();
}

Drawing the Smith chart with ROOT

smithroot

You can write the Smith chart with ROOT once you get Z(DUT), and therefore, the reflection coefficient. Note that the Smith chart is merely a polar plot of the reflection coefficient on a complex plane, limited within a radius of 1.0.

In the figure, the blue dot shows the reflection coeffcient of (-0.328107, -0.394757i), or (0.51395, -129.818 deg). The red circle shows the constant Abs(reflection coefficient) circle, or equivalently, the constant VSWR circle.

With a different length of the coaxial cable between your antenna and the measuring circuit, you will have your blue dot in other places, but they are always on the same red circle, ignoring the cable loss.

// file name = mytest45.cc
{
  ifstream finput("owondata2.txt");
  Int_t iskip=8;
  std::string s;

  for(int i=0;i<iskip;i++) {
    getline(finput, s);
  }

  const Int_t icount_max=8192;
  Int_t icount=0;
  Double_t dummy, data1[icount_max], data2[icount_max], data3[icount_max];
  while(icount < icount_max) {
    finput >> data1[icount] >> dummy >> data2[icount] >> data3[icount];
    if(finput.eof()) break;
    icount++;
  }

  TCanvas *c1 = new TCanvas("c1","Test",0,0,800,600);
  TGraph *g = new TGraph(icount, data1, data2);
  g->SetMarkerStyle( 20 ); 
  g->SetMarkerSize( 0.5 );
  g->Draw("AP");
  TF1 *f1 = new TF1("f1", "[0]*sin([1]*x+[2])-[3]");
  f1->SetParameter(0, 2000.0);
  f1->SetParameter(1, 0.022);
  f1->SetParameter(2, 0.0);
  f1->SetParameter(3, 0.0);
  f1->SetLineColor(kRed);
  g->Fit(f1);

  TGraph *h = new TGraph(icount, data1, data3);
  h->SetMarkerStyle( 24 ); 
  h->SetMarkerSize( 0.5 );
  h->Draw("P");
  TF1 *f2 = new TF1("f2", "[0]*sin([1]*x+[2])-[3]");
  f2->SetParameter(0, 2000.0);
  f2->SetParameter(1, 0.022);
  f2->SetParameter(2, 0.0);
  f2->SetParameter(3, 0.0);
  f2->SetLineColor(kYellow);
  h->Fit(f2);

  double amp, phase;
  amp   = f2->GetParameter(0) / f1->GetParameter(0);
  phase = f2->GetParameter(2) - f1->GetParameter(2);
  std::cout << "amp=" << amp << ", phase=" << phase << std::endl;

  TComplex v1, v2, v3, Z, z50;
  v1  = TComplex(1.0, 0.0);
  v2  = TComplex( amp*TMath::Cos(phase), amp*TMath::Sin(phase) );
  v3  = 2.0*v1 - v2;
  z   = v2/v3;
  z50 = 50.0*z;
  std::cout << "v1=" << v1 << ", v2=" << v2 << ", v3=" << v3 << ", z=" << z << ", z50=" << z50 << std::endl;

  TComplex gg;
  double gg_rho, gg_theta, vswr;
  gg  = (z-1.0)/(z+1.0);
  vswr = (1.0+TComplex::Abs(gg)) / (1.0-TComplex::Abs(gg));

  std::cout << "gg=" << gg << ", abs=" << TComplex::Abs(gg) << std::endl;
  std::cout << "gg=" << gg.Rho() << ", " << gg.Theta()*360.0/(2.0*TMath::Pi())  << std::endl;
  std::cout << "vswr=" << vswr << std::endl;

  TCanvas * CPol = new TCanvas("CPol", "Test", 900, 0, 600, 600);
  const Int_t ncircle = 360;

  Double_t radius[ncircle];
  Double_t theta [ncircle];
  for (int i=0; i<ncircle; i++) {
    radius[i] = gg.Rho();
    theta [i] = TMath::Pi()*2.0*(double)i/(double)(ncircle-1);
  }

  Double_t radius_r[ncircle];
  Double_t theta_r [ncircle];
  Double_t r_center = z.Re() / (z.Re()+1.0);
  Double_t r_radius = 1.0    / (z.Re()+1.0);
  for (int i=0; i<ncircle; i++) {
    Double_t th = TMath::Pi()*2.0*(double)i/(double)(ncircle-1);
    Double_t re = r_center + r_radius*TMath::Cos(th);
    Double_t im =            r_radius*TMath::Sin(th);
    TComplex ww = TComplex(re, im);
    radius_r[i] = ww.Rho  ();
    theta_r [i] = ww.Theta();
  }

  Double_t radius_x[ncircle];
  Double_t theta_x [ncircle];
  TComplex x_center = TComplex(1.0, 1.0/z.Im());
  Double_t x_radius = 1.0/ z.Im();
  for (int i=0; i<ncircle; i++) {
    Double_t th = TMath::Pi()*2.0*(double)i/(double)(ncircle-1);
    Double_t re = x_center.Re() + x_radius*TMath::Cos(th);
    Double_t im = x_center.Im() + x_radius*TMath::Sin(th);
    TComplex ww = TComplex(re, im);
    radius_x[i] = ww.Rho  ();
    theta_x [i] = ww.Theta();
  }

  TGraphPolar * grP1 = new TGraphPolar(ncircle, theta, radius);
  grP1->SetTitle("Smith Chart");
  grP1->SetMarkerStyle(20);
  grP1->SetMarkerSize(2.0);
  grP1->SetMarkerColor(4);
  grP1->SetLineColor(2);
  grP1->SetLineWidth(3);
  grP1->Draw("C");
  CPol->Update();

  grP1->GetPolargram()->SetToRadian();
  grP1->GetPolargram()->SetRangeRadial(0,1);

  TGraphPolar * grP2 = new TGraphPolar(ncircle, theta_r, radius_r);
  grP2->SetMarkerStyle(20);
  grP2->SetMarkerSize(2.0);
  grP2->SetMarkerColor(4);
  grP2->SetLineColor(9);
  grP2->SetLineWidth(3);
  grP2->Draw("C");

  TGraphPolar * grP3 = new TGraphPolar(ncircle, theta_x, radius_x);
  grP3->SetMarkerStyle(20);
  grP3->SetMarkerSize(2.0);
  grP3->SetMarkerColor(4);
  grP3->SetLineColor(6);
  grP3->SetLineWidth(3);
  grP3->Draw("C");

  TMarker *m0 = new TMarker(gg.Re(), gg.Im(), 20);
  m0->SetMarkerSize(2.0);
  m0->SetMarkerColor(4);
  m0->Draw();
}
% root mytest45.cc
amp=0.778415, phase=-0.53185
v1=(1,0i), v2=(0.670893,-0.394757i), v3=(1.32911,0.394757i), z=(0.382788,-0.410701i), z50=(19.1394,-20.535i)
gg=(-0.329107,-0.394757i), abs=0.51395
gg=0.51395, -129.818
vswr=3.1148

Impedance Measurement and Curve Fitting (5)

So if you put everything into a single macro, you will have:

// file name = myetst41.cc
{
  TGraph *g = new TGraph("myfile3.dat");
  g->SetMarkerStyle( 20 ); 
  g->SetMarkerSize( 0.5 );
  g->Draw("AP");
  TF1 *f1 = new TF1("f1", "[0]*sin([1]*x+[2])-[3]");
  f1->SetParameter(0, 2000.0);
  f1->SetParameter(1, 0.022);
  f1->SetParameter(2, 0.0);
  f1->SetParameter(3, 0.0);
  f1->SetLineColor(kRed);
  g->Fit(f1);

  TGraph *h = new TGraph("myfile4.dat");
  h->SetMarkerStyle( 24 ); 
  h->SetMarkerSize( 0.5 );
  h->Draw("P");
  TF1 *f2 = new TF1("f2", "[0]*sin([1]*x+[2])-[3]");
  f2->SetParameter(0, 2000.0);
  f2->SetParameter(1, 0.022);
  f2->SetParameter(2, 0.0);
  f2->SetParameter(3, 0.0);
  f2->SetLineColor(kYellow);
  h->Fit(f2);

  double amp, phase;
  amp   = f2->GetParameter(0) / f1->GetParameter(0);
  phase = f2->GetParameter(2) - f1->GetParameter(2);
  std::cout << amp << ", " << phase << std::endl;

  TComplex v1, v2, v3, Z, z50;
  v1  = TComplex(1.0, 0.0);
  v2  = TComplex( amp*TMath::Cos(phase), amp*TMath::Sin(phase) );
  v3  = 2.0*v1 - v2;
  z   = v2/v3;
  z50 = 50.0*z;
  std::cout << v1 << ", " << v2 << ", " << v3 << ", " << z << ", " << z50 << std::endl;

  TComplex rho;
  double vswr;
  rho  = (z-1.0)/(z+1.0);
  vswr = (1.0+TComplex::Abs(rho)) / (1.0-TComplex::Abs(rho));
  std::cout << rho << ", " << vswr << std::endl;
}
% root mytest41.cc
0.778415, -0.53185
(1,0i), (0.670893,-0.394757i), (1.32911,0.394757i), (0.382788,-0.410701i), (19.1394,-20.535i)
(-0.329107,-0.394757i), 3.1148

Impedance Measurement and Curve Fitting (4)

vectors2

If we evaluate numerically using the parameters p0 and p2 we have just obtained, we have:

vector(red)    = 1.0*cexp(i*0.0) = (1.0, 0.0)
vector(green)  = vector(red) = (1.0, 0.0)
vector(yellow) = 0.778415*vector(red)*cexp(i*-0.531850) = (0.670893, -0.394757)
vector(purple) = 2*vector(red)-vector(yellow) = (1.32911, 0.394757)

Now, we are ready to calculate the impedance of the DUT.

Z(DUT) = 50 ohm * vector(yellow) / vector(purple)   <-- because the current is the same.
       = 50 ohm * (0.670893, -0.394757) / (1.32911, 0.394757)
       = 50 ohm * (0.382787,-0.4107)
       = (19.1394,-20.535) ohm

Here is a short program to compute VSWR.

#include <complex>
#include <iostream>
using namespace std;
int main() {
 complex<double> x(0.670893, -0.394757);
 complex<double> y(1.32911 ,  0.394757);
 complex<double> rho;
 double vswr;
 cout << x << y << x/y << 50.0*x/y << endl;
 rho  = (x/y-1.0)/(x/y+1.0);
 vswr = (1.0+abs(rho))/(1.0-abs(rho));
 cout << rho << vswr << endl;
 return 0;
}

The output of the program is:

% ./a.out
(0.670893,-0.394757)(1.32911,0.394757)(0.382787,-0.4107)(19.1394,-20.535)
(-0.329108,-0.394756)3.1148

You can also use the Smith chart to get VSWR from Z(DUT).

smith1

Impedance Measurement and Curve Fitting (3)

root4

vectors

In the figure, two signals are represented as vectors. The red one shows the reference signal, and the yellow one the signal across the DUT. Actually, the two vectors are rotating counterclockwise (by convention) with the source signal frequency of 7026kHz, but we are only interested in relative relations of the vectors.

Now, how do we know the impedance of the DUT? Recalling the measuring circuit, we can add two more vectors in the figure.

directionalbridge2

vectors2

Note that the red and the green vectors are the same, because the two 50 ohm resistors are in series. The purple vector is obtained as a difference between twice the red vector and the yellow vector.

Impedance Measurement and Curve Fitting (2)

root5

Now let’s try to measure the impedance of my dipole antenna. The figure shows the reference signal in red and the signal across the antenna in yellow. If the impedance of the dipole antenna is exactly 50 ohm, the two signals should be the same.

% head -15 owondata.txt
Save Time: 2016-09-11 13:27:26
Units:(mV)
                           CH1            CH2
Frequency:           7.026 MHz      7.042 MHz
Period:               0.142 uS       0.142 uS
SP:                   0.001 uS       0.001 uS
PK-PK:                 4.080 V        3.200 V

1              0.000                  1760.00        1560.00
2              0.001                  1760.00        1560.00
3              0.001                  1720.00        1560.00
4              0.002                  1720.00        1560.00

A text file obtained from the oscilloscope, OWON PDS 5022S, is fed into an AWK one-liner before being processed by a program written in ROOT.

% cat owondata.txt | awk 'NR>8 {print $1, $3}' >owondata_ch1.txt
% cat owondata.txt | awk 'NR>8 {print $1, $4}' >owondata_ch2.txt
// file name = mytest5.cc
{
  TGraph *g = new TGraph("owondata_ch1.dat");
  g->SetMarkerStyle( 20 );
  g->SetMarkerSize( 0.5 );
  g->Draw("AP");
  TF1 *f1 = new TF1("f1", "[0]*sin([1]*x+[2])+[3]"); 
  f1->SetParameter(0, 2000.0);
  f1->SetParameter(1, 0.022);
  f1->SetParameter(2, 0.0);
  f1->SetParameter(3, 0.0);
  f1->SetLineColor(kRed);
  g->Fit(f1);

  TGraph *h = new TGraph("owondata_ch2.dat");
  h->SetMarkerStyle( 24 );
  h->SetMarkerSize( 0.5 );
  h->Draw("P");
  TF1 *f2 = new TF1("f2", "[0]*sin([1]*x+[2])+[3]");
  f2->SetParameter(0, 2000.0);
  f2->SetParameter(1, 0.022);
  f2->SetParameter(2, 0.0);
  f2->SetParameter(3, 0.0);
  f2->SetLineColor(kYellow);
  h->Fit(f2);
}

root4

% root mytest5.cc

****************************************
Minimizer is Minuit / Migrad
Chi2                      =       536853
NDf                       =          996
Edm                       =  7.63442e-09
NCalls                    =          148
p0                        =      2001.67   +/-   1.04511     
p1                        =    0.0220756   +/-   1.82267e-06 
p2                        =      2.03624   +/-   0.00102561  
p3                        =     -12.2567   +/-   0.749788    

****************************************
Minimizer is Minuit / Migrad
Chi2                      =       459226
NDf                       =          996
Edm                       =  8.91283e-08
NCalls                    =          128
p0                        =      1558.13   +/-   0.960465    
p1                        =    0.0220847   +/-   2.15852e-06 
p2                        =      1.50439   +/-   0.00124773  
p3                        =     -14.2113   +/-   0.68435     

The parameters p0 and p2 are the amplitude and the phase, respectively, so the amplitude ratio is 1558.13/2001.67=0.778415, and the phase difference is 1.50439-2.03624=-0.531850[rad]=-30.4728[deg].

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);
}

Second Opinion

capture_001_12122013_191243

> Tried stub matching at 7MHz (d1=3490.4 mm, and d2=962.6mm) with unexpected results.

Rechecked assuming a 50 ohm cable instead of 75 ohm ones. Ignoring the velocity factor of 0.66, now we have d1=6275.5 mm, and d2=1587.5 mm.

capture_002_12122013_191332]

This is a second opinion by:
http://www.amanogawa.com/archive/SingleStub/SingleStub-2.html

capture_003_12122013_191449

The solutions obtained are the same for both methods, implying this part of the job is O.K.

Note: The two Smith Charts are equivalent, because in the latter case, Z is converted to Y, and the r=1 circle is now considered to be the g=1 circle. It is also interesting that the solution #1 gives somewhat broader bandwidth than the solution #2 in this particular case. (See the last figure.)

New Dipole Ant (2)

capture_002_22092013_191716

Tried stub matching at 7MHz (d1=3490.4 mm, and d2=962.6mm) with unexpected results.

At 18.078MHz, V1=2.489 V, V2=3.236 V, V2delay=+5.0 nS, which gives Z=19.204+j53.537 ohm, SWR=5.8, and Zant=53.754-j103.264 ohm.

At 14.010MHz, V1=3.236 V, V2=5.014 V, V2delay=-2.0 nS, which gives Z=108.802-j90.822 ohm, SWR=3.8, and Zant=24.688-j44.895 ohm.

At 10.110MHz, V1=2.837 V, V2=3.614 V, V2delay=+1.0 nS, which gives Z=85.563+j15.044 ohm, SWR=1.8, and Zant=76.744+j24.942 ohm.

At these three bands, I can operate by using the internal antenna tuner of my rig, and I QSOed with stations in Ishikawa and Yamaguchi prefectures on 10MHz band.

However, at 7.026MHz, V1=2.656 V, V2=4.789 V, V2delay=+4.6 nS, which gives Z=75.131+j194.488 ohm, SWR=12.1, and Zant=4.118+j1.571 ohm, which I expected to be around 50+j0 ohm.