magnitude spectrum shows the frequency content of the output signal

FIGURE 3.1: The element transforms the input signal x into the output signal y. The action of an element can be thought of in terms of its effect on the signals in time, or (via the Fourier transform) in terms of its effect on the spectra of the signals.

Readers who have studied signal and systems (often required in electrical engineering degrees), will recognize that the time domain representation of a signal and its frequency domain representation are related by the Fourier transform, which is briefly reviewed in the next section.

3.1 FINDING THE SPECTRUM OF A SIGNAL

A signal s(t) can often be expressed in analytical form as a function of time t, and the Fourier transform is defined as in (2.1) as the integral of s(t)e~2Trjft. The resulting transform S(f) is a function of frequency. S(f) is called the spectrum of the signal s(t) and describes the frequencies present in the signal. For example, if the time signal is created as a sum of three sine waves, then the spectrum will have spikes corresponding to each of the constituent sines. If the time signal contains only frequencies between 100 and 200 Hz, then the spectrum will be zero for all frequencies outside of this range. A brief guide to Fourier transforms appears in Appendix D, and a summary of all the transforms and properties that are used throughout Telecommunication Breakdown appears in Appendix A.

Often however, there is no analytical expression for a signal, that is, there is no (known) equation that represents the value of the signal over time. Instead, the signal is defined by measurements of some physical process. For instance, the signal might be the waveform at the input to the receiver, the output of a linear filter, or a sound waveform encoded as an mp3 file. In all these cases, it is not possible to find the spectrum by calculating a Fourier transform.

Rather, the discrete Fourier transform (and its cousin, the more rapidly computable fast Fourier transform, or FFT) can be used to find the spectrum or frequency content of a measured signal. The Matlab function plotspec.m, which plots the spectrum of a signal, is available on the CD. Its help file1 notes:

'/, plotspec(x,Ts) plots the spectrum of the signal x '/, Ts = time (in seconds) between adjacent samples in x

The function plotspec.m is easy to use. For instance, the spectrum of a square wave can be found using:

specsquare.m: plot the spectrum of a square wave f=10;

time=2;

Ts=l/1000;

plotspec(x,Ts)

"/« "frequency" of square wave

"/, time interval between samples

"/, create a time vector

"/« call plotspec to draw spectrum

1You can view the help file for the Matlab function xxx by typing help xxx at the Matlab prompt. If you get an error such as xxx not found, then this means either that the function does not exist, or that it needs to be moved into the same directory as the Matlab application. If you don't know what the proper command to do a job is, then use lookf or. For instance, to find the command that inverts a matrix, type lookfor inverse. You will find the desired command inv.

The output of specsquare.m is shown2 in Figure 3.2. The top plot shows time=2 seconds of a square wave with f=10 cycles per second. The bottom plot shows a series of spikes that define the frequency content. In this case, the largest spike occurs at ±10 Hz, followed by smaller spikes at all the odd-integer multiples (i.e., at ±30, ±50, ±70, etc.).

sscorrfs

1400

1200

1000

I 500

i GOO E

fneqwniy

sscorrfs

fneqwniy

FIGURE 3.2: A square wave and its spectrum, as calculated using plotspec.m. Similarly, the spectrum of a noise signal can be calculated as

FIGURE 3.2: A square wave and its spectrum, as calculated using plotspec.m. Similarly, the spectrum of a noise signal can be calculated as specnoise.m: plot the spectrum of a noise signal time=l; "/, length of time

Ts=l/10000; "/, time interval between samples x=randn(l ,time/Ts) ; "/, Ts points of noise for time seconds plotspec (x ,Ts) "/, call plotspec to draw spectrum

A typical run of specnoise.m is shown in Figure 3.3. The top plot shows the noisy signal as a function of time, while the bottom shows the magnitude spectrum. Because successive values of the noise are generated independently, all frequencies are roughly equal in magnitude. Each run of specnoise.m produces plots that are qualitatively similar, though the details will differ.

PROBLEMS

3.1. Use specquare.m to investigate the relationship between the time behavior of the

2 All code listings in Telecommunication Breakdown can be found on the CD. We encourage you to open Matlab and explore the code as you read.

SSOSftili

