Questions about bill C-51 to my “representative” John McCallum in parliment.

March 20, 2015 Incoherent ramblings , , , ,

Hi John,

As a new home owner in the Markham-Unionville riding it appears you are my representative in parliament. I have some questions about the Canadian Bill C-51, which appears is being carried along with the spree of fear porn that the media is pushing after the recent shooting at the capital.

I would like to know the following:

– Who are the specific authors of this bill? If they were bureaucrats and lawyers that were not members of parliament themselves, who were the members of parliament that backed their work?

– Who are the primary financial backers of the members of parliament that either wrote or supported the writing of this bill?

– Are there any known copies of this bill that precede the capital shooting? If so, the same questions apply to the authors or supporters of those bills.

Sincerely,

Peeter Joot


A copy of this letter and any associated correspondence will be made publicly available.

Updated notes for ece1229 antenna theory

March 16, 2015 ece1229 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

I’ve now posted a first update of my notes for the antenna theory course that I am taking this term at UofT.

Unlike most of the other classes I have taken, I am not attempting to take comprehensive notes for this class. The class is taught on slides which go by faster than I can easily take notes for (and some of which match the textbook closely). In class I have annotated my copy of textbook with little details instead. This set of notes contains musings of details that were unclear, or in some cases, details that were provided in class, but are not in the text (and too long to pencil into my book), as well as some notes Geometric Algebra formalism for Maxwell’s equations with magnetic sources (something I’ve encountered for the first time in any real detail in this class).

The notes compilation linked above includes all of the following separate notes, some of which have been posted separately on this blog:

Image theorem

March 14, 2015 ece1229 , , , , , , , ,

[Click here for a PDF of this post with nicer formatting]

In the last problem set we examined the array factor for a corner cube configuration, shown in fig. 1.

 

homework3Fig1

fig. 1. A corner-cube antenna.

 

Motivation

This is a horizontal dipole antenna placed next to a metallic corner. The radiation at points in the interior of the cube have contributions due to the line of sight field from the antenna as well as reflections. We looked at an approximation of ground reflections using the \underlineAndIndex{Image Theorem}, modeling the ground as a perfectly conducting surface. I completely misunderstood that theorem and how it should be applied. As presented it seemed like a simple way to figure out the reflection characteristics. This confused me since it did not seem consistent with Fresnel reflection theory. I did try to reconcile to the two, but that reconciliation only appeared to work for certain dipole orientations, and that orientation dependence remained an open question.

It turns out that the idea of the Image Theorem is to find a source configuration that contains the specified source, but contains enough other sources that the tangential component of the electric field superposition is zero on the conducting surface, as required by Maxwell’s equations. This allows the boundary to be completely removed from the problem.

Thinking of the corner cube configuration as a reflection problem, I positioned sources as in fig. 2.

 

incorrectImagePlacementForCornerCubeFig2

fig. 2. Incorrect Image Theorem source placement for corner cube.

 

Because of the horizontal orientation of the dipole, I argued that the reflection coefficient should be -1. The reflection point is a bit messy to calculate, and it turns out to zeroth order in \( h/r \) the \( \sin\theta \) magnitude scaling of the reflected (far-field) field is present for both reflected rays. I though that this was probably because the observation point lays at the same altitude for both the line of sight ray and the reflected ray.

Attempting this problem as a reflection problem makes it much more difficult than it needs to be. It turns out that the correct image source placement for this problem is that of fig. 3.

 

cornerCubeImageSourcePlacementFig3

fig. 3. Correct image source placement for the corner cube.

 

This wasn’t at all obvious to me. The key is understanding that the goal of the image source placement isn’t to figure out how the reflection will occur, but to manufacture a source configuration for which the tangential component of the electric field is zero on the conducting surface.

Image placement for infinite conducting plane.

Before thinking about the corner cube configuration, consider a horizontal dipole next to an infinite conducting plane. This, and the correct image source placement is illustrated in fig. 4.

 

reflectionOfImagePointsFig1

fig. 4. Image source placement for horizontal dipole.

 

I’ll now verify that this is the correct image source. This is basically a calculation that the tangential components of the electric fields from both sources sum to zero.

