# Communication Systems/Binary Modulation Schemes

This page discusses the binary modulation schemes and \"keying\".

## What is \"Keying?\"

Square waves, sinc waves, and raised-cosine rolloff waves are all well
and good, but all of them have drawbacks. If we use an optimal, matched
filter, we can eliminate the effect of jitter, so frankly, why would we
consider square waves at all? Without jitter as a concern, it makes no
sense to correct for jitter, or even take it into consideration.
However, since the matched filter needs to look at individual symbols,
the transmitted signal can\'t suffer from any intersymbol interference
either. Therefore, we aren\'t using the sinc pulse.

Since the raised-cosine roll-off wave suffers from both these problems
(in smaller amounts, however), we don\'t want to use that pulse either.

So the question is, what other types of pulses can we send?

It turns out that if we use some of the techniques we have developed
using analog signal modulation, and implement a sinusoidal carrier wave,
we can create a signal with no inter-symbol interference, very low
bandwidth, and no worries about jitter. Just like analog modulation,
there are 3 aspects of the carrier wave that we can change: the
amplitude, the frequency, and the phase angle. Instead of
\"modulation\", we call these techniques **keying** techniques, because
they are operating on a binary-number basis.

There is one important point to note before continuing with this
discussion: Binary signals **are not** periodic signals. Therefore, we
cannot expect that a binary signal is going to have a discrete spectra
like a periodic squarewave will have. For this reason, the spectral
components of binary data are continuous spectra.

## Amplitude Shift Keying

In an ASK system, we are changing the amplitude of the sine wave to
transmit digitial data. We have the following cases:

-   Binary 1: $A_1 \sin(f_c t)$
-   Binary 0: $A_0 \sin(f_c t)$

The simplest modulation scheme sets A0 = 0V (turning the transmitter
off), and setting A1 = +5V (any random non-zero number turns the
transmitter on). This special case of ASK is called OOK (On-Off keying).
Morse code uses OOK.

Another common special case of ASK sets A1 to some positive number, and
A0 to the corresponding negative number A0 = -A1. We will mention this
case again later.

In ASK, we have the following equation:

$$a(t) \sin(\omega t)$$

by the principal of duality, multiplication in the time domain becomes
convolution in the frequency domain, and vice-versa. Therefore, our
frequency spectrum will have the following equation:

$$A(j\omega) * \delta(t - \omega)$$

where the impulse function is the fourier-transform of the sinusoid,
centered at the frequency of the wave. the value for A is going to be a
sinc wave, with a width dependent on the bitrate. We remember from the
Signals and Systems book that
convolution of a signal with an impulse is that signal centered where
the impulse was centered. Therefore, we know now that the frequency
domain shape of this curve is a sinc wave centered at the carrier
frequency.

## Frequency Shift Keying

In **Frequency Shift Keying** (FSK), we can logically assume that the
parameter that we will be changing is the frequency of the sine wave.
FSK is unique among the different keying methods in that data is never
transmitted *at* the carrier frequency, but is instead transmitted at a
certain offset from the carrier frequency. If we have a carrier
frequency of $f_c$, and a frequency offset of $\Delta f$, we can
transmit binary values as such:

-   Binary 1: $A \sin ((f_c + \Delta f)t)$
-   Binary 0: $A \sin ((f_c - \Delta f)t)$

Similar to ASK, we have FSK, which uses 2 different frequencies to
transmit data. For now we will call them $\omega1, \omega2$. Using the
same logic that we used above, the fourier representations of these
waves will be (respectively):

$$A_1(j\omega) * \delta(t - \omega1)$$

$$A_0(j\omega) * \delta(t - \omega2)$$

With one sinc wave centered at the first frequency, and one sinc wave
centered at the second frequency. Notice that A1 and A0 are the
half-square waves associated with the 1s and the 0s, respectively. These
will be described later.

### Error Rate

The BER of coherent QPSK in the presence of gaussian and Rayleigh noise
is as follows:

:   {\| border=1

\|- \| Gaussian Noise \|\| Rayleigh Fading \|- \|
$\frac{1}{2}\operatorname{erfc} \left( \sqrt{\frac{E_b}{N_0}} \right)$
\| $\frac{1}{2}\left( 1 - \sqrt{\frac{\gamma_0}{2 + \gamma_0}} \right)$
\|}

## Phase Shift Keying

PSK systems are slightly different then ASK and FSK systems, and because
of this difference, we can exploit an interesting little trick of
trigonometry. PSK is when we vary the phase angle of the wave to
transmit different bits. For instance:

-   Binary 1: $A \sin(f_c t + \phi_1)$
-   Binary 0: $A \sin(f_c t + \phi_0)$

If we evenly space them out around the unit-circle, we can give
ourselves the following nice values:

-   Binary 1: $A \sin(f_c t + 0)$
-   Binary 0: $A \sin(f_c t + \pi)$

Now, according to trigonometry, we have the following identity:

$\sin(f_c t + \pi) = -\sin(f_c t)$

So in general, our equations for each signal (s) is given by:

-   $s_1(t) = A\sin(f_c t)$
-   $s_0(t) = -A\sin(f_c t)$

Which looks awfully like an ASK signal. Therefore, we can show that the
spectrum of a PSK signal is the same as the spectrum of an ASK signal.

There are two
commonally
used forms of Phase Shift keying Modulation:

Binary Phase Shift Keying (BPSK)

Quadrature Phase Shift Keying (QPSK)

Binary Phase Shift keying is set out above.

### QPSK

Quadrature Phase Shift Keying utilises the fact that a cosine wave is in
quadrature to a sine wave, allowing 2 bits to be simultaneously
represented.

-   Binary 11: $A \sin(f_c t + 0) + \cos(f_c+\pi/2)$
-   Binary 10: $A \sin(f_c t + 0) + \cos(f_c -\pi/2)$
-   Binary 01: $A \sin(f_c t + \pi) + + \cos(f_c+\pi/2)$
-   Binary 00: $A \sin(f_c t + \pi) + + \cos(f_c - \pi/2)$

QPSK has the advantage over BPSK of requiring half the transmission band
width for the same data rate, and error probability.

### Error Rate

The BER of coherent BPSK in the presence of gaussian and Rayleigh noise
is as follows:

:   {\| border=1

\|- \| Gaussian Noise \|\| Rayleigh Fading \|- \|
$\frac{1}{2}\operatorname{erfc} \left( \sqrt{\frac{E_b}{N_0}} \right)$
\| $\frac{1}{2}\left( 1 - \sqrt{\frac{\gamma_0}{1 + \gamma_0}} \right)$
\|}

## Binary Transmitters

## Binary Receivers


# Communication Systems/M-ary Modulation Schemes

Now what if try to cram more information into a single bittime? If we
take 2 bits at a time, and arrange them together, we can assign each set
of 2 bits to a different symbol, and then we can transmit the different
symbols.

## Pronunciation

`"M-ary" is pronounced like "em airy".`

## Example: Q-ASK

Let us use the following scheme:

-   \"00\" = +5V
-   \"01\" = +1.66V
-   \"10\" = -1.66V
-   \"11\" = -5V

we can see now that we can transmit data *twice as fast* using this
scheme, although we need to have a more complicated receiver, that can
decide between 4 different pulses (instead of 2 different pulses, like
we have been using).

## Bits Per Symbol