360 300 250

glSO E

-5000 -4000 -3000 -SOOO -1000 0 1000 SOOO 3000 4000 5000

fnequency

FIGURE 3.3: A noise signal and its spectrum, as calculated using plotspec.m.

square wave and its spectrum. The Hatlab command zoom on is often helpful for viewing details of the plots.

(a) Try square waves with different frequencies: f=20, 40, 100, 300 Hz. How do the time plots change? How do the spectra change?

(b) Try square waves of different lengths, time=l, 10, 100 seconds. How does the spectrum change in each case?

(c) Try different sampling times, Ts=l/100, 1/10000. seconds. How does the spectrum change in each case?

3.2. In your Signal and Systems course, you probably calculated (analytically) the spectrum of a square wave using the Fourier series. How does this calculation compare to the discrete data version found by specsquare.m?

3.3. Mimic the code in specsquare.m to find the spectrum of

(d) the sinusoids s(t) = sin(27r/t + <j>) for / = 20, 100, 1000 and </> = 0, tt/4, tt/2.

3.4. Hatlab has several commands that create random numbers.

(a) Use rand to create a signal that is uniformly distributed on [—1, 1]. Find the spectrum of the signal by mimicking the code in specnoise.m.

(b) Use rand and the sign function to create a signal that is +1 with probability 1/2 and —1 with probability 1/2. Find the spectrum of the signal.

(c) Use randn to create a signal that is normally distributed with mean 0 and variance 3. Find the spectrum of the signal.

While plotspec.m can be quite useful, ultimately it will be necessary to have

SSOSftili

-5000 -4000 -3000 -SOOO -1000 0 1000 SOOO 3000 4000 5000

fnequency more flexibility, which in turn requires understanding how the FFT function inside plotspec.m works. This will be discussed at length in Chapter 7. The next five sections describe the five elements that are at the heart of communications systems. The elements are described in both the time domain and in the frequency domain.

THE FIRST ELEMENT: OSCILLATORS

The Latin word oscillare means "to ride in a swing". It is the origin of oscillate, which means to move back and forth in steady unvarying rhythm. Thus, a device that creates a signal that moves back and forth in a steady, unvarying rhythm is called an oscillator. An electronic oscillator is a device that produces a repetitive electronic signal, usually a sinusoidal wave.

FIGURE 3.4: An oscillator creates a sinusoidal oscillation with a specified frequency fo and input <f>.

A basic oscillator is diagrammed in Figure 3.4. Oscillators are typically designed to operate at a specified frequency fo, and the input specifies the phase <f> of the output waveform s(t) = cos(27r/0i + <f>).

The input may be a fixed number, but it may also be a signal, that is, it may change over time. In this case, the output is no longer a pure sinusoid of frequency fo- For instance, suppose the phase is a 'ramp' or line with slope 2irc, that is, <f>(t) = 2irct. Then s(t) = cos(2irfot + 2irct) = cos(27r(/o + c)t), and the 'actual' frequency of oscillation is fo + c.

There are many ways to build oscillators from analog components. Generally, there is an amplifier and a feedback circuit that returns a portion of the amplified wave back to the input. When the feedback is aligned properly in phase, sustained oscillations occur.

Digital oscillators are simpler, since they can be directly calculated; no amplifier or feedback are needed. For example, a 'digital' sine wave of frequency / Hz and a phase of <f> radians can be represented mathematically as s(kTs) = cos(27r/fcTs + <j>) (3.1)

where Ts is the time between samples and where k is an integer counter k = 1,2,3,.... Equation (3.1) can be directly implemented in Matlab:

speccos.m: plot the spectrum of a cosine wave f=10 ; phi=0; time=2; Ts=l/100;

"/« specify frequency and phase

"/, time interval between samples t=Ts:Ts:time; x=cos(2*pi*f*t+phi) plotspec(x,Ts)

"/, create a time vector

"/, create cos wave

"/« draw waveform and spectrum

