Download sample-tdm

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Signals intelligence wikipedia , lookup

Spectral density wikipedia , lookup

Pulse-width modulation wikipedia , lookup

Chirp spectrum wikipedia , lookup

Delta-sigma modulation wikipedia , lookup

Analog-to-digital converter wikipedia , lookup

Nyquist–Shannon sampling theorem wikipedia , lookup

Transcript
Sampling and Time Division Multiplex
Objectives

To understand the concept of sampling a continuous analogue waveform

To investigate sampling a waveform using an analogue to digital converter

To investigate the effects of sampling rate and to understand the concept of
aliasing

To appreciate the Nyquist limit applied to sampling rate

To investigate time division multiplexing of signals
 Practical 1: Sampling Analogue Signals
 Objectives and Background










Sampling
In this practical you will investigate the effects of sampling a continuous
analogue signal using an analogue to digital converter.
Read the Resources section on Sampling if you do not understand the
process of sampling an analogue signal, or parameters such as resolution and
sampling rate.
The set-up for the practical is a sinusoidal analogue signal digitised by an
analogue to digital converter (A/D) at a constant rate of 20 kHz and then
passed back out to a digital to analogue converter (D/A).
The frequency of the sinusoidal signal can be varied, so the effect of the ratio
between signal and sampling rate can be observed. The resolution of the A/D
and D/A is 8 bits (i.e. 256 levels). In the practical you will change the
resolution to 4 bits (16 levels) and 2 bits (4 levels) to see the effect. You will
also see from the resulting waveshape that, at first glance, it is difficult to tell
whether a signal is being sampled at insufficient resolution or insufficient
sample rate.
The A/D and D/A are part of the on-board microprocessor system on the
hardware. The data is passed through the microprocessor, where the
resolution is changed as required. The functions of the on-board
microprocessor are controlled by commands automatically sent by you when
you start the practical or press a button on the practical diagram.
Practical 1: Sampling Analogue Signals
Perform Practical
Use the Make Connections diagram to show the required connections on the
hardware.
Identify the Micro Controller and A/D – D/A circuit block, located towards the top, lefthand corner of the board.
Associated with this circuit block, set the A/D 1 Offset, the A/D 1 Amplitude and the
D/A 1 Offset to mid position.
Set the Function Generator to Slow.
Set the Signal Level Control for maximum output.
Open the frequency counter and set the Frequency (in the Function Generator
block) to approximately 400 Hz. Close the frequency counter and open the
oscilloscope. In the Function Generator block, use the waveform selector to select a
sine wave output.
On the oscilloscope, note that the output signal is very similar to the input signal and
that the system is set to 8 bit resolution
Increase the size of the oscilloscope so you can see the waveforms more easily.
Change the resolution to 4 bit and notice that the output has more steps in it. Now try
2 bit resolution and note that the output contains only a few discrete levels.
Try the different resolutions and also adjust the amplitude of the signal using the
Signal Level Control. Note that at 2 bit resolution most of the signal waveshape is
lost.
With 2 bit resolution, change from sine to triangle waveform and note that it hard tell
the difference.
Return to a sine wave and select 8 bit resolution and maximum amplitude. Now
increase the frequency of the function generator gradually. You will need to increase
the timebase speed on the oscilloscope so you can see only a cycle or two to see
what is happening. Note that the waveshape has steps in it now. This is because the
signal frequency is such that there is only time to take a few samples in each cycle.
Note that the effect on the output is similar to reducing the resolution.
If you increase the frequency too far, some strange effects occur as a result of
aliasing. This is examined further in Practical 2.
Practical 2: Aliasing
Objectives and Background
The Effects of Aliasing
In this practical you will investigate the effect of sampling an analogue signal at
sample rates near to and below its frequency.
Aliasing can be a significant problem in any sampling system and can result in
completely misleading results.
The lowest rate that can be used to sample a signal is twice the frequency of the
signal you are trying to sample. Even then the results may not be satisfactory.
For example, if you sampled a sinusoidal signal at twice its frequency and looked at
the result all you would see is that the signal is one level during one sample and
another level during the next sample. This may be all you need to know, as it does
convey the frequency of the signal - but all the other detail of the signal has been
lost. A sampling rate at twice the signal frequency is called the Nyquist limit.
You may wonder what happens beyond this limit (sampling at less than twice the
signal frequency) and you might be thinking that you get nothing out. This would be
rather satisfactory but, in reality, you get waveforms out that imply the frequency is
below the Nyquist limit. This is rather like a multiplying or mixing process using the
sampling rate at the multiplying signal.
This effect is called aliasing, because the waveform you get is not real and is an
“alias” of the frequency being sampled.
There is more detailed information on this quite complex problem in the section on
aliasing. The important thing is to recognise that aliasing can happen; to recognise
when it does and not to be misled by its effects. In the Practical you will be able to
see aliasing at work.
Interestingly, there are situations when the effect can be used to digitise a high
frequency signal. This is called sub-sampling, but is outside the scope of this
practical.
In the practical, only a single frequency signal is used; but in reality the signal being
sampled may contain many frequencies. The Nyquist limit says that you must sample
at twice the highest frequency present in the signal. In some cases some of the
higher frequencies may not be of interest but, to prevent them appearing as aliases,
a low pass filter with a cut-off at half the sampling frequency is used. This is
sometimes referred to as an “anti-aliasing filter”.
Practical 2: Aliasing
Perform Practical
Use the Make Connections diagram to show the required connections on the
hardware.
The hardware setup used is similar to that used in Practical 1. In this Practical you
will only be using 8 bit resolution.
Set the A/D 1 Amplitude, the A/D 1 Offset and the D/A 1 Offset to mid position.
Set the Function Generator to Fast.
Set the Signal Level Control for maximum output.
Open the frequency counter and set the Frequency to approximately 2 kHz.
Open the oscilloscope. In the Function Generator block, select a sine wave.
Note that the output signal has some steps due to the sampling rate (20 kHz) being
only 10 times the signal frequency, which means that there are only 10 samples per
signal frequency cycle.
Increase the signal frequency and note that the sampled signal becomes more and
more ragged. Near to the Nyquist limit (10 kHz) notice that rather strange things start
to happen.
It is possible to sample at the Nyquist limit but here the results are difficult to
interpret. This is because the sampling rate and signal are not synchronised. Note
that, very near to 10 kHz, the amplitude of the waveform appears to vary at a lower
frequency. As you will see from a later Assignment, this waveform resembles a
double sideband suppressed carrier signal. This confirms that sampling is a
multiplying process.
Set the frequency to about 9.5 kHz. Move the frequency counter probe to the output
of the D/A Converter (monitor point 2). Now, slowly raise the frequency.
As the frequency is raised above 10 kHz note that frequencies appear below 10 kHz.
These are aliases.
Set the signal frequency to 15 kHz (you will need to move the frequency counter
back to monitor point 1, temporarily). Note the result on the oscilloscope. Move the
counter back to the sampled output signal and measure the frequency. How do you
think it is related to the input frequency?
Notice, also, that further effects occur above the sampling frequency (20 kHz).
Practical 3: Time Division Multiplex
Objectives and Background
In this practical you will investigate time division multiplex using two A/D converters
and a single D/A converter.
Two analogue signals: one a sinusoid and the other a variable dc voltage are fed into
the two a/d converters. The microprocessor samples the two alternatively at 20 kHz.
The multiplexed signal is passed to a D/A and you can see it on the oscilloscope.
Note that, if the overall sample-rate is 20 kHz, then for two signals the sampling rate
is 10 kHz, with the associated problems of this lower sampling rate.
Practical 3: Time Division Multiplex
Perform Practical
Use the Make Connections diagram to make the required connections on the
hardware.
Set the A/D 1 Amplitude and A/D 2 Amplitude to maximum.
Set the A/D 1 Offset, the A/D 2 Offset and the D/A 1 Offset to mid position.
Set the Function Generator to Slow.
Set the Signal Level Control for maximum output.
Open the frequency Counter and set the Function Generator Frequency to 1 kHz.
Open the voltmeter and use it to set the variable dc Source to approximately zero.
Open the oscilloscope. On the Function Generator block, select a sine wave output.
Note the signal on the upper trace, containing samples of the sine wave alternating
above and below the dc voltage. Adjust the dc Source voltage and note that the
upper trace changes position relative to the zero volt line, but its waveshape remains
constant.
Adjust the Function Generator frequency of the sine wave and confirm that the
Nyquist limit is about 5 kHz.