Let,

\begin{equation}\label{eqn:imageTheorem:20}
r = \Abs{\Bs – \Br_0},
\end{equation}

so that the magnetic vector potential for the first quadrant dipole has the form

\begin{equation}\label{eqn:imageTheorem:40}
\BA = \frac{A_0}{4 \pi r} e^{-j k r} \zcap.
\end{equation}

With

\begin{equation}\label{eqn:imageTheorem:60}
\begin{aligned}
\kcap &= \frac{\Bs – \Br_0}{s} \\
\tilde{\BE} &= \zcap – \lr{\zcap \cdot \kcap} \kcap,
\end{aligned}
\end{equation}

the far-field electric field at the point \( \Bs \) on the plane is

\begin{equation}\label{eqn:imageTheorem:80}
\BE = -j \omega \frac{A_0}{4 \pi r} e^{-j k r} \tilde{\BE}.
\end{equation}

If the normal to the plane is \( \ncap \) the tangential component of this field is the projection of \( \BE \) on the direction

\begin{equation}\label{eqn:imageTheorem:100}
\pcap = \frac{\kcap \cross \ncap}{\Abs{\kcap \cross \ncap}}.
\end{equation}

That tangential component is directed along

\begin{equation}\label{eqn:imageTheorem:120}
\lr{\tilde{\BE} \cdot \pcap } \pcap
=
\lr{\lr{\zcap – \lr{\zcap \cdot \kcap} \kcap} \cdot \lr{\kcap \cross \ncap}} \frac{\kcap \cross \ncap}{\Abs{\kcap \cross \ncap}^2}.
\end{equation}

Because the triple product \( \kcap \cdot \lr{\kcap \cross \ncap} = 0 \), the tangential component of the electric field, provided \( \kcap \cdot \ncap \ne 0 \), is

\begin{equation}\label{eqn:imageTheorem:140}
\BE_\parallel
=
-j \omega \frac{A_0}{4 \pi r} e^{-j k r} \zcap \cdot \lr{\kcap \cross \ncap} \frac{\kcap \cross \ncap}{ 1 – \lr{ \ncap \cdot \kcap }^2 }.
\end{equation}

Now the wave vector direction for the second quadrant ray on the plane is required. Both \( \kcap’ \) and \( \Bs’ \) are reflections across the plane. Any such reflection has the value

\begin{equation}\label{eqn:imageTheorem:160}
\begin{aligned}
\Bx’
&= \lr{ \Bx \wedge \ncap} \ncap – \lr{ \Bx \cdot \ncap } \ncap \\
&= – \lr{ \ncap \wedge \Bx + \ncap \cdot \Bx } \ncap \\
&= – \ncap \Bx \ncap.
\end{aligned}
\end{equation}

This multivector product nicely encapsulates the reflection operation. Consider a reflection against the y-z plane with normal \( \Be_1 \) to verify that this works

\begin{equation}\label{eqn:imageTheorem:180}
\begin{aligned}
-\Be_1 \Bx \Be_1
&=
-\Be_1 \lr{ x \Be_1 + y \Be_2 + z \Be_3 } \Be_1 \\
&=
-\lr{ x – y \Be_2 \Be_1 + z \Be_3 \Be_1 } \Be_1 \\
&=
-\lr{ x \Be_1 – y \Be_2 + z \Be_3 } \\
&=
– x \Be_1 + y \Be_2 + z \Be_3.
\end{aligned}
\end{equation}

This has the x component flipped in sign and the rest left untouched as desired for a reflection in the y-z plane.

The second quadrant field will have \( \kcap’ \cross \ncap \) terms in place of all the \( \kcap \cross \ncap \) terms of \ref{eqn:imageTheorem:140}. We want to know how the two compare. This calculation is simply done using the dual form of the cross product temporarily

