<< Chapter < Page | Chapter >> Page > |
Running
sine100hz.m
plots the first 10 periods of the sine wave.
Each period lasts 0.01 seconds, and each period contains 100 points,as can be verified by looking at w(1:100).
Changing the variables
time
or
Ts
displays different numbers of cycles of the same sine wave,
while changing
f
plots sine waves with different
underlying frequencies.
What must the sampling rate be so that each period of the wave is represented by 20 samples?Check your answer using the program above.
Let
Ts=1/500
. How does the plot of the
sine wave appear? Let
Ts=1/100
, and answer the same question.
How large can
Ts
be if the plot is to
retain the appearance of a sine wave?Compare your answer to the theoretical limit.
Why are they different?
When the sampling is rapid compared to the underlying frequency
of the signal (for instance, the program
sine100hz.m
creates 100 samples in each period), then the plot
appears and acts much like an analog signal, even though it isstill, in reality, a discrete time sequence.
Such a sequence is called
oversampled relative to the signal period.
The following program simulates the process of sampling the100 Hz oversampled sine wave. This is downsampling,
as shown in
[link] .
f=100; time=0.05; Ts=1/10000; t=Ts:Ts:time; % freq and time vectors
w=sin(2*pi*f*t); % create sine wave w(t)ss=10; % take 1 in ss samples
wk=w(1:ss:end); % the "sampled" sequencews=zeros(size(w)); ws(1:ss:end)=wk; % sampled waveform ws(t)
plot(t,w) % plot the waveformhold on, plot(t,ws,'r'), hold off % plot "sampled" wave
sine100hzsamp.m
simulated sampling of the 100 Hz sine wave
(download file)
Running
sine100hzsamp.m
results in the plot
shown in
[link] , where the
“continuous” sine wave
w
is downsampled by a factor of
ss=10
; that is, all but one
of each
ss
samples is removed. Thus, the waveform
w
represents the analog signal that is to be sampled
at the
effective sampling interval
ss*Ts
.
The spiky signal
ws
corresponds
to the sampled signal
, while the sequence
wk
contains
just the amplitude values at the tips of the spikes.
Modify
sine100hzsamp.m
to create an oversampled
sinc wave, and then sample this with
ss=10
. Repeat this exercise
with
ss=30
,
ss=100
, and
ss=200
. Comment on what
is happening. Hint: In each case, what is theeffective sampling interval?
Plot the spectrum of the 100 Hz sine wave when it is
created with different downsampling rates
ss=10
,
ss=11
,
ss=30
, and
ss=200
.
Explain what you see.
The previous sections explored how to convert analog signals into digital signals. The central result is thatif the sampling is done faster than the Nyquist rate, then no information is lost.In other words, the complete analog signal can be recovered from its discrete samples . When the goal is to find the complete waveform,this is called reconstruction ; when the goal is to find values of the waveform at particular pointsbetween the sampling instants, it is called interpolation . This section explores bandlimited interpolation andreconstruction in theory and practice.
Notification Switch
Would you like to follow the 'Software receiver design' conversation and receive update notifications?