<< Chapter < Page Chapter >> Page >
A square wave and its spectrum, as calculated by using plotspec.m
A square wave and its spectrum, as calculated by using plotspec.m.

Use specsquare.m to investigate the relationship between the time behavior of the square wave and its spectrum.The M atlab command zoom on is often helpful for viewing details of the plots.

  1. Try square waves with different frequencies: f=20, 40, 100, 300 Hz. How do the time plots change? How do the spectra change?
  2. Try square waves of different lengths, time=1, 10, 100 seconds. How does the spectrum change in each case?
  3. Try different sampling times, Ts=1/100, 1/10000 . seconds. How does the spectrum change in each case?

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

  1. an exponential pulse s ( t ) = e - t for 0 < t < 10 ,
  2. a scaled exponential pulse s ( t ) = 5 e - t for 0 < t < 10 ,
  3. a Gaussian pulse s ( t ) = e - t 2 for - 2 < t < 2 ,
  4. a Gaussian pulse s ( t ) = e - t 2 for - 20 < t < 20 ,
  5. the sinusoids s ( t ) = sin ( 2 π f t + Φ ) for f = 20 , 100, 1000, with Φ = 0 , π / 4 , π / 2 , and 0 < t < 10 .
A noise signal and its spectrum, as calculated using plotspec.m
A noise signal and its spectrum, as calculated using plotspec.m.

M atlab has several commands that create random numbers:

  1. 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 .
  2. 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.
  3. Use randn to create a signal that is normally distributed with mean 0 and variance 3. Find the spectrum of the signal.

Modify the code in plotspec.m to also plot the phase spectrum.

  1. Plot the phase spectrum of a sine wave and a cosine wave, both of the same frequency. How do they differ?
  2. Plot the phase spectrum of the random signal created in [link] (a).

While plotspec.m can be quite useful, ultimately, it will be necessary to have more flexibility,which, in turn, requires one to understand how the FFT function inside plotspec.m works. This will be discussed at length in  [link] . The next six sections describe the six elementsthat are at the heart of communications systems. The elements are described in both the time domain and in thefrequency 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 calledan oscillator . An electronic oscillator is a device thatproduces a repetitive electronic signal, usually a sinusoidal wave.

A basic oscillator is diagrammed in [link] . Oscillators are typically designed to operate at a specified frequency f 0 , and the input specifies the phase Φ ( t ) of the output

s ( t ) = cos ( 2 π f 0 t + Φ ( t ) ) .

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 f 0 . For instance, suppose the phase is a “ramp” or line with slope 2 π c ; that is, Φ ( t ) = 2 π c t . Then s ( t ) = cos ( 2 π f 0 t + 2 π c t ) = cos ( 2 π ( f 0 + c ) t ) , and the “actual” frequency of oscillation is f 0 + c .

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Software receiver design. OpenStax CNX. Aug 13, 2013 Download for free at http://cnx.org/content/col11510/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Software receiver design' conversation and receive update notifications?

Ask