\begin{equation}\label{eqn:imageTheorem:200}
\begin{aligned}
\kcap’ \cross \ncap
&=
-I \lr{ \kcap’ \wedge \ncap} \\
&=
-I \gpgradetwo{\kcap’ \ncap} \\
&=
-I \gpgradetwo{ {-\ncap \kcap \ncap} \ncap} \\
&=
I \gpgradetwo{ \ncap \kcap } \\
&=
I \ncap \wedge \kcap \\
&=
-\ncap \cross \kcap \\
&=
\kcap \cross \ncap.
\end{aligned}
\end{equation}

So, provided the image source in the second quadrant is oppositely oriented (sign inversion), the tangential components of the two will sum to zero on that surface.

Thinking back to the corner cube, it is clear that an image source opposite to the source across from one of the walls will result in a zero tangential electric field along this boundary as is the case here (say the y-z plane). A second pair of sources opposite from each other anywhere else also about the y-z plane will not change that zero tangential electric field on this surface, but if the signs of the sources is alternated as in fig. 3 it will also result in zero tangential electric field on the z-x plane, which has the desired boundary value effects for both surfaces of the corner cube.

Tschebyscheff polynomials

March 13, 2015 ece1229 , , ,

[Click here for a PDF of this post with nicer formatting]

In ancient times (i.e. 2nd year undergrad) I recall being very impressed with Tschebyscheff polynomials for designing lowpass filters. I’d used Tschebyscheff filters for the hardware we used for a speech recognition system our group built in the design lab. One of the benefits of these polynomials is that the oscillation in the \( \Abs{x} < 1 \) interval is strictly bounded. This same property, as well as the unbounded nature outside of the \( [-1,1] \) interval turns out to have applications to antenna array design.

The Tschebyscheff polynomials are defined by

\begin{equation}\label{eqn:tschebyscheff:40}
T_m(x) = \cos\lr{ m \cos^{-1} x }, \quad \Abs{x} < 1 \end{equation} \begin{equation}\label{eqn:tschebyscheff:60} T_m(x) = \cosh\lr{ m \cosh^{-1} x }, \quad \Abs{x} > 1.
\end{equation}

Range restrictions and hyperbolic form.

Prof. Eleftheriades’s notes made a point to point out the definition in the \( \Abs{x} > 1 \) interval, but that can also be viewed as a consequence instead of a definition if the range restriction is removed. For example, suppose \( x = 7 \), and let

\begin{equation}\label{eqn:tschebyscheff:160}
\cos^{-1} 7 = \theta,
\end{equation}

so
\begin{equation}\label{eqn:tschebyscheff:180}
\begin{aligned}
7
&= \cos\theta \\
&= \frac{e^{i\theta} + e^{-i\theta}}{2} \\
&= \cosh(i\theta),
\end{aligned}
\end{equation}

or

\begin{equation}\label{eqn:tschebyscheff:200}
-i \cosh^{-1} 7 = \theta.
\end{equation}

\begin{equation}\label{eqn:tschebyscheff:220}
\begin{aligned}
T_m(7)
&= \cos( -m i \cosh^{-1} 7 ) \\
&= \cosh( m \cosh^{-1} 7 ).
\end{aligned}
\end{equation}

The same argument clearly applies to any other value outside of the \( \Abs{x} < 1 \) range, so without any restrictions, these polynomials can be defined as just

\begin{equation}\label{eqn:tschebyscheff:260}
\boxed{
T_m(x) = \cos\lr{ m \cos^{-1} x }.
}
\end{equation}

Polynomial nature.

Eq. \ref{eqn:tschebyscheff:260} does not obviously look like a polynomial. Let’s proceed to verify the polynomial nature for the first couple values of \( m \).

  • \( m = 0 \).\begin{equation}\label{eqn:tschebyscheff:280}
    \begin{aligned}
    T_0(x)
    &= \cos( 0 \cos^{-1} x ) \\
    &= \cos( 0 ) \\
    &= 1.
    \end{aligned}
    \end{equation}
  • \( m = 1 \).\begin{equation}\label{eqn:tschebyscheff:300}
    \begin{aligned}
    T_1(x)
    &= \cos( 1 \cos^{-1} x ) \\
    &= x.
    \end{aligned}
    \end{equation}
  • \( m = 2 \).\begin{equation}\label{eqn:tschebyscheff:320}
    \begin{aligned}
    T_2(x)
    &= \cos( 2 \cos^{-1} x ) \\
    &= 2 \cos^2 \cos^{-1}(x) – 1 \\
    &= 2 x^2 – 1.
    \end{aligned}
    \end{equation}