The output of speccos .m is shown in Figure 3.5. As expected, the time plot shows an undulating sinusoidal signal with / = 10 repetitions in each second. The actual data is discrete, with one hundred data points in each second. Do not be fooled by the default method of plotting where Matlab 'connects the dots' with short line segments for a smoother appearance. The spectrum shows two spikes, one at / = 10 Hz and one at / = —10 Hz. Why are there two spikes? Basic Fourier theory shows that the Fourier transform of a cosine wave is a pair of delta functions at plus and minus the frequency of the cosine wave (see Appendix (A.18)). The two spikes of Figure 3.5 mirror these two delta functions. Alternatively, recall that a cosine wave can be written using Euler's formula as the sum of two complex exponentials, as in (A.2). The spikes of Figure 3.5 represent the magnitudes of these two (complex valued) exponentials.

*

\ A i " A

/ M ? A '

1 1 1 J I Ü

1

1 1 1

1 ! ft ft

II -II

1 1 1 1 1 1 1 1 1 1

Nil

y

[I'll l! j U.

'i r M . "j b'

'J ll 'J.'J u

»conch

»conch

40 50

FIGURE 3.5: A sinusoidal oscillator creates a signal that can be viewed in the time domain as in the top plot, or in the frequency domain as in the bottom plot.

-10 0 10 frequency

40 50

FIGURE 3.5: A sinusoidal oscillator creates a signal that can be viewed in the time domain as in the top plot, or in the frequency domain as in the bottom plot.

PROBLEMS

3.5. Mimic the code in speccos.m to find the spectrum of a cosine wave:

(b) for different phases </> = 0, 0.1, 7r/8, it¡2 radians.

(c) for different sampling rates Ts=l/10, 1/1000, 1/100000.

3.6. Let xi(t) be a cosine wave of frequency / = 10, £2(0 be a cosine wave of frequency / = 18, and X3(t) be a cosine wave of frequency / = 33. Let x(t) = x\(t) + 0.5 * X'j(i) + 2*X3(t). Find the spectrum of x(t). What property of the Fourier transform does this illustrate?

3.7. Find the spectrum of a cosine wave when

(b) </> is a function of time. Try <f>{t) = 7rt2.

THE SECOND ELEMENT: LINEAR FILTERS

Linear filters shape the spectrum of a signal. If the signal has too much energy in the low frequencies, a highpass filter can remove them. If the signal has too much high frequency noise, a low pass filter can reject it. If a signal of interest resides only between /* and f*, then a bandpass filter tuned to pass frequencies between /* and f* can remove out-of-band interferences and noises. More generally, suppose that a signal has frequency bands in which the magnitude of the spectrum is lower than desired and other bands in which the magnitude is greater than desired. Then a linear filter can compensate by increasing and/or decreasing the magnitude as needed. This section provides an overview of how to implement simple filters in Matlab. More thorough treatments of the theory, design, use, and implementation of filters are given in Chapter 7.

While the calculations of a linear filter are usually carried out in the time domain, filters are often specified in the frequency domain. Indeed, the words used to specify filters (such as low pass, high pass, and band pass) describe how the filter acts on the frequency content of its input. Figure 3.6, for instance, shows a noisy input entering three different filters. The frequency response of the LPF shows that it allows low frequencies (those below the cutoff frequency /*) to pass, while removing all frequencies above the cutoff. Similarly, the HPF passes all the high frequencies and rejects those below its cutoff f*. The action of the BPF is specified by two frequencies. It will remove all frequencies below /* and remove all frequencies above /*, leaving only the region between.

Figure 3.6 shows the action of ideal filters. How close are actual implementations? The Matlab code in filternoise.m shows that it is possible to create digital filters that reliably and accurately carry out these tasks.

filternoise.m: filter a noisy signal three ways time=3; "/, length of time

Ts=l/10000; "/, time interval between samples x=randn(l ,time/Ts) ; "/, generate noise signal f igure (1) ,plotspec (x ,Ts) "/, draw spectrum of input b=remez (100, [0 0.2 0.21 1] , [1 1 0 0]); '/. specify the LP filter ylp=filter(b, 1 ,x) ; "/, do the filtering figure (2) ,plotspec (yip ,Ts) "/, plot the output spectrum b=remez (100, [0 0.24 0.26 0.5 0.51 1] , [0 0 1 1 0 0]); '/„BP filter

FIGURE 3.6: A 'white' signal containing all frequencies is passed through a low pass filter (LPF) leaving only the low frequencies, a band pass filter (BPF) leaving only the middle frequencies and a high pass filter (HPF) leaving only the high frequencies.

ybp=filter(b, 1 ,x) ; "/, do the filtering figure (3) ,plotspec (ybp ,Ts) "/, plot the output spectrum b=remez (100 , [0 0 . 74 0 . 76 1] , [0 0 1 1] ) ; '/. specify the HP filter yhp=filter(b, 1 ,x) ; "/, do the filtering figure (4) ,plotspec (yhp ,Ts) "/, plot the output spectrum

The output of f ilternoise .m is shown in Figure 3.7. Observe that the spectra at the output of the filters are close approximations to the ideals shown in Figure 3.6. There are some differences, however. While the idealized spectra are completely flat in the pass band, the actual ones are rippled. While the idealized spectra completely reject the out.-of-band frequencies, the actual ones have small (but nonzero) energy at all frequencies.

Two new Matlab commands are used in f ilternoise .m. The remez command specifies the contour of the filter as a line graph. For instance, typing plot( [0 0.24 0.26 0.5 0.51 1], [0 0 1 1 0 0])

at the Matlab prompt draws a box that represents the action of the BPF designed in f ilternoise .m (over the positive frequencies). The frequencies are specified as percentages of /nyq = which in this case is equal to 5000 Hz (/nyq is discussed further in the next section.) Thus the BPF in filternoise.m passes frequencies between 0.26x5000 Hz to 0.5x5000 Hz, and rejects all others. The filter command uses the output of remez to carry out the filtering operation on the vector specified in its third argument. More details about these commands are given in the section on practical filtering in Chapter 7.

PROBLEMS

3.8. Mimic the code in f ilternoise .m to create a filter that: (a) passes all frequencies above 500 Hz.

-50M -4000 -3000 -2000 -1000 0 1000 2000 3000 WO

ßfln | | | mon-^iHi ifia «ruaHnimart^"^' rt ^ ^ ^

-50M -4000 -3000 -2000 -1000 0 1000 2000 3000 WO

ßfln | | | mon-^iHi ifia «ruaHnimart^"^' rt ^ ^ ^

5000

iilffrp Wrl™

UUti^ittiiHUiiMMidMMih

1000 2000 3Q00 -1000 5000

iJMJ

-5000 -4W0 -3W0 - 2000 -1000 0 1000 2000 3000 4000 5000

-5000 -4W0 -3W0 - 2000 -1000 0 1000 2000 3000 4000 5000

-5000 -4000 -SOW -2000 -1000 0 1000 2000 3000 40C0 5000 majjiilude spertnim at raitiwt <?f high pass filler

FIGURE 3.7: The spectrum of a 'white' signal containing all frequencies is shown in the top figure. This is passed through three filters: a low pass, a band pass, and a high pass. The spectra at the outputs of these three filters are shown in the second, third, and bottom plots. The 'actual' filters behave much like their idealized counterparts in Figure 3.6.

-5000 -4000 -SOW -2000 -1000 0 1000 2000 3000 40C0 5000 majjiilude spertnim at raitiwt <?f high pass filler

FIGURE 3.7: The spectrum of a 'white' signal containing all frequencies is shown in the top figure. This is passed through three filters: a low pass, a band pass, and a high pass. The spectra at the outputs of these three filters are shown in the second, third, and bottom plots. The 'actual' filters behave much like their idealized counterparts in Figure 3.6.

(b) passes all frequencies below 3000 Hz.

(c) rejects all frequencies between 1500 and 2500 Hz.

3.9. Change the sampling rate to Ts=l/20000. Redesign the three filters from Problem 3.8.

3.10. Let xi (t) be a cosine wave of frequency / = 800, £2(0 be a cosine wave of frequency / = 2000, and X3(t) be a cosine wave of frequency / = 4500. Let x(t) = x\(t) + 0.5*X2(t) + 2*X3(t). Use x(t) as input to each of the three filters in f ilternoise .m. Plot the spectra, and explain what you see.

THE THIRD ELEMENT: SAMPLERS

Since part of any digital transmission system is analog (transmissions through the air, across a cable, or along a wire, are inherently analog), and part of the system is digital, there must be a way to translate the continuous time signal into a discrete time signal and vice versa. The process of sampling an analog signal, sometimes called analog to digital conversion, is easy to visualize in the time domain. Figure 3.8 shows how sampling can be viewed as the process of evaluating a continuous-time signal at a sequence of uniformly spaced time intervals, thus transforming the analog signal x(t) into the discrete-time signal x(kTs).

One of the key ideas in signals and systems is the Fourier series: a signal is periodic in time (it repeats every P seconds), if and only if the spectrum can be written as a sum of complex sinusoids with frequencies at integer multiples of a fundamental frequency /. Moreover, this fundamental frequency can be written in terms of the period as / = 1 /P. Thus, if a signal repeats 100 times every second (P = 0.01 seconds), then its spectrum consists of a sum of sinusoids with frequencies 100, 200, 300, .. . Hz. Conversely, if a spectrum is built from a sum of sinusoids with frequencies 100,200,300,... Hz, then it must represent a periodic signal in time that has period P = 0.01. Said another way, the nonzero portions of the spectrum are uniformly spaced / = 100 Hz apart. This uniform spacing can be interpreted as a sampling (in frequency) of an underlying continuous valued spectrum. This is illustrated in the top portion of Figure 3.9, which shows the time domain representation on the left and the corresponding frequency domain representation on the right.

The basic insight from Fourier series is that any signal which is periodic in time can be re-expressed as a collection of uniformly spaced spikes in frequency, that is,

Periodic in Time O Uniform Sampling in Frequency.

The same arguments show the basic result of sampling, which is that

Uniform Sampling in Time O Periodic in Frequency.

Thus, whenever a signal is uniformly sampled in time (say with sampling interval Ts seconds), the spectrum will be periodic, that is, it will repeat every fs = 1 /Ts Hz.

Two conventions are often observed when drawing periodic spectra that arise from sampling. First, the spectrum is usually drawn centered at 0 Hz. Thus, if

FIGURE 3.8: The sampling process is shown in (b) as an evaluation of the signal x(t) at times .... —2Ts, Ts, 0, Ts,!2TS, .... This procedure is schematized in (a) as an element that has the continuous-time signal x(t) as input and the discrete-time signal x(kTs) as output.

f^OfitS WÄmi MMffr^ mbtfMrKy

44I H Y

f. SVf Sf fSwcier Haiisfemi -^

SamplftJ « period* ti

FIGURE 3.9: Fourier's result says that any signal that is periodic in time has a spectrum that consists of a collection of spikes uniformly spaced in frequency. Analogously, any signal whose spectrum is periodic in frequency can be represented in time as a collection of spikes uniformly spaced in time, and vice versa.

the period of repetition is fs, this is drawn from —/„/2 to /„/2, rather than from 0 to fs. This makes sense because the spectrum of individual sinusoidal components contain two spikes symmetrically located around 0 Hz (as we saw in Section 3.2). Accordingly, the highest frequency that can be represented unambiguously is /„/2, and this frequency is often called the Nyqmst frequency /nyq•

The second convention is to draw only one period of the spectrum. After all, the others are identical copies that contain no new information. This is evident in the bottom right hand of Figure 3.9 where the spectrum between — 3/„/2 and —fs/2 is the same as the spectrum between /„/2 and 3/s/2. In fact, we have been observing this convention throughout sections 3.2 and 3.3, since all of the figures of spectra (Figures 3.2, 3.3, 3.5, and 3.7) show just one period of the complete spectrum.

Perhaps you noticed that plotspec.m changes the frequency axis when the sampling interval Ts is changed? (If not, go back and redo Problem 3.3.) By the second convention, plotspec.m shows exactly one period of the complete spectrum. By the first convention, the plots are labelled from — fnyq to /nyq-

What happens when the frequency of the signal is too high for the sampling rate? The representation becomes ambiguous. This is called aliasing, and is investigated by simulation in the problems below. Aliasing and other sampling related issues (such as reconstructing an analog signal from its samples) are covered in more depth in Chapter 6.

Closely related to the digital sampling of an analog signal is the (digital) downsampling of a digital signal, which changes the rate at which the signal is represented. The simplest case downsamples by a factor of 2, removing every other sample from a signal. This is written y[k] = x[2k], and is commonly drawn in block form as in Figure 3.10. If the spectrum of x[k] is bandlimited to one quarter of the Nyquist rate, then downsampling by 2 loses no information. Otherwise, aliasing occurs. Like analog to digital sampling, down-sampling is a time varying operation.

ylkj

*

FIGURE 3.10: The discrete signal x[k] is downsampled by a factor of 2 by removing every other sample.

PROBLEMS

3.11. Mimicking the code in speccos.m with the sampling interval Ts=l/100, find the spectrum of a cosine wave cos(2n ft) when f=30, 40, 49, 50, 51, 60 Hz. Which of these show aliasing?

3.12. Create a cosine wave with frequency 50 Hz. Plot the spectrum when this wave is sampled at Ts=l/50, 1/90, 1/100, 1/110, and 1/200. Which of these show aliasing?

3.13. Mimic the code in speccos.m (with sampling interval Ts=l/100) to find the spectrum of a square wave with fundamental f=10, 20, 30, 33, 43 Hz. Can you predict where the spikes will occur in each case? Which of the square waves show aliasing?

3.5 THE FOURTH ELEMENT: STATIC NONLINEARITIES

Linear functions such as filters cannot add new frequencies to a signal (though they can remove unwanted frequencies). Even simple nonlinearities such as squaring and multiplying can and will add new frequencies. These can be useful in the communication system in a variety of ways.

Perhaps the simplest nonlinearity is the square, which takes its input at each time instant and multiplies it by itself. Suppose the input is a sinusoid at frequency /, that is, x(t) = cos(27rft). Then the output is the sinusoid squared, which can be rewritten using the cosine-cosine product (A.4) as y(t) = x2(t) = cos2(2 it ft) = ^ + icos(27r(2/)i).

The spectrum of y(t) has a spike at 0 Hz due to the constant, and a spike at ±2/ Hz from the double frequency term. Unfortunately, the action of a squaring element is not always as simple as this example might suggest. The following exercises encourage you to explore the kinds of changes that occur in the spectra when using a variety of simple nonlinear elements.

PROBLEMS

3.14. Mimic the code in speccos.m with Ts=l/1000 to find the spectrum of the output y(t) of a squaring block when the input is

(b) x(t) = cos(27r/it) + cos(2ttf2t) for fi = 100 and f2 = 150 Hz.

(c) a filtered noise sequence with nonzero spectrum between fi = 100 and f2 = 300 Hz. Hint: generate the input by modifying f ilternoise .m.

(d) Can you explain the large DC (zero frequency) component?

3.15. Try different values of fi and f2 in Problem 3.14. Can you predict what frequencies will occur in the output. When is aliasing an issue?

3.16. Repeat Problem 3.15 when the input is a sum of three sinusoids.

3.17. Suppose that the output of a nonlinear block is y(t) = g(x(t)) where o(t) ~ f 1 X{t) > ° 9(t> ~ \ -1 x(t) < 0

is a quantizer that outputs positive one when the input is positive and outputs minus one when the input is negative. Find the spectrum of the output when the input is

(b) x(t) = cos(27r/it) + cos(27r/2t) for fi = 100 and f2 = 150 Hz.

3.18. Suppose that the output of a nonlinear block with input x(t) is y(t) = x2(t). Find the spectrum of the output when the input is

(a) x(t) = cos(2ttft + 4>) for / = 100 Hz and 4> = 0.5.

(b) x(t) = cos(27r/it) + cos(27r/2t) for fi = 100 and f2 = 150 Hz.

(c) x(t) = cos(27r/it + </>) + n(t) where fi = 100, = 0.5, and where n(t) is a white noise.

3.19. The Hatlab function quantalph.m (available on the CD) quantizes a signal to the nearest element of a desired set. Its help file reads

"/« function y=quantalph(x,alphabet) "/« quantize the input signal x to the alphabet "/, using nearest neighbor method "/« input x - vector to be quantized

"/« alphabet - vector of discrete values that y can take on

"/, sorted in ascending order

"/« output y - quantized vector

Let x be a random vector x=randn(l,n) of length n. Quantize x to the nearest [-3,-1,1,3],

(a) What percentage of the outputs are l's? 3's?

(b) Plot the magnitude spectrum of x and the magnitude spectrum of the output.

(c) Now let x=3*randn(l ,n) and answer the same questions.

One of the most useful nonlinearities is multiplication by a cosine wave. As shown in Chapter 2, such modulation blocks can be used to change the frequency of a signal. The following Matlab code implements a simple modulation nonlinearity.

modulate.m: change the frequency of the input time=.5; Ts=l/10000; t=Ts:Ts:time;

fc=1000; cmod=cos(2*pi*fc*t); fi=100; x=cos(2*pi*fi*t); y=cmod.*x;

figure(l), plotspec(cmod,Ts) figure(2), plotspec(x,Ts) figure(3), plotspec(y,Ts)

"/, total time and sampling interval

"/, create cos of freq fc

"/« multiply input by cmod

"/« find spectra and plot

The first four lines of the code create the modulating sinusoid (i.e., an oscillator). The next line specifies the input (in this case another cosine wave). The Matlab syntax . * calculates a point-by-point. multiplication of the two vectors cmod and x. The output of modulate.m is shown in Figure 3.11. The spectrum of the input contains spikes representing the input sinusoid at ±100 Hz and the spectrum of the modulating sinusoid contains spikes at ±1000 Hz. As expected from the modulation property of the transform, the output contains sinusoids at ±1000 ± 100 Hz, which appear in the spectrum as the two pairs of spikes at ±900 and ±1100 Hz. Of course, this modulation can be applied to any signal, not just to an input sinusoid. In all cases, the output will contain two copies of the input, one shifted up in frequency and the other shifted down in frequency.

2000-1000-

-5000 -4000 -3000 -2000 -1000 O 1000 2000 3000 4000 HMO

-5000 -4000 -3000 - 2000 -1000 O 1000 2000 3000 4000 6000

-5000 -4000 -3000 -2000 -1000 0 UK*» 2000 3000 4000 5000 mflflninifc spwlwm ¡it output ma^illude spectrum at input

magnllnas spailium at lbs oscillator

-5000 -4000 -3000 - 2000 -1000 O 1000 2000 3000 4000 6000

magnllnas spailium at lbs oscillator

-5000 -4000 -3000 -2000 -1000 0 UK*» 2000 3000 4000 5000 mflflninifc spwlwm ¡it output

FIGURE 3.11: The spectrum of the input sinusoid is shown in the top figure. The middle figure shows the modulating wave. The bottom shows the spectrum of the point-by-point multiplication (in time) of the two.

FIGURE 3.11: The spectrum of the input sinusoid is shown in the top figure. The middle figure shows the modulating wave. The bottom shows the spectrum of the point-by-point multiplication (in time) of the two.

PROBLEMS

3.20. Mimic the code in modulate.m to find the spectrum of the output y(t) of a modulator block (with modulation frequency fc = 1000 Hz) when

(a) the input is x(t) = cos(27r/it) + cos(27r/2Î) for fi = 100 and /2 = 150 Hz.

(b) the input is a square wave with fundamental / = 150 Hz.

(c) the input is a noise signal with all energy below 300 Hz.

(d) the input is a noise signal bandlimited to between 2000 and 2300 Hz.

(e) the input is a noise signal with all energy below 1500 Hz.

3.6 THE FIFTH ELEMENT: ADAPTATION

Adaptation is a primitive form of learning. The adaptive elements of a communication system find approximate values of unknown parameters. A common strategy is to guess a value, to assess how good the guess is, and to then refine the estimate. Over time, the guesses (hopefully) converge to a useful estimate of the unknown value.

Figure 3.12 shows an adaptive element containing two parts. The adaptive subsystem parameterized by a changes the input into the output. The quality assessment mechanism monitors the output (and other relevant signals) and tries to determine whether a should be increased or decreased. The arrow through the system indicates that the a value is then adjusted accordingly.

FIGURE 3.12: The adaptive element is a subsystem that transforms the input into the output (parameterized by a) and a quality assessment mechanism that evaluates how to alter a, in this case, whether to increase or decrease a.

Adaptive elements occur in a number of places in the communication system, including

• In an automatic gain control, the 'adaptive subsystem' is multiplication by a constant a. The quality assessment mechanism gauges whether the power at the output of the AGC is too large or too small, and adjusts a accordingly.

• In a phase locked loop, the 'adaptive subsystem' contains a sinusoid with an unknown phase shift a. The quality assessment mechanism adjusts a to maximize a filtered version of the product of the sinusoid and its input.

• In a timing recovery setting, the 'adaptive subsystem' is a fractional delay given by a. The quality assessment mechanism monitors the power of the output, and adjusts a to maximize this power.

• In an equalizer, the 'adaptive subsystem' is a linear filter parameterized by a set of a's. The quality assessment mechanism monitors the deviation of the output of the system from a target set and adapts the a's accordingly.

Chapter 6 provides an introduction to adaptive elements in communication systems, and a detailed discussion of their implementation is postponed until then.

3.7 SUMMARY

The bewildering array of blocks and acronyms in a typical communications system diagram really consists of just a handful of simple elements: oscillators, linear filters, static nonlinearities, samplers, and adaptive elements. For the most part, these are ideas that the reader will have encountered to some degree in previous studies, but they have been summarized here in order to present them in the same form and using the same notation as in later chapters. In addition, this chapter has emphasized the "how-to" aspects by providing a series of Matlab exercises, which will be useful when creating simulations of the various parts of a receiver.

3.8 FOR FURTHER READING

The intellectual background of the material presented here is often called Signals and Systems. One of the most accessible books is

• J. H. McClellan, R. W. Schafer, and M. A. Yoder, DSP First: A Multimedia Approach Prentice Hall, 1998.

Other books provide greater depth and detail about the theory and uses of Fourier transforms. We recommend these as both background and supplementary reading:

• A. V. Oppenheim, A. S. Willsky, and S.H. Nawab, Signals and Systems, Second Edition, Prentice-Hall, 1997.

• F. J. Taylor, Signals and Systems, McGraw-Hill, Inc., NY 1994.

• S. Haykin and B. Van Veen, Signals and Systems, Wiley 2002.

There are also many wonderful new books about digital signal processing, and these provide both depth and detail about basic issues such as sampling and filter design. Some of the best are:

• A. V. Oppenheim, R. W. Schafer, and J. R. Buck, Discrete-Time Signal Processing, Prentice-Hall, 1999.

• B. Porat, A Course in Digital Signal Processing, Wiley 1997.

• S. Mitra, Digital Signal Processing: A Computer Based Approach, McGraw-Hill, 1998.

Finally, since Matlab is fundamental to our presentation it is worth mentioning some books that describe the uses (and abuses) of the Matlab language. Some are:

• V. Stonick and K. Bradley, Labs for Signals and Systems using Matlab, PWS Publishing, 1996.

• D. Hanselman and B. Littlefield, Understanding Matlab 6, Prentice Hall, 2001.

• C. S. Burrus, J. H. McClellan, A. V. Oppenheim, T. W. Parks, R. W. Schäfer, H. W. Schessler, Computer-Based Exercises for Signal Processing using Matlab, Prentice Hall, 1994.

The idealized system layer

The next layer encompasses Chapters 4 through 9. This gives a closer look at the idealized receiver - how things work when everything is just right: when the timing is known, when the clocks run at exactly the right speed, when there are no reflections, diffractions, or diffusions of the electromagnetic waves. This layer also introduces a few Matlab tools that are needed to implement the digital radio. The order in which topics are discussed is precisely the order in which they appear in the receiver:

frequency channel translation sampling frequency

Chapter 4 , _ Chapter 6 translation

Chapter 5

filtering e<luallzatlon devlce ^decoding reconstmcted

Chapter 7 Chapter 8

message channel: impairments and linear systems Chapter 4 frequency translation: amplitude modulation and IF Chapter 5

sampling and automatic gain control Chapter 6

receive filtering: digital filtering Chapter 7

symbols to bits to signals Chapter 8

Chapter 9 provides a complete (though idealized) software-defined digital radio system.

0 0

Post a comment

  • Receive news updates via email from this site