<< Chapter < Page | Chapter >> Page > |
There are many ways to build oscillators from analog components. Generally, there is an amplifier and a feedback circuit thatreturns a portion of the amplified wave back to the input. When the feedback is aligned properly in phase, sustained oscillationsoccur.
Digital oscillators are simpler, since they can be directly calculated; no amplifier or feedbackare needed. For example, a “digital” sine wave of frequency Hz and a phase of radians can be represented mathematically as
where is the time between samples and where is an integer counter . [link] can be directly implemented in M atlab :
f=10; phi=0; % specify frequency and phase
time=2; % length of timeTs=1/100; % time interval between samples
t=Ts:Ts:time; % create a time vectorx=cos(2*pi*f*t+phi); % create cos wave
plotspec(x,Ts) % draw waveform and spectrum
speccos.m
plot the spectrum of a cosine wave
(download file)
The output of
speccos.m
is shown in
[link] .
As expected, the time plot shows an undulating sinusoidal signalwith
repetitions in each second.
The spectrum shows two spikes,one at
Hz and one at
Hz. Why are there
two spikes?
Basic Fourier theory shows thatthe Fourier transform of a cosine wave
is a pair of delta functions at plus and minus the frequency of thecosine wave.
The two spikes of
[link] mirror these
two delta functions. Alternatively, recall thata cosine wave can be written using Euler's formula
as the sum of two complex exponentials, as in
[link] .
The spikes of
[link] represent the
magnitudes of these two (complex valued) exponentials.
Mimic the code in
speccos.m
to find the spectrum of
a cosine wave
f=1, 2, 20, 30
Hz,Ts=1/10, 1/1000, 1/100000
.Let be a cosine wave of frequency , be a cosine wave of frequency , and be a cosine wave of frequency . Let . Find the spectrum of . What property of the Fourier transform does this illustrate?
Find the spectrum of a cosine wave when
Linear time invariant 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 highfrequency noise, a lowpass filter can reject it.If a signal of interest resides only between and , then a bandpass filter tuned to passfrequencies between and can remove out-of-band interference and noise. More generally, suppose that a signal has frequencybands 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 or decreasing the magnitude.This section provides an overview of how to implement simple filters in M atlab . More thorough treatments of the theory, design,use, and implementation of filters are given in Chapter [link] .
Notification Switch
Would you like to follow the 'Software receiver design' conversation and receive update notifications?