To examine the general case

\begin{equation}\label{eqn:tschebyscheff:340}
\begin{aligned}
T_m(x)
&= \cos( m \cos^{-1} x ) \\
&= \textrm{Re} e^{ j m \cos^{-1} x } \\
&= \textrm{Re} \lr{ e^{ j\cos^{-1} x } }^m \\
&= \textrm{Re} \lr{ \cos\cos^{-1} x + j \sin\cos^{-1} x }^m \\
&= \textrm{Re} \lr{ x + j \sqrt{1 – x^2} }^m \\
&=
\textrm{Re} \lr{
x^m
+ \binom{ m}{1} j x^{m-1} \lr{1 – x^2}^{1/2}
– \binom{ m}{2} x^{m-2} \lr{1 – x^2}^{2/2}
– \binom{ m}{3} j x^{m-3} \lr{1 – x^2}^{3/2}
+ \binom{ m}{4} x^{m-4} \lr{1 – x^2}^{4/2}
+ \cdots
} \\
&=
x^m
– \binom{ m}{2} x^{m-2} \lr{1 – x^2}
+ \binom{ m}{4} x^{m-4} \lr{1 – x^2}^2
– \cdots
\end{aligned}
\end{equation}

This expansion was a bit cavaliar with the signs of the \( \sin\cos^{-1} x = \sqrt{1 – x^2} \) terms, since the negative sign should be picked for the root when \( x \in [-1,0] \). However, that doesn’t matter in the end since the real part operation selects only powers of two of this root.

The final result of the expansion above can be written

\begin{equation}\label{eqn:tschebyscheff:360}
\boxed{
T_m(x) = \sum_{k = 0}^{\lfloor m/2 \rfloor} \binom{m}{2 k} (-1)^k x^{m – 2 k} \lr{1 – x^2}^k.
}
\end{equation}

This clearly shows the polynomial nature of these functions, and is also perfectly well defined for any value of \( x \). The even and odd alternation with \( m \) is also clear in this explicit expansion.

Plots

ChebychevFig1pn

Properties

In [1] a few properties can be found for these polynomials

\begin{equation}\label{eqn:tschebyscheff:100}
T_m(x) = 2 x T_{m-1} – T_{m-2}
\end{equation}
\begin{equation}\label{eqn:tschebyscheff:420}
0 = \lr{ 1 – x^2 } \frac{d T_m(x)}{dx} + m x T_m(x) – m T_{m-1}(x)
\end{equation}
\begin{equation}\label{eqn:tschebyscheff:400}
0 = \lr{ 1 – x^2 } \frac{d^2 T_m(x)}{dx^2} – x \frac{dT_m(x)}{dx} + m^2 T_{m}(x)
\end{equation}
\begin{equation}\label{eqn:tschebyscheff:440}
\int_{-1}^1 \inv{ \sqrt{1 – x^2} } T_m(x) T_n(x) dx =
\left\{
\begin{array}{l l}
0 & \quad \mbox{if \( m \ne n \) } \\
\pi & \quad \mbox{if \( m = n = 0 \) } \\
\pi/2 & \quad \mbox{if \( m = n, m \ne 0 \) }
\end{array}
\right.
\end{equation}

Recurrance relation.

Prove \ref{eqn:tschebyscheff:100}.

Answer.

To show this, let

\begin{equation}\label{eqn:tschebyscheff:460}
x = \cos\theta.
\end{equation}

\begin{equation}\label{eqn:tschebyscheff:580}
2 x T_{m-1} – T_{m-2}
=
2 \cos\theta \cos((m-1) \theta) – \cos((m-2)\theta).
\end{equation}

Recall the cosine addition formulas

\begin{equation}\label{eqn:tschebyscheff:540}
\begin{aligned}
\cos( a + b )
&=
\textrm{Re} e^{j(a + b)} \\
&=
\textrm{Re} e^{ja} e^{jb} \\
&=
\textrm{Re}
\lr{ \cos a + j \sin a }
\lr{ \cos b + j \sin b } \\
&=
\cos a \cos b – \sin a \sin b.
\end{aligned}
\end{equation}

Applying this gives

\begin{equation}\label{eqn:tschebyscheff:600}
\begin{aligned}
2 x T_{m-1} – T_{m-2}
&=
2 \cos\theta \Biglr{ \cos(m\theta)\cos\theta +\sin(m\theta) \sin\theta }
– \Biglr{
\cos(m\theta)\cos(2\theta) + \sin(m\theta) \sin(2\theta)
} \\
&=
2 \cos\theta \Biglr{ \cos(m\theta)\cos\theta +\sin(m\theta)\sin\theta) }
– \Biglr{
\cos(m\theta)(\cos^2 \theta – \sin^2 \theta) + 2 \sin(m\theta) \sin\theta \cos\theta
} \\
&=
\cos(m\theta) \lr{ \cos^2\theta + \sin^2\theta } \\
&= T_m(x).
\end{aligned}
\end{equation}