All popular communication systems transmit an integer number of bits per
symbol. We can relate the number of bits (\"k\") and the number of
different symbols (\"m\") with the following equation:

$$m = 2^k$$

This causes the number of symbols to be a power of two.

With M-ary modulation techniques, the \"symbols per second\" rate can be
much slower than the \"bits per second\" data rate.

## QPSK

Quadrature phase shift keying (aka 4-PSK) is PSK modulation that has
four points in the constellation. !QPSK
Modulator !QPSK
Demodulator There are several
variations on this technique:

-   simple QPSK
-   DQPSK (differential QPSK)
-   OQPSK (offset QPSK)
-   SOPSK (shaped offset QPSK)
-   π/4 QPSK (shifted constellation QPSK)

## CPFSK (MSK)

\[MSK\]minimum shift keying

## DPSK

## For further reading

-   Wikipedia:Constellation
    diagram
-   Wikipedia:Quadrature amplitude
    modulation


# Communication Systems/Wave Propagation

This page will discuss some of the fundamental basics of EM wave
propagation.

## Electromagnetic Spectrum

:

    :   ![](cont_emspec2.jpg "fig:cont_emspec2.jpg")

## Radio Waves

Maxwell first predicted the existence of electromagnetic waves in the
19th century. He came to this conclusion by careful examination of the
equations describing electric and magnetic phenomenon. It was left up to
Hertz to create these waves, and Marconi to exploit them.

In spite of one hundred years of study, exactly what radio waves are and
why they exist, remain somewhat of a mystery.

Electromagnetic waves in free space, or TEM waves, consist of electric
and magnetic fields, each at right angles to each other and the
direction of propagation.

:

    :   ![](tem_wave.gif "fig:tem_wave.gif")

The relationship between wavelength and frequency is given by:

$$c = \lambda f$$

:

    :   where c is the speed of light (approximately 300,000 m/s in
        vacuum), f is the frequency of the wave, and λ is the wavelength
        of the wave.

Radio waves can be reflected and refracted in a manner similar to light.
They are affected by the ground terrain, atmosphere and other objects.

Maxwell's equations state that a time varying magnetic field produces an
electric field and a time varying electric field produces a magnetic
field. This is kind of a chicken and egg situation.

Radio waves propagate outward from an antenna, at the speed of light.
The exact nature of these waves is determined by the transmission
medium. In free space, they travel in straight lines, whereas in the
atmosphere, they generally travel in a curved path. In a confined or
guided medium, radio waves do not propagate in the TEM mode, but rather
in a TE or TM mode.

Radio waves interact with objects in three principle ways:

:

    :   Reflection -- A radio wave bounces off an object larger than its
        wavelength.
    :   Diffraction -- Waves bend around objects.
    :   Scattering -- A radiowave bounces off an object smaller than its
        wavelength.

Because of these complex interactions, radio wave propagation is often
examined in three distinct regions in order to simplify the analysis:

:

    :   Surface (or ground) waves are located very near the earth's
        surface.
    :   Space waves occur in the lower atmosphere (troposphere).
    :   Sky waves occur in the upper atmosphere (ionosphere).

The boundaries between these regions are somewhat fuzzy. In many cases,
it is not possible to examine surface waves without considering space
waves.

:

    :   ![](electron_density_altitude.gif "fig:electron_density_altitude.gif")

### Common RF Band Designations

  Frequency band name                 Frequency         Wavelength
  ----------------------------------- ----------------- --------------------
  ELF - Extremely Low Frequency       3 -- 30 Hz        100000 -- 10000 km
  SLF - Super Low Frequency           30 -- 300 Hz      10000 -- 1000 km
  ULF - Ultra Low Frequency           300 -- 3000 Hz    1000 -- 100 km
  VLF - Very Low Frequency            3 -- 30 kHz       100 -- 10 km
  LF - Low Frequency                  30 -- 300 kHz     10 -- 1 km
  MF - Medium Frequency               300 -- 3000 kHz   1000 -- 100 m
  HF - High Frequency                 3 -- 30 MHz       100 -- 10 m
  VHF - Very High Frequency           30 -- 300 MHz     10 -- 1 m
  UHF - Ultra High Frequency          300 -- 3000 MHz   1000 -- 100 mm
  SHF - Super High Frequency          3 -- 30 GHz       100 -- 10 mm
  EHF - Extremely High Frequency      30 -- 300 GHz     10 -- 1 mm
  THF - Tremendously High Frequency   300 -- 3000 GHz   1 -- 0.1 mm

### Surface Waves

These are the principle waves used in AM, FM and TV broadcast. Objects
such as buildings, hills, ground conductivity, etc. have a significant
impact on their strength. Surface waves are usually vertically polarized
with the electric field lines in contact with the earth.

:

    :   ![](surface_wave.gif "fig:surface_wave.gif")

#### Refraction

Because of refraction, the radio horizon is larger than the optical
horizon by about 4/3. The typical maximum direct wave transmission
distance (in km) is dependent on the height of the transmitting and
receiving antennas (in meters):

$$d_{\max }  \approx \sqrt {17h_t }  + \sqrt {17h_r } \quad {\rm{km}}$$

However, the atmospheric conditions can have a dramatic effect on the
amount of refraction.

:

    :   ![](refraction_distance.gif "fig:refraction_distance.gif")

##### Super Refraction

In super refraction, the rays bend more than normal thus shortening the
radio horizon. This phenomenon occurs when temperature increases but
moisture decreases with height. Paradoxically, in some cases, the radio
wave can travel over enormous distances. It can be reflected by the
earth, rebroadcast and super refracted again.

##### Sub refraction

In sub refraction, the rays bend less than normal. This phenomenon
occurs when temperature decreases but moisture increases with height. In
extreme cases, the radio signal may be refracted out into space.

### Space Waves

These waves occur within the lower 20 km of the atmosphere, and are
comprised of a direct and reflected wave. The radio waves having high
frequencies are basically called as space waves. These waves have the
ability to propagate through atmosphere, from transmitter antenna to
receiver antenna. These waves can travel directly or can travel after
reflecting from earth's surface to the troposphere surface of earth. So,
it is also called as Tropospherical Propagation. In the diagram of
medium wave propagation, c shows the space wave propagation. Basically
the technique of space wave propagation is used in bands having very
high frequencies. E.g. V.H.F. band, U.H.F band etc. At such higher
frequencies the other wave propagation techniques like sky wave
propagation, ground wave propagation can't work. Only space wave
propagation is left which can handle frequency waves of higher
frequencies. The other name of space wave propagation is line of sight
propagation. There are some limitations of space wave propagation.

1.  These waves are limited to the curvature of the earth.
2.  These waves have line of sight propagation, means their propagation
    is along the line of sight distance.

The line of sight distance is that exact distance at which both the
sender and receiver antenna are in sight of each other. So, from the
above line it is clear that if we want to increase the transmission
distance then this can be done by simply extending the heights of both
the sender as well as the receiver antenna. This type of propagation is
used basically in radar and television communication.

The frequency range for television signals is nearly 80 to 200 MHz.
These waves are not reflected by the ionosphere of the earth. The
property of following the earth's curvature is also missing in these
waves. So, for the propagation of television signal, geostationary
satellites are used. The satellites complete the task of reflecting
television signals towards earth. If we need greater transmission then
we have to build extremely tall antennas.

#### Direct Wave

This is generally a line of sight transmission, however, because of
atmospheric refraction the range extends slightly beyond the horizon.

#### Ground Reflected Wave

Radio waves may strike the earth, and bounce off. The strength of the
reflection depends on local conditions. The received radio signal can
cancel out if the direct and reflected waves arrive with the same
relative strength and 180^o^ out of phase with each other.

Horizontally polarized waves are reflected with almost the same
intensity but with a 180^o^ phase reversal.

Vertically polarized waves generally reflect less than half of the
incident energy. If the angle of incidence is greater than 10^o^ there
is very little change in phase angle.

### Sky Waves

These waves head out to space but are reflected or refracted back by the
ionosphere. The height of the ionosphere ranges from 50 to 1,000 km.[^1]

Radio waves are refracted by the ionized gas created by solar radiation.
The amount of ionization depends on the time of day, season and the
position in the 11-year sun spot cycle. The specific radio frequency
refracted is a function of electron density and launch angle.

A communication channel thousands of kilometers long can be established
by successive reflections at the earth's surface and in the upper
atmosphere. This ionospheric propagation takes place mainly in the HF
band.

The ionosphere is composed of several layers, which vary according to
the time of day. Each layer has different propagation characteristics:

:

    :   D layer -- This layer occurs only during the day at altitudes of
        60 to 90 km. High absorption takes place at frequencies up to 7
        MHz.
    :   E layer -- This layer occurs at altitudes of 100 to 125 km. In
        the summer, dense ionization clouds can form for short periods.
        These clouds called *sporadic E* can refract radio signals in
        the VHF spectrum. This phenomenon allows amateur radio operators
        to communicate over enormous distances.
    :   F layer - This single nighttime layer splits into two layers (F1
        and F2) during the day. The F1 layer forms at about 200 km and
        F2 at about 400 km. The F2 layer propagates most HF short-wave
        transmissions.

Because radio signals can take many paths to the receiver, multipath
fading can occur. If the signals arrive in phase, the result is a
stronger signal. If they arrive out of phase with each other, they tend
to cancel.

Deep fading, lasting from minutes to hours over a wide frequency range,
can occur when solar flares increase the ionization in the D layer.

The useful transmission band ranges between the LUF (lowest usable
frequency) and MUF (maximum usable frequency). Frequencies above the MUF
are refracted into space. Below the LUF, radio frequencies suffer severe
absorption. If a signal is near either of these two extremes, it may be
subject to fading.

Meteors create ionization trails that reflect radio waves. Although
these trails exist for only a few seconds, they have been successfully
used in communications systems spanning 1500 km.

The Aurora Borealis or Northern Lights cause random reflection in the
3 - 5 MHz region. Aurora causes signal flutter at 100 Hz to 2000 Hz thus
making voice transmission impossible.

## Fading and Interference

Radio signals may vary in intensity for many reasons.

### Flat Earth Reflections (Horizontal Polarization)

There are at least two possible paths for radio waves to travel when the
antennas are near the earth: direct path and reflected path. These two
signals interact in a very complex manner. However, ignoring
polarization and assuming a flat earth can produce some interesting
mathematical descriptions.

:

    :   ![](direct_relected_wave.gif "fig:direct_relected_wave.gif")

```{=html}
<!-- -->
```

:

    :   *p~1~* = direct wave path length

```{=html}
<!-- -->
```

:

    :   *p~2~* = reflected wave path length

$$\Delta$$*p* = *p~2~ - p~1~* difference in path lengths

:

    :   *d* = distance

From the geometry we can observe:

$$p_1^2  = \left( {h_r  - h_t } \right)^2  + d^2$$

$$p_2^2  = \left( {h_r  + h_t } \right)^2  + d^2$$

$$p_2^2  - p_1^2  = \left( {h_r  - h_t } \right)^2  + d^2  - \left( {h_r  + h_t } \right)^2  - d^2  = 4h_r h_t$$

$$\left( {p_2  - p_1 } \right)\left( {p_2  + p_1 } \right) = 4h_r h_t$$

But$\Delta p = \left( {p_2  - p_1 } \right)$ and
$d \approx p_1  \approx p_2$

$$\Delta p2d \approx 4h_r h_t$$ therefore
$\Delta p \approx \frac{{2h_r h_t }}{d}$

If the difference in the two paths $\Delta$*p*, is 1/2 $\lambda$ long,
the two signals tend to cancel. If $\Delta$*p* is equal to $\lambda$,
the two signals tend to reinforce. The path difference $\Delta$*p*
therefore corresponds to a phase angle change of:

$$\varphi _p  = \frac{{2\pi }}{\lambda }\Delta p = \frac{{4\pi h_r h_t }}{{\lambda d}}$$

The resultant received signal is the sum of the two components. The
situation is unfortunately made more complex by the fact that the phase
integrity of the reflected wave is not maintained at the point of
reflection.

If we limit the examination of reflected waves to the horizontally
polarized situation, we obtain the following geometry:

:

    :   ![](vector_sum.gif "fig:vector_sum.gif")

Applying the cosine rule to this diagram, we obtain a resultant signal
of:

$$E_r  = E_1 \sqrt {2\left( {1 - \cos \varphi _p } \right)}  = 2E_1 \sin \left( {\frac{{\varphi _p }}{2}} \right)$$

The signal strength of the direct wave is the unit distance value
divided by the distance: $E_r  = \frac{{E_0 }}{d}$ Therefore, the
received signal can be written as:

$$E_r  = \frac{{2E_0 }}{d}\sin \left( {\frac{{2\pi h_r h_t }}{{\lambda d}}} \right)$$

For small angles this can be approximated by:

$$E_r  \approx \frac{{2E_0 }}{d}\frac{{2\pi h_r h_t }}{{\lambda d}} = E_0 \frac{{4\pi h_r h_t }}{{\lambda d^2 }}$$

### Multipath Fading

The received signal is generally a combination of many signals, each
coming over a different path. The phase and amplitude of each component
are related to the nature of the path. These signals combine in a very
complex manner. Some multipath fading effects are characterized by delay
spread, Rayleigh and Ricean fading, doppler shifting, etc. Fading is the
most significant phenomenon causing signal degradation. There are
several different categories of fading:

::\* Flat fading: the entire pass band of interest is affected equally
(also known as narrow or amplitude varying channels).

::\*Frequency selective fading: certain frequency components are
affected more than others (also known as wideband channels). This
phenomenon tends to introduce inter-symbol interference.

::\*Slow fading: the channel characteristics vary at less than the baud
rate.

::\*Fast fading: the channel characteristics vary faster than the baud
rate.

#### Time Dispersion

Time dispersion occurs when signals arrive at different times. Signals
traveling at the speed of light move about 1 foot in 1 nanosecond. This
spreading tends to limit the bit rate over RF links.

#### Rayleigh Fading

The Rayleigh distribution can be used to describe the statistical
variations of a flat fading channel. Generally, the strength of the
received signal falls off as the inverse square of the distance between
the transmitter and receiver. However, in cellular systems, the antennas
are pointed slightly down and the signal falls of more quickly.

:

    :   ![](Rayleigh_fading_doppler_10Hz.gif "fig:Rayleigh_fading_doppler_10Hz.gif"){width="300"}

#### Ricean Fading

The Ricean distribution is used to describe the statistical variations
of signals with a strong direct or line-of-sight component and numerous
weaker reflected ones. This can happen in any multipath environment such
as inside buildings or in an urban center.

A received signal is generally comprised of several signals, each taking
a slightly different path. Since some may add constructively in-phase
and others out of phase, the overall signal strength may vary by 40 dB
or more if the receiver is moved even a very short distance.

#### Doppler Shift

A frequency shift is caused by the relative motion of the transmitter
and receiver, or any object that reflects/refracts signal. This movement
creates random frequency modulation. Doppler frequency shift is either
positive or negative depending on whether the transmitter is moving
towards or away from the receiver.

This Doppler frequency shift is given by:

$$f_d  = \frac{{v_m }}{c}f_c$$

*v~m~* is the relative motion of the transmitter with respect to the
receiver, *c* is the speed of light and *f~c~* is the transmitted
frequency. In the multipath environment, the relative movement of each
path is generally different. Thus, the signal is spread over a band of
frequencies. This is known as the Doppler spread.

### Atmospheric Diffraction

Radio waves cannot penetrate very far into most objects. Consequently,
there is often a shadow zone behind objects such as buildings,hills,
etc.

The radio shadow zone does not have a very sharp cutoff due to spherical
spreading, also called Huygens' principle. Each point on a wavefront
acts as it were a point source radiating along the propagation path. The
overall wavefront is the vector sum of all the point sources or
wavelets. The wavelet magnitude is proportional to $1 + \cos \theta$
where $\theta$ is measured from the direction of propagation. The
amplitude is maximum in the direction of propagation and zero in the
reverse direction.

## Reflection

Reflection normally occurs due to the surface of earth or building &
hills which have large dimension relative to the wavelength of the
propagation waves. The reflected wave changes the incident angle.

There is similarity b/w the reflection of light by a conducting medium.
In both cases, angle of reflection is equal to angle of incidence. The
equality of the angles of reflection & incidence follows the second law
of reflection for light.

## Diffraction

Diffraction occurs in beams of light or waves when they become spread
out as a result of passing through a narrow slit. Maximum diffraction
occurs when the slit through which the wave passes through is equal to
the wavelength of the wave. Diffraction will result in constructive and
destructive interference.

## Path Loss

## References

[^1]: <http://www.hq.nasa.gov/iwgsdi/Ionosphere.html>


# Communication Systems/Antennas

## Antennas

The purpose of an antenna is to collect and convert electromagnetic
waves to electronic signals. Transmission lines then guide these to the
receiver front end.

The relevant electric fields associated with an antenna are extremely
complex and have the general form:

$$E = j30\beta ^2 Idz\left( {\frac{j}{{\beta r}} + \frac{1}{{\left( {\beta r} \right)^2 }} + \frac{1}{{\left( {\beta r} \right)^3 }}} \right)\sin \theta e^{ - j\beta r}$$

where *Idz* = moment of differential current element in rms amp meters

$$\beta  = \frac{{2\pi }}{\lambda }$$

:

    :   *r* = distance in meters

The near field or Fresnel region consists of three fields.

The electrostatic (*1/r^3^*) and inductive (*1/r^2^*) fields fall off in
intensity quite quickly. The far field or Fraunhoffer region consists
entirely of the (*j/r*) radiated field. This article will only consider
this radiated field.

Although most antennas are simply a piece of bent wire, their
interaction with electromagnetic fields is quite complex, and a whole
array of terms is needed to characterize them:

::\**Beamwidth*: the angle defines by the radiation pattern where the
signal strength drops 3 dB of its maximum value in a given plane.

::\**Polarization*: the plane of electric field polarization with
respect to the earth.

::\**Gain*: a figure of merit used to quantify the signal capturing
ability of the antenna. It is closely related to directivity and
beamwidth.

::\**Effective area*: a measure of the antenna's ability to collect
energy. It is related to gain by the expression:
$A = \frac{{G\lambda ^2 }}{{4\pi }}$.

::\**Input impedance*: The impedance, which is necessary in the receiver
for maximum power transfer to occur.

::\**Radiation resistance*: the ratio of the power driving the antenna
to the square of the current driving its terminals.

::\**Bandwidth*: the usable frequency band associated with the antenna.

Before any antenna can be selected, the center frequency and operating
bandwidth must be known. In general, the higher the operating frequency,
the smaller the antenna. Antenna gain is always measured against a known
reference such as an isotropic source (*dBi*) or a half wave dipole
(*dBd*).

  Antenna Type       Typical Gain \[*dBd*\]
  ------------------ ------------------------
  Dipole             0
  Omni               0
  Gain Omni          3 --- 12
  Mobile Whip        -0.6 to +5.5
  Corner Reflector   4 --- 10
  Log Periodic       3 --- 8
  Horn               5 --- 12
  Helix              5 --- 12
  Microstrip Patch   3 --- 15
  Yagi               3 --- 20
  Panel              5 --- 20

Increasing antenna gain by 3 dB generally requires increasing the size
by a factor of 2-3 or by reducing the beamwidth. Vertical omni
directional antennas and collinear arrays are used for line-of-sight
communications with ground-based mobile units. Sectoring can be
accomplished by panel antennas. Fixed point-to-point links generally use
a yagi or parabolic dish.

Antennas exhibit reciprocity, which means they have the same gain
whether used for transmitting or receiving.

### Isotropic Radiators

An isotropic source radiates energy equally well in all directions.
Stars are isotropic radiators. Our sun is an extremely powerful
radiator, broadcasting 64 Megawatts per square meter of surface.
Although it is not possible to construct isotropic radio antennas, the
concept provides useful analytical tools.

The power density as a function of distance from an isotropic source is
easily calculated. It is simply the total energy broadcast, divided by
the area it passes through, in this case, a sphere.

$$P_{DI}  = \frac{{P_t }}{{4\pi r^2 }}$$ watts/m^2^

Isotropic gain is also called absolute gain. Antennas gains with respect
to isotropic gain are specified in units of dBi. Antenna gains can also
be specified with respect to a half wave dipole or a short vertical
antenna. The gain of a half-wave dipole is 1.64 dBi, and that of a
dipole is 2.15 dBi.

### Non Isotropic Radiators

Virtually all types of antennas are non-isotropic sources. That is that
they tend to radiate more energy in a particular direction.

:

    :   ![](non_isotropic_radiator.gif "fig:non_isotropic_radiator.gif")

Because of this non-uniform energy distribution, the antenna appears to
have a gain (*G~t~*) (if broadcasting the same power) relative to an
isotropic radiator along its principal axis and a loss in other most
directions. The power density along the antenna axis is given by:

$$P_D  = \frac{{P_t G_t }}{{4\pi r^2 }}$$ watts/m^2^

The receiving antenna attempts to collect this radiated energy through
an effective area (*A~eff~*). The received power is therefore:

$$P_r  = \frac{{P_t G_t }}{{4\pi r^2 }}A_{eff}$$ watts

It would seem reasonable to conclude that the effective area is simply
the physical size of the antenna. Fortunately, this is not the case, and
very small antennas are possible.

It has been determined that there is a relationship between effective
area, transmitted wavelength and antenna gain:

$$\frac{{A_{eff} }}{{G_r }} = \frac{{\lambda ^2 }}{{4\pi }}$$

Therefore, the received power can be expressed as:

:

    :   $P_r  = P_t G_t G_r \left( {\frac{\lambda }{{4\pi r}}} \right)^2$
        watts

Recall that: $\lambda  = \frac{c}{f}$

If *f* is expressed in MHz, *c* in meters per second, and *r* in km,
then the received power in dB can be expressed as:

$$P_r  = P_t  + G_t  + G_r  - \left( {32.45 + 20\log r + 20\log f} \right)$$
dB

### Electric Field Strength

If the power density of an electromagnetic wave is known, the field
strength can be obtained from:

$$E = \sqrt {Z_0 P_D }$$

where:

$$Z_0  = \sqrt {\frac{\mu }{\varepsilon }}  = \sqrt {\frac{{4\pi  \times 10^{ - 7} }}{{8.854 \times 10^{ - 12} }}}  = 120\pi$$
(for free space)

Therefore the field strength at one meter is:

$$E_o  = \sqrt {120\pi \frac{{P_t G_t }}{{4\pi r^2 }}}  = \sqrt {30P_t G_t }$$
volts/m

## Antenna Types

Antennas come in a bewildering array of shapes and sizes however, they
can be divided into two broad categories : Marconi and Hertzian.

Marconi antennas are electrically unbalanced and a require a ground
plane. Hertzian antennas are electrically balanced and do not require a
ground plane. Depending on one\'s point of view, it is possible to
consider one type the subset of the other. This will become clearer
later on.

## Marconi Antenna

Marconi antennas are usually 1/4 wavelength long and require a path to
ground. The ground plane itself acts as a reflector of energy, and
combines with the directly radiated wave to create the overall radiation
pattern. If the ground is dry or otherwise a poor conductor, a copper
grid is generally laid out on the ground. The impedance of a 1/4
$\lambda$ Marconi antenna is 36.6 $\Omega$.

:

    :   ![](1_4_wave_marconi_antenna.gif "1_4_wave_marconi_antenna.gif")
        !100 px

Notice that a Marconi antenna could be considered as a dipole antenna
with one of the poles buried in the ground. The ground acts as a
reflector to create the appearance of an buried antenna in the same way
that a mirror creates the appearance of someone behind the glass.
Increasing the antenna length has a significant impact on the radiation
pattern:

:

    :   ![](Marconi_antennas.gif "fig:Marconi_antennas.gif")

### Helical Antenna

Most Marconi antennas operate in the broadside mode, which means that
the bulk of the signal radiates off the side of the wire. However it is
possible to modify the antenna to operate in the end fire mode:

:

    :   ![](Helical_antenna_principle.png "fig:Helical_antenna_principle.png")

## Hertzian Antenna

Hertzian antennas do not require a path to either ground or a ground
plane. The simplest antenna of this type is the elementary doublet. It
is a hypothetical antenna where the instantaneous current magnitude is
constant along its length.

:

    :   ![](elementary_doublet.gif "fig:elementary_doublet.gif")

The radiation pattern for this antenna is donut shaped, with the antenna
rod running through the hole. The bulk of the energy is radiated at
right angles to the rod and nothing off the ends.

:

    :   ![](doublet_radiation_pattern.gif "fig:doublet_radiation_pattern.gif")

This antenna is often used as a reference instead of an isotropic
radiator, since close approximations of it can be constructed. Other
antennas can be considered as being composed of a series of doublets.

The field strength at any distance and angle can be calculated from:

$$E = \frac{{60\pi LI}}{{\lambda r}}$$

Where

:

    :   *L* = doublet length in meters
    :   $\lambda$= wavelength in meters
    :   *I* = current in amps (rms)
    :   *r* = distance in meters

### Dipole Antenna

A dipole is sometimes referred to as a Hertzian dipole. Since it has a
relatively simple construction and its radiation characteristics are
well defined, it is often used as the standard to which all other
antennas are compared.

The dipole radiation pattern is shaped like a slightly flattened donut.

:

    :   ![](dipole_pattern.gif "fig:dipole_pattern.gif")

The simplest antenna is the dipole. The relationship between antenna
current and electric field is given by:

$$E_\theta   = j\eta \frac{{e^{ - j\beta r} }}{{2\pi r}}I\frac{{\cos \left( {\frac{{\beta L\cos \theta }}{2}} \right) - \cos \left( {\frac{{\beta L}}{2}} \right)}}{{\sin \theta }}$$

where:

:

    :   *E* = electric field strength
    :   $\theta$ = angle from antenna axis (in radians)
    :   *I* = antenna current (rms)
    :   $\eta$ = intrinsic impedance (377 $\Omega$)
    :   *L* = antenna length
    :   *r* = distance

A ½ $\lambda$ dipole has an impedance of about 70 $\Omega$. To increase
this impedance and more closely match the characteristics of a twin lead
cable, the dipole may be folded. A ½ $\lambda$ folded dipole has an
input impedance of about 280 $\Omega$, and is used as the driving
element in many other types of antennas.

Most TV receivers are equipped with two indoor antennas, one to cover
the VHF band and the other the UHF band. The most common VHF antennas
are the extendible monopole and vee dipole colloquially known as the
rabbit ears. These are available with either a 75 $\Omega$ or 300
$\Omega$ impedance and have a typical gain of -4 dB with respect to a ½
$\lambda$ dipole. The vee dipole has a lower input impedance than a
straight dipole of the same length, but under some conditions, it can
exhibit a higher directivity due to the reduction of sidelobes.

The common UHF antennas are the circular loop and triangular dipole.
They typically have a 300 $\Omega$ impedance. The dipole version
sometimes has a reflecting screen to improve the gain and directivity.

### Halfwave Dipole

The radiation pattern of the half wave dipole is very much like a donut.

:

    :   ![](half_wave_dipole_pattern.gif "fig:half_wave_dipole_pattern.gif")

The distribution of voltage, current, and impedance resemble:

:

    :   ![](half_wave_dipole_current.gif "fig:half_wave_dipole_current.gif")

By increasing the length of the dipole, the donut tends to flatten out
and then explodes into complex multi lobed shapes.

### Folded Dipole

:

    :   ![](Antenna-folded-dipole-diagram.png "fig:Antenna-folded-dipole-diagram.png")

folded dipole antenna has high input impedance as compared to ordinary
dipole.

### Loop Antenna

The entire UHF band can be received on a single 20.3 cm diameter loop.
The circumference varies from one wavelength at 470 MHz to 1.7
wavelengths at 806 MHz. The directivity is about 3.5 dB. The mid band
gain is 3 dB higher than a ½ $\lambda$ dipole, but falls off to about
1 dB at either end.

:

    :   ![](loop_antenna.gif "fig:loop_antenna.gif")

Loop antennas that are much smaller than wavelength they are attempting
to catch, exhibit a null in the direction of the loop axis. This makes
it suitable for radio direction finding equipment. If the loop size is
increased, it begins to generate a lobe across the axis and in line with
the feed.

### Triangular Dipole (Bowtie)

:

    :   ![](bow_tie_antenna.gif "fig:bow_tie_antenna.gif")

The bowtie antenna is formed of two triangular sheets connected to a
transmission line and provides a 3 dB gain over a simple dipole. It can
also be constructed of a wire mesh if the spacing is less than 1/10
wavelength. The input impedance is a function of length and flare angle.
For television applications, the flare angle a is between 60^o^ and
80^o^. If the antenna is mounted ¼ $\lambda$ in front of a reflecting
surface, the gain increases to approximately 9 dB. Stacking two of them
vertically one wavelength apart, increases the overall gain to about
12 dB.

If the receiver is located at a great distance from the broadcast tower,
it is often necessary to use an outdoor antenna. These often have a gain
of 15 dB. Placing the antenna on a tall mast also increases the received
signal strength by as much as an additional 14 dB. A further improvement
occurs because these antennas have a greater immunity to interference,
due to their complex structure.

Most outdoor antennas are a combination of two antennas \[UHF and VHF\]
in a single structure. The VHF antenna is generally a log-periodic
dipole array. The UHF antenna may be an LPDA, Yagi-Uda, corner
reflector, parabolic reflector, or triangular dipole array with
reflecting screen.

### Log Periodic Dipole Array \[LPDA\]

This antenna is called a log periodic array because the impedance
variations across the usable band are periodic functions of frequency.
The high impedance version is mounted on an insulated boom and feed by a
balanced cable. The average domestic antenna of this type has a gain of
about 4.5 dB in the low VHF band, rising to 7 dB in the high VHF band.

:

    :   ![](log_periodic_antenna.gif "fig:log_periodic_antenna.gif")

$$\tau  = \frac{{X_n }}{{X_{n + 1} }} = \frac{{L_n }}{{L_{n + 1} }} = \frac{{s_n }}{{s_{_{n + 1} } }} = \frac{{d_n }}{{d_{n + 1} }}$$
\-- Typically $0.7 \le \tau  \le 0.95$

$$\alpha  = \tan ^{ - 1} \left( {\frac{{1 - \tau }}{{4\sigma }}} \right)$$
\-- Typically $10^0  \le \alpha  \le 45^0$

$$\sigma  = \frac{{d_n }}{{2L_n }}$$

:

    :   Bandwidth:
        $B = \frac{{f_{high} }}{{f_{low} }}\left( {1 + 7.7\left( {1 - \tau } \right)^2 \cot \alpha } \right)$

```{=html}
<!-- -->
```

:

    :   Number of dipoles:
        $N = 1 + \frac{{\ln B}}{{\ln \frac{1}{\tau }}}$

Most CATV applications use a 75 $\Omega$ unbalanced configuration,
because it is more compatible with their cable feeds and equipment.

:

    :   ![](unbalanced_coax_feed.gif "fig:unbalanced_coax_feed.gif")

Two parallel conducting booms form a low impedance transmission line.
Phase reversal between dipoles is obtained by alternate attachment to
the booms.

An UHF LPDA can be constructed from V-shaped dipoles. The dipoles are
used in their ½ $\lambda$ and 3/2 $\lambda$ modes and eliminate the need
for higher frequency dipoles.

### Yagi Uda Antenna

:

    :   ![](yagi.gif "fig:yagi.gif")

The dipole is typically 0.40 to 0.50 wavelengths long. The reflector is
normally 0.55 wavelengths long and placed anywhere from 0.1 to 0.25
wavelengths behind the dipole. The reflector spacing has no effect on
the forward gain, but does influence the front to back ratio and input
impedance.

The directors are normally 0.4 to 0.45 wavelengths long and are spaced
at 0.3 to 0.4 wavelengths in front of the dipole. An antenna will
usually have 6 to 12 directors.

### Parabolic Reflector

:

    :

## Antenna Arrays

By combining several radiating elements together, the overall radiation
pattern can be modified to suit a particular application. In some cases
the antennas must be manually steered, but in other cases they can be
electronically steered using phase shifting between elements.

:

    :   !200 px
        ![](PAVE_PAWS_Radar_Clear_AFS_Alaska.jpg "PAVE_PAWS_Radar_Clear_AFS_Alaska.jpg"){width="200"}

The array factor is the increase in field strength in an array when
compared to a single element radiating the same power:

:

    :   ![](Array_side_view.gif "fig:Array_side_view.gif")

$$AF = \left| {\frac{{\sin \left( {\frac{{n\varphi }}{2}} \right)}}{{\sqrt n \sin \left( {\frac{\varphi }{2}} \right)}}} \right| \vdots \quad \quad \quad AF_{\max }  = \sqrt n$$

:

    :   Where:

$$\varphi  = \frac{{2\pi }}{\lambda }s\cos \left( \theta  \right) + \alpha$$

:

    :   = phase difference between radiated fields from adjacent
        elements

:

    :   *n* = number of radiating elements
    :   *s* = element spacing in wavelengths
    :   $\alpha$ = current phase shift between elements
    :   $\theta$ = angle from array axis

### Broadside Array

If all of the elements are fed in-phase, there will always be a
broadside radiation pattern. However, depending on the relative spacing,
an end fire pattern can also be created.

:

    :   ![](Broadside_wavefront.gif "fig:Broadside_wavefront.gif")

The radiating elements in the above illustration can be placed such that
they reinforce one another along the array axis, or not. An end fire
pattern is recreated when they reinforce.

By varying the space or phase shift between the elements, the size and
direction of the side lobes can be adjusted between these two extremes.
Increasing the number of radiating elements increases the overall array
gain.

:

    :   ![](Array_factor_1.gif "fig:Array_factor_1.gif")

Determining the array factor is sometimes relatively straightforward. By
definition, the signal strength for a broadside array is a maximum when
$\theta$ = 90^o^ and a minimum when $\theta$ = 0^o^

Since the array factor is a maximum when $\varphi$ = 0^o^ we can
determine the current phase shift $\alpha$, required to create a
broadside radiation pattern for a given frequency or element spacing:

$$\varphi  = \frac{{2\pi }}{\lambda }s\cos \left( \theta  \right) + \alpha$$

$$0 = \frac{{2\pi }}{\lambda }s\cos \left( \theta  \right) + \alpha$$

$$\alpha  = 0$$

:

    :   Therefore the array factor for a broadside array is:

$$AF = \left| {\frac{{\sin \left( {\frac{{n\varphi }}{2}} \right)}}{{\sqrt n \sin \left( {\frac{\varphi }{2}} \right)}}} \right|\quad {\rm{where}}\quad \varphi  = \frac{{2\pi }}{\lambda }s\cos \left( \theta  \right)$$

$${\rm{generally}}\quad s = \frac{\lambda }{2}\quad \quad \quad {\rm{therefore}}\quad \quad \quad \varphi  = 2cos\left( \theta  \right)$$

Each element may have its own feed or there may be a single feed:

:

    :   ![](Broadside_feed.gif "fig:Broadside_feed.gif")

This form of antenna is often deployed in vertical stacks, with a
reflector spaced 1/4 wavelength behind the curtain. This broadband
dipole curtain array is the standard antenna for 100 to 500 kW
short-wave broadcasting stations.

:

    :   ![](Broadside_array.gif "fig:Broadside_array.gif")

CBC Radio International operates eight curtain arrays at Sackville NB.
Three have an output power of 100 kW and five have an output of 250 kW.
They are tunable over the range of 4.9 to 21.7 MHz. Signals are beamed
to Africa, Europe, Latin America, The Caribbean, the USA, and Mexico.

### Endfire Array

If all of the elements are positioned in such a way that the combined
wave fronts reinforce along the array axis.

:

    :   ![](Endfire.gif "fig:Endfire.gif")

Calculate the array factor is relatively straightforward. The signal
strength is a maximum when $\theta$ = 0^o^ and a minimum when $\theta$ =
90^o^

Since the array factor is a maximum when $\varphi$ = 0^o^ we can
determine the value of $\alpha$:

$$\varphi  = \frac{{2\pi }}{\lambda }s\cos \left( \theta  \right) + \alpha$$

$$0 = \frac{{2\pi }}{\lambda }s\cos \left( 0 \right) + \alpha$$

$$\alpha  =  - \frac{{2\pi }}{\lambda }s$$

:

    :   The array factor for an end fire array is:

$$AF = \left| {\frac{{\sin \left( {\frac{{n\varphi }}{2}} \right)}}{{\sqrt n \sin \left( {\frac{\varphi }{2}} \right)}}} \right|\quad {\rm{where}}\quad \varphi  = \frac{{2\pi }}{\lambda }s\left( {\cos \left( \theta  \right) - 1} \right)$$

$${\rm{generally}}\quad s = \frac{\lambda }{4}\quad \quad \quad {\rm{therefore}}\quad \quad \quad \varphi  = \frac{\pi }{2}\left( {cos\left( \theta  \right) - 1} \right)$$

Varying the spacing for a 6-element array produced the following
patterns:

:

    :   ![](Broadside_patterns.gif "fig:Broadside_patterns.gif")

### Phased Array

By varying the phase shift between elements, a beam or multiple beams
can be pointed towards a given direction. This forms the basis of the
large electronically steered radar system currently being deployed.
Collectively theses systems are known as phased arrays.

:

    :   !300 px

The PAVE PAWS early warning radar for example has 1792 active crossed
dipole antennas on a 102-foot face. Each face can scan 120^o^ in azimuth
and 80^o^ in elevation. The array has a range of 300 miles and can
produce multiple beams, which can be redirected in milliseconds.

## Further reading

-   Wifi/Building an antenna


# Communication Systems/Noise Figure

This page is going to talk about the effect of noise on transmission
systems.

## Types of Noise

Most man made electro-magnetic noise occurs at frequencies below
500 MHz. The most significant of these include:

:

    :   • Hydro lines
    :   • Ignition systems
    :   • Fluorescent lights
    :   • Electric motors

Therefore deep space networks are placed out in the desert, far from
these sources of interference.

There are also a wide range of natural noise sources which cannot be so
easily avoided, namely:

:

    :   •*Atmospheric noise* - lighting \< 20 MHz
    :   •*Solar noise* - sun - 11 year sunspot cycle
    :   •*Cosmic noise* - 8 MHz to 1.5 GHz
    :   •*Thermal or Johnson noise*. Due to free electrons striking
        vibrating ions.
    :   •*White noise* - white noise has a constant spectral density
        over a specified range of frequencies. Johnson noise is an
        example of white noise.
    :   •*Gaussian noise* - Gaussian noise is completely random in
        nature however, the probability of any particular amplitude
        value follows the normal distribution curve. Johnson noise is
        Gaussian in nature.
    :   •*Shot noise* - bipolar transistors
        $$i_n  = \sqrt {2qI_{dc} \Delta f}$$

        :

            :   where *q* = electron charge 1.6 x 10^-19^ coulombs
    :   •*Excess noise, flicker, 1/f, and pink noise* \< 1 KHz are
        Inversely proportional to frequency and directly proportional to
        temperature and dc current
    :   •*Transit time noise* - occurs when the electron transit time
        across a junction is the same period as the signal.

Of these, only Johnson noise can be readily analysed and compensated
for. The noise power is given by:

$$P_n  = kTB$$

Where:

:

    :   *k* = Boltzmann\'s constant (1.38 x 10^-23^ J/K)
    :   T = temperature in degrees Kelvin
    :   B = bandwidth in Hz

This equation applies to copper wire wound resistors, but is close
enough to be used for all resistors. Maximum power transfer occurs when
the source and load impedance are equal.

### Combining Noise Voltages

The instantaneous value of two noise voltages is simply the sum of their
individual values at the same instant.

$$v_{total\;inst}  = v_{1\;inst}  + v_{2\;inst}$$

This result is readily observable on an oscilloscope. However, it is not
particularly helpful, since it does not result in a single stable
numerical value such as one measured by a voltmeter.

If the two voltages are coherent \[K = 1\], then the total rms voltage
value is the sum of the individual rms voltage values.

$$v_{total\;rms}  = v_{1\;rms}  + v_{2\;rms}$$

If the two signals are completely random with respect to each other \[K
= 0\], such as Johnson noise sources, the total power is the sum of all
of the individual powers:

$$P_{total\;random\;noise}  = P_{n1\;random}  + P_{n2\;random}$$

A Johnson noise of power *P = kTB*, can be thought of as a noise voltage
applied through a resistor, Thevenin equivalent.

:

    :   ![](noise_source.gif "fig:noise_source.gif")

An example of such a noise source may be a cable or transmission line.
The amount of noise power transferred from the source to a load, such as
an amplifier input, is a function of the source and load impedances.

:

    :   ![](noise_circuit.gif "fig:noise_circuit.gif")

If the load impedance is 0 $\Omega$, no power is transferred to it since
the voltage is zero. If the load has infinite input impedance, again no
power is transferred to it since there is no current. Maximum power
transfer occurs when the source and load impedances are equal.

$$P_{L\;\max }  = \frac{{e_s^2 }}{{4R_s }}$$

The rms noise voltage at maximum power transfer is:

$$e_n  = \sqrt {4RP}  = \sqrt {4RkTB}$$

:

    :   ![](matched_thermal_noise.gif "fig:matched_thermal_noise.gif")

Observe what happens if the noise resistance is resolved into two
components:

$$e_n^2  = 4RkTB = 4\left( {R_1  + R_2 } \right)kTB = e_{n1}^2  + e_{n2}^2$$

From this we observe that random noise resistance can be added directly,
but random noise voltages add vectorially:

:

    :   ![](vector_addition.gif "fig:vector_addition.gif")

If the noise sources are not quite random, and there is some correlation
between them \[0 \< K \< 1\], the combined result is not so easy to
calculate:

$$P_{Total\;\left( {{\rm{not }}\;{\rm{quite}}\;{\rm{ random}}} \right)}  = \frac{{E_1^2  + E_2^2  + 2KE_1 E_2 }}{{R_0 }} = P_1  + P_2  = 2K\sqrt {P_1  + P_2 }$$

:

    :   where

```{=html}
<!-- -->
```

:

    :   *K* = correlation \[0 _\<_ *K*
        _\<_ 1\]
    :   *R~0~* = reference impedance

## Noise Temperature

The amount of noise in a given transmission medium can be equated to
thermal noise. Thermal noise is well-studied, so it makes good sense to
reuse the same equations when possible. To this end, we can say that any
amount of radiated noise can be approximated by thermal noise with a
given **effective temperature**. Effective temperature is measured in
Kelvin. Effective temperature is frequently compared to the **standard
temperature**, $T_o$, which is 290 Kelvin.

In microwave applications, it is difficult to speak in terms of currents
and voltages since the signals are more aptly described by field
equations. Therefore, temperature is used to characterize noise. The
total noise temperature is equal to the sum of all the individual noise
temperatures.

## Noise Figure

The terms used to quantify noise can be somewhat confusing but the key
definitions are:

:

    :   **Signal to noise ratio**: It is either unitless or specified in
        dB. The S/N ratio may be specified anywhere within a system.

$$\frac{S}{N} = \frac{{{\rm{signal}}\;{\rm{power}}}}{{{\rm{noise}}\;{\rm{power}}}} = \frac{{P_s }}{{P_n }}$$

$$\left( {\frac{S}{N}} \right)_{dB}  = 10\log \frac{{P_s }}{{P_n }}$$

:

    :   **Noise Factor (or Noise Ratio)**:
        $F = \frac{{\left( {\frac{S}{N}} \right)_{in} }}{{\left( {\frac{S}{N}} \right)_{out} }}$
        (unit less)

```{=html}
<!-- -->
```

:

    :   **Noise Figure**: $NF = 10\log F = SNR_{in}  - SNR_{out}$ dB

This parameter is specified in all high performance amplifiers and is
measure of how much noise the amplifier itself contributes to the total
noise. In a perfect amplifier or system, *NF* = 0 dB. This discussion
does not take into account any noise reduction techniques such as
filtering or dynamic emphasis.

:

    :   ![](g.gif "fig:g.gif")

### Friiss\' Formula & Amplifier Cascades

It is interesting to examine an amplifier cascade to see how noise
builds up in a large communication system.

$$F = \frac{{\left( {\frac{S}{N}} \right)_{in} }}{{\left( {\frac{S}{N}} \right)_{out} }} = \frac{{S_{in} }}{{N_{in} }} \times \frac{{N_{out} }}{{S_{out} }}$$

Amplifier gain can be defined as: $G = \frac{{S_{out} }}{{S_{in} }}$

:

    :   ![](g2.gif "fig:g2.gif")

```{=html}
<!-- -->
```

:

    :   Therefore the output signal power is: $S_{out}  = GS_{in}$

```{=html}
<!-- -->
```

:

    :   and the noise factor (ratio) can be rewritten as:
        $F = \frac{{S_{in} }}{{N_{in} }} \times \frac{{N_{out} }}{{GS_{in} }} = \frac{{N_{out} }}{{GN_{in} }}$

```{=html}
<!-- -->
```

:

    :   The output noise power can now be written: $N_{out}  = FGN_{in}$

From this we observe that the input noise is increased by the noise
ratio and amplifier gain as it passes through the amplifier. A noiseless
amplifier would have a noise ratio (factor) of 1 or noise figure of
0 dB. In this case, the input noise would only be amplified by the gain
since the amplifier would not contribute noise.

:

    :   The minimum noise that can enter any system is the Johnson
        Noise:

$$N_{in\left( {{\rm{minimum}}} \right)}  = kTB$$

:

    :   Therefore the minimum noise that can appear at the output of any
        amplifier is:

$$N_{out\left( {{\rm{minimum}}} \right)}  = FGkTB$$

:

    :   The output noise of a perfect amplifier would be (*F* = 1):

$$N_{out\left( {{\rm{perfect}}} \right)}  = GkTB$$

:

    :   The difference between these two values is the noised created
        (added) by the amplifier itself:

$$N_{out\left( {{\rm{added}}} \right)}  = N_{out\left( {{\rm{minimum}}} \right)}  - N_{out\left( {{\rm{perfect}}} \right)}  = FGkTB - GkTB = \left( {F - 1} \right)GkTB$$

:

    :   This is the additional (created) noise, appearing at the output.

**The total noise out of the amplifier is then given by:**

$$N_{total}  = N_{out\left( {{\rm{perfect}}} \right)}  + N_{out\left( {{\rm{added}}} \right)}  = GkTB + \left( {F - 1} \right)GkTB$$

If a second amplifier were added in series, the total output noise would
consist the first stage noise amplified by the second stage gain, plus
the additional noise of the second amplifier:

$$N_{total}  = G_1 G_2 kTB + \left( {F_1  - 1} \right)G_1 G_2 kTB + \left( {F_2  - 1} \right)G_2 kTB$$

:

    :   If we divide both sides of this expression by the common term:
        $G_1 G_2 kTB$

```{=html}
<!-- -->
```

:

    :   we obtain:

$$\frac{{N_{total} }}{{G_1 G_2 kTB}} = \frac{{G_1 G_2 kTB + \left( {F_1  - 1} \right)G_1 G_2 kTB + \left( {F_2  - 1} \right)G_2 kTB}}{{G_1 G_2 kTB}}$$

:

    :   Recall:
        $F = \frac{{N_{out} }}{{GN_{in} }} = \frac{{N_{total} }}{{G_1 G_2 kTB}}$

```{=html}
<!-- -->
```

:

    :   Then: $F_{overall}  = F_1  + \frac{{F_2  - 1}}{{G_1 }}$

This process can be extended to include more amplifiers in cascade to
arrive at:

:   **Friiss\' Formula**

$$F = F_1  + \frac{{F_2  - 1}}{{G_1 }} + \frac{{F_3  - 1}}{{G_1 G_2 }} +$$

This equation shows that the overall system noise figure is largely
determined by the noise figure of the first stage in a cascade since the
noise contribution of any stage is divided by the gains of the preceding
stages. This is why the 1st stage in any communication system should be
an LNA (low noise amplifier).

## Receiver Sensitivity

In a given bandwidth, W, we can show that the noise power N equals:

$$N = F(kT_0)W$$

From N, we can show that the sensitivity of the receiver is equal to

$$SNR \times N$$

## Cascaded Systems


# Communication Systems/Wired Transmission

This page will discuss the topic of signal propagation through physical
mediums, such as wires.

## Transmission Line Equation

Many kinds of communication systems require signals at some point to be
conveyed over copper wires.

The following analysis requires two assumptions:

:

    :   • A transmission line can be decomposed into small, distributed
        passive electrical elements
    :   • These elements are independent of frequency (i.e. although
        *reactance* is a function of frequency, resistance, capacitance
        and inductance are not)

These two assumptions limit the following analysis to frequencies up to
the low MHz region. The second assumption is particularly difficult to
defend since it is well known that the resistance of a wire increases
with frequency because the conduction cross-section decreases. This
phenomenon is known as the skin effect and is not easy to evaluate.

:

    :   ![](transmission_line.gif "fig:transmission_line.gif")

The purpose behind the following mathematical manipulation is to obtain
an expression that defines the voltage (or current) at any time (*t*)
along any portion (*x*) of the transmission line. Later, this analysis
will be extended to include the frequency domain.

Recall the characteristic equations for inductors and capacitors:

$$v = L\frac{{\partial i}}{{\partial t}}$$ and
$i = C\frac{{\partial v}}{{\partial t}}$

### Kirchoff\'s Voltage Law

Kirchoff\'s voltage law (KVL) simply states that the sum of all voltage
potentials around a closed loop equal zero. Or in other words, if you
walked up a hill and back down, the net altitude change would be zero.

:

    :   Applying KVL in the above circuit, we obtain:

$$v\left( {x,t} \right) = R\Delta xi\left( {x,t} \right) + L\Delta x\frac{{\partial i}}{{\partial t}}\left( {x,t} \right) + v\left( {x + \Delta x,t} \right)$$

:

    :   Rearranging:

$$v\left( {x,t} \right) - v\left( {x + \Delta x,t} \right) = R\Delta xi\left( {x,t} \right) + L\Delta x\frac{{\partial i}}{{\partial t}}\left( {x,t} \right)$$

:

    :   But the LHS (left hand side) of the above equation, represents
        the voltage drop across the cable element $\Delta v$, therefor:

$$\Delta v = R\Delta xi\left( {x,t} \right) + L\Delta x\frac{{\partial i}}{{\partial t}}\left( {x,t} \right)$$

:

    :   Dividing through by $\Delta x$, we obtain:

$$\frac{{\Delta v}}{{\Delta x}} = Ri\left( {x,t} \right) + L\frac{{\partial i}}{{\partial t}}\left( {x,t} \right)$$

:

    :   The LHS is easily recognized as a derivative. Simplifying the
        notation:

$$\frac{{\partial v}}{{\partial x}} = Ri + L\frac{{\partial i}}{{\partial t}}$$

This expression has both current and voltage in it. It would be
convenient to write the equation in terms of current or voltage as a
function of distance or time.

### Simplifying the Equation (trust me)

The first step in separating voltage and current is to take the
derivative with respect to the position *x* (**Equation 1**):

$$\frac{{\partial ^2 v}}{{\partial x^2 }} = R\frac{{\partial i}}{{\partial x}} + L\frac{{\partial ^2 i}}{{\partial x\partial t}}$$

:

    :   The next step is to eliminate the current terms, leaving an
        expression with voltage only. The change in current along the
        line is equal to the current being shunted across the line
        through the capacitance *C* and conductance *G*. By applying KCL
        in the circuit, we obtain the necessary information (**Equation
        2**):

$$\frac{{\partial i}}{{\partial x}} = Gv + C\frac{{\partial v}}{{\partial t}}$$

:

    :   Taking the derivative with respect to time, we obtain
        (**Equation 3**):

$$\frac{{\partial ^2 i}}{{\partial x\partial t}} = G\frac{{\partial v}}{{\partial t}} + C\frac{{\partial ^2 v}}{{\partial t^2 }}$$

:

    :   Substituting (**Equation 2**) and (**Equation 3**) into
        (**Equation 1**), we obtain the desired simplification:

$$\frac{{\partial ^2 v}}{{\partial x^2 }} = R\left[ {Gv + C\frac{{\partial v}}{{\partial t}}} \right] + L\left[ {G\frac{{\partial v}}{{\partial t}} + C\frac{{\partial ^2 v}}{{\partial t^2 }}} \right]$$

:

    :   Collecting the terms, we obtain:

```{=html}
<!-- -->
```

:

    :   **The Transmission Line Equation for Voltage**

$$\frac{{\partial ^2 v}}{{\partial x^2 }} = RGv + \left( {RC + LG} \right)\frac{{\partial v}}{{\partial t}} + LC\frac{{\partial ^2 v}}{{\partial t^2 }}$$

This equation is known as the transmission line equation. Note that it
has voltage at any particular location *x* as a function of time *t*.

:

    :   Similarly for current, we obtain:

```{=html}
<!-- -->
```

:

    :   **The Transmission Line Equation for Current**

$$\frac{{\partial ^2 i}}{{\partial x^2 }} = RGi + \left( {RC + LG} \right)\frac{{\partial i}}{{\partial t}} + LC\frac{{\partial ^2 i}}{{\partial t^2 }}$$

But we\'re not quite done yet.

### Solving the Transmission Line Equation

Historically, a mathematician would solve the transmission line equation
for *v* by assuming a solution for *v*, substituting it into the
equation, and observing whether the result made any sense. An engineer
would follow a similar procedure by making an "educated guess" based on
some laboratory experiments, as to what the solution might be. Today
there are more sophisticated techniques used to find solutions. In this
respect, the engineer may lag behind the mathematician by several
centuries in finding applications for mathematical tools.

To solve the transmission line equation, we shall guess that the
solution for the voltage function is of the form:

$$v\left( t \right) = e^{j\omega t} e^{ - \gamma x}$$

The first term represents a unity vector rotating at an angular velocity
of $\omega$ radians per second, in other words, a sine wave of some
frequency. The second term denotes the sinusoid being modified by the
transmission line, namely its amplitude decaying exponentially with
distance. If we let $\gamma$ be a complex quantity, we can also include
any phase changes which occur as the signal travels down the line.

:   The sine wave is used as a signal source because it is easy to
    generate, and manipulate mathematically. Euler's Identity shows the
    relationship between exponential notation and trigonometric
    functions:

```{=html}
<!-- -->
```

:

    :   **Euler\'s Identity**

$$e^{j\omega t}  = \cos \left( {\omega t} \right) + j\sin \left( {\omega t} \right)$$

:

    :   Going back to our educated guess, we will let
        $\gamma  = \alpha  + j\beta$, therefore:

$$v\left( t \right) = e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x}  = e^{ - \alpha x} e^{\left( {\omega t - \beta x} \right)j}$$

:

    :   The term $e^{ - \alpha x}$ represents the exponential amplitude
        decay as this signal travels down the line. $\alpha$ is known as
        the attenuation coefficient and is expressed in Nepers per
        meter.

```{=html}
<!-- -->
```

:

    :   The term $e^{\left( {\omega t - \beta x} \right)j}$ represents
        the frequency of the signal at any point along the line. $\beta$
        component is known as the phase shift coefficient, and is
        expressed in radians per meter.

```{=html}
<!-- -->
```

:

    :   Substituting our *educated guess*

$$v\left( t \right) = e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x}$$