First order LDE relation.

Prove \ref{eqn:tschebyscheff:420}.

Answer.

To show this, again, let

\begin{equation}\label{eqn:tschebyscheff:470}
x = \cos\theta.
\end{equation}

Observe that

\begin{equation}\label{eqn:tschebyscheff:480}
1 = -\sin\theta \frac{d\theta}{dx},
\end{equation}

so

\begin{equation}\label{eqn:tschebyscheff:500}
\begin{aligned}
\frac{d}{dx}
&= \frac{d\theta}{dx} \frac{d}{d\theta} \\
&= -\frac{1}{\sin\theta} \frac{d}{d\theta}.
\end{aligned}
\end{equation}

Plugging this in gives

\begin{equation}\label{eqn:tschebyscheff:520}
\begin{aligned}
\lr{ 1 – x^2} &\frac{d}{dx} T_m(x) + m x T_m(x) – m T_{m-1}(x) \\
&=
\sin^2\theta
\lr{
-\frac{1}{\sin\theta} \frac{d}{d\theta}}
\cos( m \theta ) + m \cos\theta \cos( m \theta ) – m \cos( (m-1)\theta ) \\
&=
-\sin\theta (-m \sin(m \theta)) + m \cos\theta \cos( m \theta ) – m \cos( (m-1)\theta ).
\end{aligned}
\end{equation}

Applying the cosine addition formula \ref{eqn:tschebyscheff:540} gives

\begin{equation}\label{eqn:tschebyscheff:560}
m \lr{ \sin\theta \sin(m \theta) + \cos\theta \cos( m \theta ) } – m
\lr{
\cos( m \theta) \cos\theta + \sin( m \theta ) \sin\theta
}
=0.
\end{equation}

} % answer

Second order LDE relation.

Prove \ref{eqn:tschebyscheff:400}.

Answer.

This follows the same way. The first derivative was

\begin{equation}\label{eqn:tschebyscheff:640}
\begin{aligned}
\frac{d T_m(x)}{dx}
&=
-\inv{\sin\theta}
\frac{d}{d\theta} \cos(m\theta) \\
&=
-\inv{\sin\theta} (-m) \sin(m\theta) \\
&=
m \inv{\sin\theta} \sin(m\theta),
\end{aligned}
\end{equation}

so the second derivative is

\begin{equation}\label{eqn:tschebyscheff:620}
\begin{aligned}
\frac{d^2 T_m(x)}{dx^2}
&=
-m \inv{\sin\theta} \frac{d}{d\theta} \inv{\sin\theta} \sin(m\theta) \\
&=
-m \inv{\sin\theta}
\lr{
-\frac{\cos\theta}{\sin^2\theta} \sin(m\theta) + \inv{\sin\theta} m \cos(m\theta)
}.
\end{aligned}
\end{equation}

Putting all the pieces together gives

\begin{equation}\label{eqn:tschebyscheff:660}
\begin{aligned}
\lr{ 1 – x^2 } &\frac{d^2 T_m(x)}{dx^2} – x \frac{dT_m(x)}{dx} + m^2 T_{m}(x) \\
&=
m
\lr{
\frac{\cos\theta}{\sin\theta} \sin(m\theta) – m \cos(m\theta)
}
– \cos\theta m \inv{\sin\theta} \sin(m\theta)
+ m^2 \cos(m \theta) \\
&=
0.
\end{aligned}
\end{equation}

Orthogonality relation

Prove \ref{eqn:tschebyscheff:440}.

Answer.

First consider the 0,0 inner product, making an \( x = \cos\theta \), so that \( dx = -\sin\theta d\theta \)

\begin{equation}\label{eqn:tschebyscheff:680}
\begin{aligned}
\innerprod{T_0}{T_0}
&=
\int_{-1}^1 \inv{\lr{1-x^2}^{1/2}} dx \\
&=
\int_{-\pi}^0 \lr{-\inv{\sin\theta}} -\sin\theta d\theta \\
&=
0 – (-\pi) \\
&= \pi.
\end{aligned}
\end{equation}

Note that since the \( [-\pi, 0] \) interval was chosen, the negative root of \( \sin^2\theta = 1 – x^2 \) was chosen, since \( \sin\theta \) is negative in that interval.

The m,m inner product with \( m \ne 0 \) is

\begin{equation}\label{eqn:tschebyscheff:700}
\begin{aligned}
\innerprod{T_m}{T_m}
&=
\int_{-1}^1 \inv{\lr{1-x^2}^{1/2}} \lr{ T_m(x)}^2 dx \\
&=
\int_{-\pi}^0 \lr{-\inv{\sin\theta}} \cos^2(m\theta) -\sin\theta d\theta \\
&=
\int_{-\pi}^0 \cos^2(m\theta) d\theta \\
&=
\inv{2} \int_{-\pi}^0 \lr{ \cos(2 m\theta) + 1 } d\theta \\
&= \frac{\pi}{2}.
\end{aligned}
\end{equation}

So far so good. For \( m \ne n \) the inner product is

\begin{equation}\label{eqn:tschebyscheff:720}
\begin{aligned}
\innerprod{T_m}{T_m}
&=
\int_{-\pi}^0 \cos(m\theta) \cos(n\theta) d\theta \\
&=
\inv{4} \int_{-\pi}^0
\lr{
e^{j m \theta}
+ e^{-j m \theta}
}
\lr{
e^{j n \theta}
+ e^{-j n \theta}
}
d\theta \\
&=
\inv{4} \int_{-\pi}^0
\lr{
e^{j (m + n) \theta}
+e^{-j (m + n) \theta}
+e^{j (m – n) \theta}
+e^{j (-m + n) \theta}
}
d\theta \\
&=
\inv{2} \int_{-\pi}^0
\lr{
\cos( (m + n)\theta )
+\cos( (m – n)\theta )
}
d\theta \\
&=
\inv{2}
\evalrange{
\lr{
\frac{\sin( (m + n)\theta )}{ m + n }
+\frac{\sin( (m – n)\theta )}{ m – n}
}
}{-\pi}{0} \\
&= 0.
\end{aligned}
\end{equation}

References

[1] M. Abramowitz and I.A. Stegun. Handbook of mathematical functions with formulas, graphs, and mathematical tables, volume 55. Dover publications, 1964.

parallelized xargs

March 12, 2015 perl and general scripting hackery

I’ve used xargs before to execute commands long enough that attempting them with backquotes fails. For example, if the list of files ‘c’ is too long, a checkin attempt like:

    cleartool checkin -c 'blah blah blah' `cat c`

could generate an “environment too long” error in the shell. Something like:

    cat c | xargs cleartool checkin -c 'blah blah blah'

is equivalent. This also checks in one file at a time, using all the filenames in the file ‘c’, but allows xargs to farm out the commands one at a time without building one giant execv argument. What I didn’t know was xargs has a parallelization option:

    cat c | xargs -P 8 -n 1 cleartool checkin -c 'blah blah blah'

This does the same job, with -n 1 restricting xargs to passing one file at a time (which may not be necessary in this case), but starting 8 different processes for the work!