:

    :   into the transmission line equation for voltage, we obtain:

$$\frac{{\partial ^2 }}{{\partial x^2 }}\left[ {e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right] = RG\left[ {e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right] + \left( {RC + LG} \right)\frac{\partial }{{\partial t}}\left[ {e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right] + LC\frac{{\partial ^2 }}{{\partial t^2 }}\left[ {e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right]$$

This looks pretty intimidating, but if you can do basic differentials
and algebra, you can do this!

#### Simplifying the Equation (trust me)

The idea now is to work through the math to see if we come up with a
reasonable solution. If we arrive at a contradiction or an unreasonable
result, it means that our educated guess was wrong and we have to do
more experimenting and come up with a better guess as to how voltage and
current travel down a transmission line.

Let\'s look at this equation one term at a time:

:

    :   LHS = RHS Term 1 + RHS Term 2 + RHS Term 3

```{=html}
<!-- -->
```

:

    :   Starting with the left hand side (LHS) we get the following
        simplification:

$$\frac{{\partial ^2 }}{{\partial x^2 }}\left[ {e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right] = \frac{\partial }{{\partial x}}\left[ { - \left( {\alpha  + j\beta } \right)e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right] = \left( {\alpha  + j\beta } \right)^2 e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x}$$

:

    :   Believe it or not, the RHS Term 1 does not need simplifying.

```{=html}
<!-- -->
```

:

    :   Simplifying the RHS Term 2, we obtain:

$$\left( {RC + LG} \right)\frac{\partial }{{\partial t}}\left[ {e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right] = \left( {RC + LG} \right)j\omega \left( {e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right)$$

:

    :   Simplifying the RHS Term 3, we obtain:

$$LC\frac{{\partial ^2 }}{{\partial t^2 }}\left[ {e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right] = LC\frac{\partial }{{\partial t}}\left[ {j\omega e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right] =  - LC\omega ^2 e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x}$$

:

    :   Let\'s put it all back together:

$$\left( {\alpha  + j\beta } \right)^2 e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x}  = RG\left( {e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right) + \left( {RC + LG} \right)j\omega \left( {e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right) - LC\omega ^2 \left( {e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x} } \right)$$

:

    :   Note that each of the four terms contain the expression
        $e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x}$.

```{=html}
<!-- -->
```

:

    :   Therefore we end up with:

$$\left( {\alpha  + j\beta } \right)^2  = RG + \left( {RC + LG} \right)j\omega  - LC\omega ^2$$

:

    :   And this can be further simplified to:

```{=html}
<!-- -->
```

:

    :   **Attenuation and Phase Shift Coefficients**

$$\alpha  + j\beta  = \gamma  = \sqrt {\left( {R + j\omega L} \right)\left( {G + j\omega C} \right)}$$

This result is not self contradictory or unreasonable. Therefore we
conclude that our educated guess was right and we have successfully
found an expression for attenuation and phase shift on a transmission
line as a function of its distributed electrical components and
frequency.

### Lossless Transmission Line

Signal loss occurs by two basic mechanisms: signal power can be
dissipated in a resistor \[or conductance\] or signal currents may be
shunted to an AC ground via a reactance. In transmission line theory, a
lossless transmission line does not dissipate power. Signals, will still
gradually diminish however, as shunt reactances return the current to
the source via the ground path. For the power loss to equal zero, R = G
= 0. This condition occurs when the transmission line is very short. An
oscilloscope probe is an example of a very short transmission line. The
transmission line equation reduces to the voltage equation:

$$\frac{{\partial ^2 v}}{{\partial x^2 }} = LC\frac{{\partial ^2 v}}{{\partial t^2 }}$$

:

    :   and the current equation:

$$\frac{{\partial ^2 i}}{{\partial x^2 }} = LC\frac{{\partial ^2 i}}{{\partial t^2 }}$$

To determine how sinusoidal signals are affected by this type of line,
we simply substitute a sinusoidal voltage or current into the above
expressions and solve as before, or we could take a much simpler
approach. We could start with the solution for the general case:

$$\alpha  + j\beta  = \gamma  = \sqrt {\left( {R + j\omega L} \right)\left( {G + j\omega C} \right)}$$

:

    :   Let *R* = *G* = 0, and simplify:

$$\alpha  + j\beta  = \sqrt {\left( {j\omega L} \right)\left( {j\omega C} \right)}  = \omega \left( {LC} \right)^2 j$$

:

    :   Equating the real and imaginary parts:

$$\alpha  = 0$$

$$\beta  = \omega \sqrt {LC}$$

This expression tells us that **a signal travelling down a lossless
transmission line, experiences a phase shift directly proportional to
its frequency.**

#### Phase Velocity

A new parameter, known as phase velocity, can be extracted from these
variables:

$$V_p  = \frac{1}{{\sqrt {LC} }} = \frac{\omega }{\beta }$$ meters per
second

Phase velocity is the speed at which a fixed point on a wavefront,
appears to move. In the case of wire transmission lines, it is also the
velocity of propagation., typically: 0.24c \< Vp \< 0.9c .

The distance between two identical points on a wavefront is its
wavelength ($\lambda$) and since one cycle is defined as 2$\pi$ radians:

$$\lambda  = \frac{{2\pi }}{\beta }$$ and $\omega  = 2\pi f$

:

    :   therefore:

$$V_p  = \lambda f$$

In free space, the phase velocity is 3 x 10^8^ meters/sec, the speed of
light. In a cable, the phase velocity is somewhat lower because the
signal is carried by electrons. In a waveguide transmission line, the
phase velocity exceeds the speed of light.

### Distortionless Transmission Line

A distortionless line does not distort the signal phase, but does
introduce a signal loss. Since common transmission lines are not super
conductors, the signal will decrease in amplitude but retain the same
shape as the input. This characteristic is essential for long cable
systems.

Phase distortion does not occur if the phase velocity *V~p~* is constant
at all frequencies.

By definition, a phase shift of 2$\pi$ radians occurs over one
wavelength $\lambda$.

:

    :   Since

$$V_p  = \lambda f\quad \quad \lambda  = \frac{{2\pi }}{\beta }\quad \quad f = \frac{\omega }{{2\pi }}$$

:

    :   Then:

$$V_p  = \frac{{2\pi }}{\beta } \times \frac{\omega }{{2\pi }} = \frac{\omega }{\beta }$$

This tells us that in order for phase velocity *V~p~* to be constant,
the phase shift coefficient $\beta$, must vary directly with frequency
$\omega$.

:

    :   Recall

$$\gamma  = \sqrt {\left( {R + j\omega L} \right)\left( {G + j\omega C} \right)}  = \alpha  + j\beta$$

The problem now is to find $\beta$. This can be done as follows:

$$\gamma  = \sqrt {\left( {\frac{{R + j\omega L}}{{j\omega L}}} \right)\left( {j\omega L} \right)\left( {\frac{{G + j\omega C}}{{j\omega C}}} \right)\left( {j\omega C} \right)}  = j\omega \sqrt {LC} \sqrt {1 + \frac{R}{{j\omega L}}} \sqrt {1 + \frac{G}{{j\omega C}}}$$

It may seem that we have lost $\beta$, but do not give up. The 2nd and
3rd roots can be expanded by means of the Binomial Expansion.

:

    :   Recall:

$$\left( {1 + x} \right)^n  = 1 + nx + \frac{{n\left( {n - 1} \right)}}{{2!}}x^2  + \frac{{n\left( {n - 1} \right)\left( {n - 2} \right)}}{{3!}}x^3  +  \cdots$$

:

    :   In this instance *n* = 1/2. Since the contribution of successive
        terms diminishes rapidly, $\gamma$ is expanded to only 3 terms:

$$\gamma  \approx j\omega \sqrt {LC} \left( {1 + \frac{1}{2}\frac{R}{{j\omega L}} - \frac{1}{8}\left( {\frac{R}{{j\omega L}}} \right)^2 } \right)\left( {1 + \frac{1}{2}\frac{G}{{j\omega C}} - \frac{1}{8}\left( {\frac{G}{{j\omega C}}} \right)^2 } \right)$$

This may seem complex, but remember it is only algebra and it will
reduce down to simple elegance. Expanding the terms we obtain:

$$\gamma  \approx j\omega \sqrt {LC} \left\{ \begin{array}{l}
 1 + \frac{1}{2}\frac{G}{{j\omega C}} - \frac{1}{8}\left( {\frac{G}{{j\omega C}}} \right)^2  + \frac{1}{2}\frac{R}{{j\omega L}} - \frac{1}{4}\frac{{RG}}{{\omega ^2 LC}} \\
  - \frac{1}{{16}}\frac{R}{{j\omega L}}\left( {\frac{G}{{j\omega C}}} \right)^2  - \frac{1}{8}\left( {\frac{R}{{j\omega L}}} \right)^2  \\
  - \frac{1}{{16}}\left( {\frac{R}{{j\omega L}}} \right)^2 \frac{G}{{j\omega C}} + \frac{1}{{64}}\left( {\frac{R}{{j\omega L}}} \right)^2 \left( {\frac{G}{{j\omega C}}} \right)^2  \\
 \end{array} \right\}$$

:

    :   Since $\gamma  = \alpha  + j\beta$, we merely have to equate the
        real and imaginary terms to find $\beta$.

$$\beta  \approx \omega \sqrt {LC} \left\{ {1 + \underbrace {\frac{1}{8}\left( {\frac{G}{{\omega C}}} \right)^2  - \frac{1}{4}\frac{{RG}}{{\omega ^2 LC}} + \frac{1}{8}\left( {\frac{R}{{\omega L}}} \right)^2 }_{{\rm{Difference}}\;{\rm{of}}\;{\rm{squares}}} + \underbrace {\frac{1}{{64}}\left( {\frac{R}{{\omega L}}} \right)^2 \left( {\frac{G}{{\omega C}}} \right)^2 }_{{\rm{Very}}\;{\rm{small}}}} \right\}$$

:

    :   Or

$$\beta  \approx \omega \sqrt {LC} \left\{ {1 + \frac{1}{8}\left( {\frac{R}{{\omega L}} - \frac{G}{{\omega C}}} \right)^2 } \right\}$$

:

    :   Note that if $\frac{R}{{\omega L}} = \frac{G}{{\omega C}}$ then
        $\beta  \approx \omega \sqrt {LC}$

From this we observe that $\beta$ is directly proportional to $\omega$.

:

    :   Therefore the **requirement for distortionless transmission
        is:**

```{=html}
<!-- -->
```

:

    :   *RC = LG*

:

    :   This is one of the essential design characteristics for a
        broadband coax cable network.

If we equate the real terms, we obtain:

$$\alpha  \approx \sqrt {RG}$$

So there is a reason to study algebra after all!

## The Frequency Domain

Signal analysis is often performed in the frequency domain. This tells
us how the transmission line affects the spectral content of the signals
they are carrying.

To determine this, it is necessary to find the Fourier Transform of the
transmission line equation. Recall:

$$\frac{{\partial ^2 v}}{{\partial x^2 }} = RGv + \left( {RC + LG} \right)\frac{{\partial v}}{{\partial t}} + LC\frac{{\partial ^2 v}}{{\partial t^2 }}$$

and recall (hopefully) the Fourier Transform (which converts the time
domain to the frequency domain):

$$\mathbb{F}\left\{ {f\left( t \right)} \right\} = F\left( \omega  \right) = \int\limits_{ - \infty }^\infty  {e^{ - j\omega t} f\left( t \right)dt}$$

To prevent this analysis from 'blowing up', we must put a stipulation on
the voltage function namely, that it vanishes to zero at an infinite
distance down the line. This comprises a basic boundary condition.

$${\text{let}}\quad v \to 0\quad {\text{as}}\quad x \to \infty$$

This stipulation is in agreement with actual laboratory experiments. It
is well known that the signal magnitude diminishes as the path
lengthens.

Likewise, a time boundary condition, that the signal was zero at some
time in the distant past and will be zero at some time in the distant
future, must be imposed.

$${\text{let}}\quad v \to 0\quad {\text{as}}\quad t \to \infty$$

Although engineers have no difficulty imposing these restrictions,
mathematical purists, are somewhat offended. For this and other reasons,
other less restrictive transforms have been developed. The most notable
in this context, is the Laplace transform, which does not have the same
boundary conditions.

Having made the necessary concessions in order to continue our analysis,
we must find the Fourier Transform corresponding to the following terms:

$$\mathbb{F}\left\{ v \right\}\quad \quad \quad \mathbb{F}\left\{ {\frac{{\partial v}}
{{\partial t}}} \right\}\quad \quad \quad \mathbb{F}\left\{ {\frac{{\partial ^2 v}}
{{\partial t^2 }}} \right\}$$

$${\text{Let:}}\quad \quad \quad \mathbb{F}\left\{ v \right\} = V$$

:

    :   Then applying the transform on the derivative, we obtain:

$$\mathbb{F}\left\{ {\frac{{\partial v}}
{{\partial t}}} \right\} = \int\limits_{ - \infty }^\infty  {e^{ - j\omega t} \frac{{\partial v}}
{{\partial t}}dt}$$

This equation can be solved by using integration by parts:

$$\int {u\,dv}  = uv - \int {v\,du}$$

$${\text{let}}\quad u = e^{ - j\omega t} \quad \quad \quad \therefore du =  - j\omega e^{ - j\omega t}$$

$${\text{and}}\quad dv = \frac{{\partial v}}{{\partial t}}\quad \quad \quad \therefore v = v$$

$$\therefore \mathbb{F}\left\{ {\frac{{\partial v}}
{{\partial t}}} \right\} = e^{ - j\omega t} \left. v \right|_{ - \infty }^\infty   - \int\limits_{ - \infty }^\infty  {v\left( { - j\omega e^{ - j\omega t} } \right)dt}$$

Applying the boundary conditions when t goes to infinity makes the 1st
term disappear.

$$\therefore \mathbb{F}\left\{ {\frac{{\partial v}}
{{\partial t}}} \right\} = j\omega \int\limits_{ - \infty }^\infty  {e^{ - j\omega t} v\,dt}$$

Note that the resulting integral is simply the Fourier Transform. In
other words:

$$\mathbb{F}\left\{ {\frac{{\partial v}}
{{\partial t}}} \right\} = j\omega \mathbb{F}\left\{ v \right\} = j\omega V$$

:

    :   similarly:

$$\mathbb{F}\left\{ {\frac{{\partial ^2 v}}
{{\partial t^2 }}} \right\} = \left( {j\omega } \right)^2 \mathbb{F}\left\{ v \right\} = \left( {j\omega } \right)^2 V$$

We can now write the transmission line equation in the frequency domain:

$$\frac{{\partial ^2 V}}
{{\partial x^2 }} = RGV + \left( {RC + LG} \right)j\omega V + LC\left( {j\omega } \right)^2 V$$

:

    :   where:

$$V = V\left( \omega  \right) = \mathbb{F}\left\{ {v\left( t \right)} \right\}$$

:

    :   Rearranging the terms, we obtain:

$$\frac{{\partial ^2 V}}
{{\partial x^2 }} = \left[ {RG + \left( {RC + LG} \right)j\omega  + \left( {j\omega L} \right)\left( {j\omega C} \right)} \right]V$$

:

    :   or

$$\frac{{\partial ^2 V}}
{{\partial x^2 }} = \left[ {\left( {R + j\omega L} \right)\left( {G + j\omega C} \right)} \right]V$$

:

    :   since:

$$\sqrt {\left( {R + j\omega L} \right)\left( {G + j\omega C} \right)}  = \alpha  + j\beta  = \gamma$$

:

    :   then

$$\frac{{\partial ^2 V}}{{\partial x^2 }} = \gamma ^2 V$$

:

    :   or

$$\frac{{\partial ^2 V}}{{\partial x^2 }} - \gamma ^2 V = 0$$

This represents the most general form of the transmission line equation
in the frequency domain. This equation must now be solved for V to
observe how voltage (or current) varies with distance and frequency.
This can be done by assuming a solution of the form:

$$V = \underbrace {Ae^{ - \gamma x} }_{{\text{forward}}\;{\text{wave}}} + \underbrace {Be^{\gamma x} }_{{\text{reverse}}\;{\text{wave}}}$$

These terms represent an exponential decay as the signal travels down
the transmission line. If we ignore any reflections, assuming that the
cable is infinitely long or properly terminated, this simplifies to:

$$V = V_0 e^{ - \gamma x}$$

To verify whether this assumption is correct, substitute it into the
equation, and see if a contradiction occurs. If there is no
contradiction, then our assumption constitutes a valid solution.

$$\frac{{\partial ^2 }}{{\partial x^2 }}V_0 e^{ - \gamma x}  - \gamma ^2 V_0 e^{ - \gamma x}  = 0$$

$$\frac{\partial }{{\partial x}}\left( { - \gamma ^2 V_0 e^{ - \gamma x} } \right) - \gamma ^2 V_0 e^{ - \gamma x}  = 0$$

$$\gamma ^2 V_0 e^{ - \gamma x}  - \gamma ^2 V_0 e^{ - \gamma x}  = 0$$

$$0 = 0$$

Thus we validate the assumed solution. This tells us that in the
frequency domain, the voltage or current on a transmission line decays
exponentially:

$$V = V_0 e^{ - \gamma x}$$

:

    :   where:

$$\gamma  = \sqrt {\left( {R + j\omega } \right)\left( {G + j\omega } \right)}  = \left| \gamma  \right|\angle \varphi  = \alpha  + j\beta$$

$$\gamma  = {\text{ propagation}}\;{\text{constant}}$$

$$\alpha  = {\text{ attenuation}}\;{\text{coeficient}}$$

$$\beta  = {\text{phase}}\;{\text{coefficient}}$$

In exponential notation, a sinusoid may be represented by a rotating
unity vector, of some frequency:

$$e^{j\omega t}  = \cos \omega t + j\sin \omega t$$

Note that the magnitude of this function is 1, but the phase angle is
changing as a function of *t*.

:

    :   If we let: $V_0  = e^{j\omega t}$

```{=html}
<!-- -->
```

:

    :   Then:
        $V_0  = e^{j\omega t} e^{ - \gamma x}  = e^{j\omega t} e^{ - \left( {\alpha  + j\beta } \right)x}  = \underbrace {e^{ - \alpha x} }_{{\text{attenuation}}\;vs.\;x}\overbrace {e^{j\left( {\omega t - \beta x} \right)} }^{{\text{phase}}\;vs{\text{.}}\;t\;{\text{and}}\;x}$

This result is quite interesting because it is the same solution for the
transmission line equation in the time domain. The term
${e^{ - \alpha x} }$ represents an exponential decay. The signal is
attenuated as length *x* increases. The amount of attenuation is defined
as:

:

    :   Attenuation in Nepers:
        $N = \left| {\ln e^{ - \alpha x} } \right| = \alpha x$

```{=html}
<!-- -->
```

:

    :   Attenuation in dB:
        $= 20\log e^{ - \alpha x}  \approx 8.68589\alpha x$

This allows us to determine the attenuation at any frequency at any
point in a transmission line, if we are given the basic line parameters
of*R, L, G, & C*.

The term ${e^{j\left( {\omega t - \beta x} \right)} }$ represents a
rotating unity vector since:

$$e^{j\left( {\omega t - \beta x} \right)}  = \cos \left( {\omega t - \beta x} \right) + j\sin \left( {\omega t - \beta x} \right)$$

The phase angle of this vector is ${\beta x}$ radians.

## Characteristic Impedance

The characteristic impedance of a transmission line is also known as its
surge impedance, and should not be confused with its resistance. If a
line is infinitely long, electrical signals will still propagate down
it, even though the resistance approaches infinity. The characteristic
impedance is determined from its AC attributes, not its DC ones.

Recall from our earlier analysis:


# Communication Systems/Wireless Transmission

This page will discuss Wireless EM wave propagation, and some basics
about antennas.

## Isotropic Antennas

An isotropic antenna radiates it\'s transmitted power equally in all
directions. This is an ideal model; all real antennas have at least some
directionality associated with them. However, it is mathematically
convenient, and good enough for most purposes.

### Power Flux Density

If the transmitted power is spread evenly across a sphere of radius R
from the antenna, we can find the power per unit area of that sphere,
called the **Power Flux Density** using the Greek letter Φ (capital phi)
and the following formula:

$$\Phi = \frac{P_T}{4 \pi R^2}$$

Where $P_T$ is the total transmitted power of the signal.

### Effective Area

The **effective area** of an antenna is the equivalent amount of area of
transmission power, from a non-ideal isotropic antenna that appears to
be the area from an ideal antenna. For instance, if our antenna is
non-ideal, and 1 meter squared of area can effectively be modeled as .5
meters squared from an ideal antenna, then we can use the ideal number
in our antenna. We can relate the actual area and the effective area of
our antenna using the *antenna efficiency* number, as follows:

$$\eta = \frac{A_e}{A}$$

The area of an ideal isotropic antenna can be calculated using the
wavelength of the transmitted signal as follows:

$$A = \frac{\lambda^2}{4 \pi}$$

### Received Power

The amount of power that is actually received by a receiver placed at
distance R from the isotropic antenna is denoted $P_R$, and can be found
with the following equation:

$$P_R = \Phi_R A_e$$

Where $\Phi_R$ is the power flux density at the distance R. If we plug
in the formula for the effective area of an ideal isotropic antenna into
this equation, we get the following result:

$$P_R = \frac{P_T}{(4 \pi R / \lambda)^2} = \frac{P_T}{L_P}$$

Where $L_P$ is the path-loss, and is defined as:

$$L_P = \left( \frac{4 \pi R}{\lambda} \right)^2$$

The amount of power lost across freespace between two isotropic antenna
(a transmitter and a receiver) depends on the wavelength of the
transmitted signal.

## Directional Antennas

A directional antenna, such as a parabolic antenna, attempts to radiate
most of its power in the direction of a known receiver.

Here are some definitions that we need to know before we proceed:

Azimuth Angle:The Azimuth angle, often denoted with a θ (Greek lower-case Theta), is the angle that the direct transmission makes with respect to a given reference angle (often the angle of the target receiver) when looking down on the antenna from above.\
Elevation Angle:The elevation angle is the angle that the transmission direction makes with the ground. Elevation angle is denoted with a φ (Greek lower-case phi)

### Directivity

Given the above definitions, we can define the transmission gain of a
directional antenna as a function of θ and φ, assuming the same
transmission power:

$$G_T(\theta, \phi) = \frac{\Phi_{\theta,\ \phi}}{\Phi_{isotropic}}$$

### Effective Area

The effective area of a parabolic antenna is given as such:

$$A_e = \eta \frac{\pi D^2}{4}$$

### Transmit Gain

$$G_{max} = \frac{4 \pi A_e}{\lambda^2}$$

If we are at the transmit antenna, and looking at the receiver, the
angle that the transmission differs from the direction that we are
looking is known as Ψ (Greek upper-case Psi), and we can find the
transmission gain as a function of this angle as follows:

$$G(\Psi) = \left( \frac{2J_1((\pi D / \lambda) sin(\Psi))}{sin(\Psi)} \right)^2 \left( \frac{\lambda}{\pi D} \right)^2$$

Where $J_1(\ )$ denotes the first-order bessel function.

### Friis Equation

The **Friis Equation** is used to relate several values together when
using directional antennas:

$$P_R = \frac{P_T G_T G_R}{L_P}$$

The Friis Equation is the fundamental basis for **link-budget
analysis**.

## Link-Budget Analysis

If we express all quantities from the Friis Equation in decibels, and
divide both sides by the noise-density of the transmission medium, N0,
we get the following equation:

$$C/N_0 = EIRP - L_P + (G_R/T_e) - k$$

Where C/N0 is the received carrier-to-noise ratio, and we can decompose
N0 as follows:

$$N_0 = kTe$$

k is Boltzmann\'s constant, (-228.6dBW) and Te is the effective
temperature of the noise signal (in degrees Kelvin). EIRP is the
\"Equivalent Isotropic Radiated Power\", and is defined as:

$$EIRP = G_T P_T$$

To perform a link-budget analysis, we add all the transmission gain
terms from the transmitter, we add the receive gain divided by the
effective temperature, and we subtract Boltzmann\'s constant and all the
path losses of the transmission.

## Further reading

-   Jean-Claude Wippler. \"What if you're out of wireless
    range?\".
    2013.


# Communication Systems/Space-Division Multiplexing

This page is all about **Space-Division Multiplexing** (SDM).

-   What is SDM: When we want to transmit multiple messages, the goal is
    maximum reuse of the given resources: time and frequency.
    Time-Division Multiplexing (TDM), operates by dividing the time up
    into time slices, so that the available time can be reused.
    Frequency-Division Multiplexing (FDM), operates by dividing up the
    frequency into transmission bands, so that the frequency spectrum
    can be reused. However, if we remember our work with directional
    antennas, we can actually reuse both time and frequency, by
    transmitting our information along parallel channels. This is known
    as **Space-Division Multiplexing**.

## Technical categorisations

### Spatial Coding

## Multipathing

## Application systems

### MIMO Systems

### Smart antenna


# Communication Systems/Fading Channels

Over large distances, signal quality degrades even without the presence
of large quantities of AWGN. This degradation is known as **fading**,
and channels that exhibit these properties are known as **fading
channels**.

## What Causes Fading

Fading can be caused due to natural weather disturbances, such as
rainfall, snow, fog, hail and extremely cold air over a warm earth.
Fading can also be created by man made disturbances, such as irrigation,
or from multiple transmission paths, irregular earth surfaces, and
varying terrains.

## Fading Channel Models

### Rician fading

### Rayleigh Fading

### nakagami fading

## Scales of Fading

### *Large-Scale Fading*

Fading generally is a signal loss either in amplitude or phase due to
sudden changes in Channel response. Large scale fading \" Shadowing\"
concerns about large distances effect so, its affect appears clearly in
case of the a moving vehicle where the signal is influenced by Multipath
phenomena where the transmitted signal is received from more than one
path.

### Small-Scale Fading

Small scale fading is concerned about very small changes in the position
of Transmitter or receiver in order of the wavelength as this affect
greatly the received frequency due to doppler effect so as the speed of
the vehicle increases as the frequency is more rapidly changing and it
can be described as fast or slow fading AND flat or slow fading.

## Small-Scale Fading Types

### Frequency-Selective Fading

### Flat Fading

In flat fading, the coherence bandwidth of the channel is larger than
the bandwidth of the signal. Therefore, all frequency components of the
signal will experience the same magnitude of fading. a signal undergoes
flat fading if:

`                                 Bs << Bc`

### Fast Fading

Fast fading occurs when coherant time of the channel is small relative
to the delay constraint of the channel. Amplitude and phase changes
imposed by the channel varies considerably over period of use.


# Bourne Shell Scripting/Appendix D: Cookbook

  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  !Wikimedia Commons logo{width="20"} **\[`{{localurl:{{NAMESPACE}}:{{PAGENAME}}|action=edit&section=new}}`{=mediawiki} Post a new Cookbook entry\]**
  If you use the title box, then you do not need to put a title in the body.
  ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Branch on extensions

When writing a bash script which should do different things based on the
extension of a file, the following pattern is helpful.

``` shell
 #filepath should be set to the name(with optional path) of the file in question
 ext=${filepath##*.}
 if [[ "$ext" == txt ]] ; then
   #do something with text files
 fi
```

(Source: slike.com Bash
FAQ).

## Rename several files

This recipe shows how to rename several files following a pattern.

In this example, the user has huge collection of screenshots. This user
wants to rename the files using a Bourne-compatible shell. Here is an
\"ls\" at the shell prompt to show you the filenames. The goal is to
rename images like \"snapshot1.png\" to
\"nethack-kernigh-22oct2005-01.png\".

``` console
 $ ls
 snapshot1.png   snapshot25.png  snapshot40.png  snapshot56.png  snapshot71.png
 snapshot10.png  snapshot26.png  snapshot41.png  snapshot57.png  snapshot72.png
 snapshot11.png  snapshot27.png  snapshot42.png  snapshot58.png  snapshot73.png
 snapshot12.png  snapshot28.png  snapshot43.png  snapshot59.png  snapshot74.png
 snapshot13.png  snapshot29.png  snapshot44.png  snapshot6.png   snapshot75.png
 snapshot14.png  snapshot3.png   snapshot45.png  snapshot60.png  snapshot76.png
 snapshot15.png  snapshot30.png  snapshot46.png  snapshot61.png  snapshot77.png
 snapshot16.png  snapshot31.png  snapshot47.png  snapshot62.png  snapshot78.png
 snapshot17.png  snapshot32.png  snapshot48.png  snapshot63.png  snapshot79.png
 snapshot18.png  snapshot33.png  snapshot49.png  snapshot64.png  snapshot8.png
 snapshot19.png  snapshot34.png  snapshot5.png   snapshot65.png  snapshot80.png
 snapshot2.png   snapshot35.png  snapshot50.png  snapshot66.png  snapshot81.png
 snapshot20.png  snapshot36.png  snapshot51.png  snapshot67.png  snapshot82.png
 snapshot21.png  snapshot37.png  snapshot52.png  snapshot68.png  snapshot83.png
 snapshot22.png  snapshot38.png  snapshot53.png  snapshot69.png  snapshot9.png
 snapshot23.png  snapshot39.png  snapshot54.png  snapshot7.png
 snapshot24.png  snapshot4.png   snapshot55.png  snapshot70.png
```

First, to add a \"0\" (zero) before snapshots 1 through 9, write a for
loop (in effect, a short shell script).

-   Use `?` which is a filename pattern for a single character. Using
    it, I can match snapshots 1 through 9 but miss 10 through 83 by
    saying `snapshot?.png`.
-   Use `${`*parameter*`#`*pattern*`}` to substitute the value of
    *parameter* with the *pattern* removed from the beginning. This is
    to get rid of \"snapshot\" so I can put in \"snapshot0\".
-   Before actually running the loop, insert an \"echo\" to test that
    the commands will be correct.

``` console
 $ for i in snapshot?.png; do echo mv "$i" "snapshot0${i#snapshot}"; done
 mv snapshot1.png snapshot01.png
 mv snapshot2.png snapshot02.png
 mv snapshot3.png snapshot03.png
 mv snapshot4.png snapshot04.png
 mv snapshot5.png snapshot05.png
 mv snapshot6.png snapshot06.png
 mv snapshot7.png snapshot07.png
 mv snapshot8.png snapshot08.png
 mv snapshot9.png snapshot09.png
```

That seems good, so run it by removing the \"echo\".

``` console
 $ for i in snapshot?.png; do mv "$i" "snapshot0${i#snapshot}"; done
```

An ls confirms that this was effective.

Now change prefix \"snapshot\" to \"nethack-kernigh-22oct2005-\". Run a
loop similar to the previous one:

``` console
 $ for i in snapshot*.png; do \
 > mv "$i" "nethack-kernigh-22oct2005-${i#snapshot}" \
 > done
```

This saves the user from typing 83 \"mv\" commands.

## Long command line options

The builtin `getopts` does not support long options so the external
`getopt` is required. (On some systems, `getopt` *also* does not support
long options, so the next example will not work.)

``` shell
eval set -- $(getopt -l install-opts: "" "$@")
while true; do
    case "$1" in
        --install-opts)
            INSTALL_OPTS=$2
            shift 2
            ;;
        --)
            shift
            break
            ;;
    esac
done

echo $INSTALL_OPTS
```

The call to `getopt` quotes and reorders the command line arguments
found in `$@`. `set` then makes replaces `$@` with the output from
`getopt`

Another example of getopt use can also be found in the Advanced Bash
Script Guide

## Process certain files through xargs

In this recipe, we want to process a large list of files, but we must
run one command for each file. In this example, we want to convert the
sampling rates of some sound files to 44100 hertz. The command is
**`sox file.ogg -r 44100 conv/file.ogg`**, which converts `file.ogg` to
a new file `conv/file.ogg`. We also want to skip files that are already
44100 hertz.

First, we need the sampling rates of our files. One way is to use the
**`file`** command:

``` console
 $ file *.ogg
 audio_on.ogg:            Ogg data, Vorbis audio, mono, 44100 Hz, ~80000 bps
 beep_1.ogg:              Ogg data, Vorbis audio, stereo, 44100 Hz, ~193603 bps
 cannon_1.ogg:            Ogg data, Vorbis audio, mono, 48000 Hz, ~96000 bps
 ...
```

(The files in this example are from Secret Maryo
Chronicles.) We can use **`grep -v`** to
filter out all lines that contain \'44100 Hz\':

``` console
 $ file *.ogg | grep -v '44100 Hz'
 cannon_1.ogg:            Ogg data, Vorbis audio, mono, 48000 Hz, ~96000 bps
 ...
 jump_small.ogg:          Ogg data, Vorbis audio, mono, 8000 Hz, ~22400 bps
 live_up.ogg:             Ogg data, Vorbis audio, mono, 22050 Hz, ~40222 bps
 ...
```

We finished with \"grep\" and \"file\", so now we want to remove the
other info and leave only the filenames to pass to \"sox\". We use the
text utility **`cut`**. The option **`-d:`** divides each line into
fields at the colon; **`-f1`** selects the first field.

``` console
 $ file *.ogg | grep -v '44100 Hz' | cut -d: -f1
 cannon_1.ogg
 ...
 jump_small.ogg
 live_up.ogg
 ...
```

We can use another pipe to supply the filenames on the standard input,
but \"sox\" expects them as arguments. We use **`xargs`**, which will
run a command repeatedly using arguments from the standard input. The
**`-n1`** option specifies one argument per command. For example, we can
run **`echo sox`** repeatedly:

``` console
 $ file *.ogg | grep -v '44100 Hz' | cut -d: -f1 | xargs -n1 echo sox
 sox cannon_1.ogg
 ...
 sox itembox_set.ogg
 sox jump_small.ogg
 ...
```

However, these commands are wrong. The full command for cannon_1.ogg,
for example, is **`sox cannon_1.ogg -r 44100 conv/cannon_1.ogg`**.
\"xargs\" will insert incoming data into placeholders indicated by
\"{}\". We use this strategy in our pipeline. If we have doubt, then
first we can build a test pipeline with \"echo\":

``` console
 $ file *.ogg | grep -v '44100 Hz' | cut -d: -f1 | \
 > xargs -i 'echo sox {} -r 44100 conv/{}'
 sox cannon_1.ogg -r 44100 conv/cannon_1.ogg
 ...
 sox itembox_set.ogg -r 44100 conv/itembox_set.ogg
 sox jump_small.ogg -r 44100 conv/jump_small.ogg
 ...
```

It worked, so let us remove the \"echo\" and run the \"sox\" commands:

``` console
 $ mkdir conv
 $ file *.ogg | grep -v '44100 Hz' | cut -d: -f1 | \
 > xargs -i 'sox {} -r 44100 conv/{}'
```

After a wait, the converted files appear in the `conv` subdirectory. The
above three lines alone did the entire conversion.

## Simple playlist frontend for GStreamer

If you have GStreamer, the command
`gst-launch filesrc location=`*`filename`*` ! decodebin ! audioconvert ! esdsink`
will play a sound or music file of any format for which you have a
GStreamer plugin. This script will play through a list of files,
optionally looping through them. (Replace \"esdsink\" with your favorite
sink.)

``` {.shell .numberLines}
#!/bin/sh
loop=false
if test x"$1" == x-l; then
  loop=true
  shift
fi

while true; do
  for i in "$@"; do
    if test -f "$i"; then
      echo "${0##*/}: playing $i" > /dev/stderr
      gst-launch filesrc location="$i" ! decodebin ! audioconvert ! esdsink
    else
      echo "${0##*/}: not a file: $i" > /dev/stderr
    fi
  done
  if $loop; then true; else break; fi
done
```

This script demonstrates some common Bourne shell tactics:

-   \"loop\" is a boolean variable. It works because its values \"true\"
    and \"false\" are both Unix commands (and sometimes shell builtins),
    thus you can use them as conditions in `if` and `while` statements.
-   The shell builtin \"shift\" removes \$1 from the argument list, thus
    shifting \$2 to \$1, \$3 to \$2, and so forward. This script uses it
    to process an \"-l\" option.
-   The substitution `${0##*/}` gives everything in \$0 after the last
    slash, thus \"playlist\", not \"/home/musicfan/bin/playlist\".