You are on page 1of 122

Experiment 1 – An introduction to the NI ELVIS II/+ laboratory

equipment

Preliminary discussion
The digital multimeter and oscilloscope are probably the two most used pieces of test equipment
in the electronics industry. The bulk of measurements needed to test and/or repair electronics
systems can be performed with just these two devices.

At the same time, there would be very few electronics


laboratories or workshops that don’t also have a DC Power
Supply and Function Generator. As well as generating DC
test voltages, the power supply can be used to power the
equipment under test. The function generator is used to
provide a variety of AC test signals.

Importantly, NI ELVIS II has these four essential pieces of


laboratory equipment in one unit (and others). However,
instead of each having its own digital readout or display (like
the equipment pictured), NI ELVIS II sends the information
via USB to a personal computer where the measurements are displayed on one screen.

On the computer, the NI ELVIS II devices are called “virtual instruments”. However, don’t let
the term mislead you. The digital multimeter and scope are real measuring devices, not software
simulations. Similarly, the DC power supply and function generator output real voltages.

As well as the instruments mentioned above, the NI ELVIS II has available eight analogue
inputs and two analog outputs which can be controlled and written to by our LabVIEW program
and the input readings processed and displayed on screen. This allows for the creation of many
more custom "virtual instruments" which may be required in a particular experimental setup.

The experiments in this manual make use of several of the available analogue inputs as well as
several digital inputs and outputs which, in conjunction with the SIGEx board, are able to
implement two groups of programmable gain amplifiers for use throughout this manual.

Rather than utilising several independent instruments from the NI ELVIS as does the other
EMONA plug-in accessory boards (such as EMONA DATEx Telecoms-Trainer and the EMONA
FOTEx Fiber optics trainer), these instruments are all merged into one full-screen virtual
instrument for the SIGEx board known as the SIGEx Main soft front panel (SFP). With an easy-
to-use tabbed layout, each experiment has its requisite instrumentation grouped within tabs by
experiment.

1-2 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
When an NI ELVIS1 unit is connected to a PC it will automatically run the Instrument Launcher
panel as shown below:

Figure 1: NI ELVIS II/+ Instrument Launcher panel

This panel gives the user access to each individual instrument. Several of these independent
instruments are used by SIGEx experiments. These are the FUNCTIONS GENERATOR (FGEN),
the DYNAMIC SIGNAL ANALYSER (DSA) and at times the SCOPE (Scope).

When using NI ELVIS with the EMONA SIGEx board to conduct signals and systems
experiments the user will run the SIGEx Main SFP VI shown below:

Figure 2: SIGEx Main SFP

1
Throughout this manual, NI ELVIS II & II+ are referred to, however the SIGEx board
and software work equally well on the NI ELVIS I platform, with the NI ELVIS I
FUNCTION GENERATOR used in manual mode ONLY, and NI ELVIS in BYPASS mode.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-3
There are 19 TABS for use with the experiments in this Volume of the manual.

These instruments take their signals directly from the SIGEx board via the EMONA
ETT-040 Universal Base Board, into the ELVISmx circuitry, and after processing by LabVIEW
are displayed on screen as required.

The combination of the LabVIEW programmability of the NI ELVIS unit as well as the numerous
analog and digital inputs and outputs available make it convenient to create customised
instrumentation for use in real world hands-on experimentation. The EMONA SIGEx board is a
good example of this integration of available hardware and the software control.

1-4 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-5
Experiment 2 – An introduction to the EMONA SIGEx
experimental add-in board for NI ELVIS

Preliminary discussion
The experiments possible with the EMONA SIGEx board bring together worlds of
mathematical theory and practical implementation. We are able to explore, in a hands-on
manner, the representation of physical processes by mathematical models and test and measure
the benefits and limitations of such models. We explore the complementarity of the time and
frequency domains and practice thinking and theorizing in both. Through measurements,
calculations and observations we are able to consolidate our understanding of these domains.

The SIGEx board customizes the instrumentation available on the NI ELVIS to create
experiment-specific instruments which can be used to create many different circuit structures.

As well, the ability to programmatically control, measure and automate our measurements using
LabVIEW bring us closer to real-world practices of system control and monitoring.
Although the principles of being studied date back several centuries their application in real
world devices is continually being explored and implemented. The instrumentation used has
changed substantially however the rigorous nature of the mathematical process remains the
same and is a skill which is best learned in a hands-on manner.

By implementing the many mathematical model and theorems in real hands-on circuit based
experiments, the student reinforces and actualizes their understanding of these principles to
create a solid foundation for future learning.

An important skill for the engineer and scientist is the ability to take rigorous and precise
measurements, often repetitively, in order to study the phenomena at hand. The EMONA SIGEx
Signals & Systems Experimenter (ETT-311) provides an abundance of opportunities to learn and
practice experimental methodology in a variety of related topics which are common ground for
engineering students of several disciplines.

1-6 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
The experiment
For this experiment you will familiarize yourself with the various instruments available on the
SIGEx board and how they are used.

It should take you about 10 minutes to read this experiment and explore these functions.

Pre-requisites:
You should have completed the introductory chapter 1 so that you’re familiar with the equipment
setup and capabilities.

Equipment

 PC with LabVIEW Runtime Engine software appropriate for the version being used.
 NI ELVIS 2 or 2+ and USB cable to suit

 EMONA SIGEx Signal & Systems add-on board

 Assorted patch leads


 Two BNC – 2mm leads

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-7
Procedure

Part A – Setting up the NI ELVIS/SIGEx bundle

1. Turn off the NI ELVIS unit and its Prototyping Board switch.

2. Plug the SIGEx board into the NI ELVIS unit.

Note: This may already have been done for you.

3. Connect the NI ELVIS to the PC using the USB cable.

4. Turn on the PC (if not on already) and wait for it to fully boot up (so that it’s ready to
connect to external USB devices).

5. Turn on the NI ELVIS unit but not the Prototyping Board switch yet. You should observe
the USB light turn on (top right corner of ELVIS unit).The PC may make a sound to indicate that
the ELVIS unit has been detected if the speakers are activated.

6. Turn on the NI ELVIS Prototyping Board switch to power the SIGEx board. Check that
all three power LEDs are on. If not call the instructor for assistance.

7. Launch the SIGEx Main VI.

8. When you’re asked to select a device number, enter the number that corresponds with
the NI ELVIS that you’re using.

9. You’re now ready to work with the NI ELVIS/SIGEx bundle.

Note: To stop the SIGEx VI when you’ve finished the experiment, it’s preferable to use the
STOP button on the SIGEx SFP itself rather than the LabVIEW window STOP button at the
top of the window. This will allow the program to conduct an orderly shutdown and close the
various DAQmx channels it has opened.

Ask the instructor to check


your work before continuing.

1-8 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
EMONA SIGEx board overview

The SIGEx board is a collection of independent circuit blocks which each implement a single
simple function. No one block is a complete experiment, however several blocks together can
implement a wide variety of different experiments. The block inputs and outputs are patched
together with 2 mm patching leads according to the block diagram as documented in this Lab
Manual or from the many texts available on this topic.

EMONA SIGEx board layout

This chapter discusses the functionality of each module briefly and further details such as
specifications are contained in the EMONA SIGEx User Manual.

NI ELVIS II/ SIGEx bundle

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-9
SIGEX board circuit modules

Sequence Generator

The SEQUENCE GENERATOR provides a source of periodic data


streams which are output as 5V logic and bipolar level signals.
DIP switches allow the selection of 4 different streams.
A periodic SYNC pulse is output once per frame.
The module is clocked by a single input logic level clock. This will
typically come from the PULSE GENERATOR or FUNCTION
GENERATOR/SYNC outputs.

The state of the DIP switches at any time is displayed on the SIGEx
SFP along with a description.

Limiter

The LIMITER amplifies an incoming signal with DIP switch selectable


gain levels and to a fixed level, creating an amplitude limited output
signal.

It is typically used with bipolar analog sinusoidal signals or bipolar line


coded data streams.

RC Network
The RC NETWORK provides R and C elements which can be arranged as
either an RC circuit which acts as a LPF, or as a HPF.

The elements are floating and one end needs to be connected to GND.

Rectifier
The Rectifier provides half wave rectification of an incoming signal with
a non ideal diode component which has a forward voltage drop.

This is typically used with sinusoidal signals.

1-10 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Multiplier
The Multiplier provides four quadrant multiplication of two analog input
signals. Its overall gain is approximately unity and it is used to model
any multiplication process that may occur in a block diagram.

Integrate & Dump/Hold


Both Integrate and Dump as well as Integrate and Hold is available in
this circuit block. Usually clocked by the bit clock of an incoming
sequence, it is used to integrate over a single period of a waveform in
correlation and filtering functions.

Baseband Low Pass Filter


This LPF has a 4th order Butterworth response and serves both as a
“system under investigation” and for general filtering functions.

PCM Encoder
This module implements PCM encoding of a single analog signal. It
outputs an 8 bit frame along with a periodic Frame Sync pulse.

It can be used with both DC signals as well as sinusoids and serves to


allow specific investigation of the encoding process.

It has a maximum sampling rate of 2.5ksps ( 20kbps PCM data stream),


and so can be used with signal frequencies below the Nyquist limit of
1.25kHz.

PCM Decoder
This module implements PCM decoding of an 8 bit PCM digital data
stream from the PCM Encoder.

The Frame Sync is necessary to achieve synchronization and there is no


reconstruction filter on the output to allow investigation of quantization
issues.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-11
Tuneable Low Pass Filter
This module is an adjustable LPF. It implements a 8th order Elliptic
filter with an adjustable corner frequency. The output signal level is
also adjustable, and it can accept analog and TTL level digital signals.

There is no anti-aliasing filter on the input so users need to be aware of


the bandwidth of their incoming signal.

Integrators

These 3 independent circuits are simple integrator circuits with a common DIP-switch-
selectable integration rate. They are used for continuous time integration ( unlike the
Integrate & Dump/Hold unit which operates over a single period only.)

They are used in Laplace domain experiments.


The DIP switch settings is displayed in the SIGEx SFP along with the approximate integration
rate.

Unit delays with Sample & Hold

The Sample & Hold is an analog sampler circuit which holds the sampled value for a single period
of the incoming TTL level clock signal. The unit delays are similar in that they hold the incoming
analog value at their input for a single clock period.

All 4 units share a common clock signal.

1-12 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Triple and dual input adders

There are 3 adder sections. Two identical triple input adder sections and a dual input adder.
The triple input adders, a & b, have adjustable gains. These gains are adjusted via the SIGEx
SFP and are typically used to implement the taps in feedback and feedforward systems.

The dual input adder has unity gain and is used for general purpose addition.

The GAIN ADJUST knob is read by the SIGEx SFP software and can be used to manually
adjust adder gains.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-13
NI ELVIS functions blocks available on the SIGEx board

Pulse generator / Digital out


This module makes available the built in Pulse Generator from NI ELVIS
which has a very broad range of frequency and duty cycle control. This
is controlled from the SIGEx SFP and is usually used to provide digital
clock signals to experiments.

D-OUT-0 is a single digital output line which is available but currently


unused in experiments.

Function generator
This module makes available the built in Function Generator from NI
ELVIS which is a multifunction generator, with variable signal types,
variable amplitude and variable frequency. It is controlled via its own
instrument panel which available from the NI ELVIS Instrument
Launcher panel.

Analog out
This module makes available the built in dual analog outputs from the
DACs.

These outputs are controlled from various SIGEx experiment TABs and
can be modified to create any periodic waveforms required.

1-14 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
EMONA SIGEx Soft Front Panel (SFP) descriptions

The EMONA SIGEx Soft Front Panel serves both to control elements of the SIGEx hardware,
as well as provide experiment specific measuring instrumentation in a handy, experiment-per-
TAB based layout.

The layout is arranged so as to fit on screen easily with all parameters in view.

The source code VI’s are provided on the SIGEx CD so that users can modify and customize the
SFP arrangement and functionality if required.

SIGEx is designed for university and college users and access to the LabVIEW “Digital Filter
Design” toolkit is expected for full functionality to be available.

EMONA SIGEx Soft Front Panel

ADDER gain entry panel

The triple input adders have variable gains which are set from the entry controls on the SFP.
These gains can also be set programmatically as is done in several experiment TABS. The
onscreen gains are transferred to the hardware automatically and continuously.

Coefficient selector panel

The position of the onboard GAIN ADJUST knob can be interpreted as a range of values set to
a particular adder gain control. The radio button panel is used to select a particular gain control,
or none. The center value and step size of each increment from the GAIN ADJUST knob must

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-15
also be set. This allows either a broad range of values or a narrow focused range of values to be
adjustable via the knob.

Pulse Generator panel

In the panel the frequency and duty cycle of the PULSE GENERATOR block can be set. As well
the spare D-OUT-0 line can be toggled.

SG Sequence type and Integrator Gain readouts

These readouts mimic the selection of the onboard DIP switches and the text briefly describes
the signal type selected for convenience. Details of signals in the SIGEx User Manual.

Analog OUT viewer

This graph indicator displays the actual signal currently being output from the ANALOG OUT
terminals from the DACs. These vary depending on the experiment selected, and this readout is
convenient when SCOPE channels are being used for other signals.

SCOPE Trig level, trig slope, triggered LED, trig select, timebase etc

These controls are for the SFP scopes embedded in various experiment TABs.
Trig level sets the voltage level the trigger looks for. Usually set to 0 or 1 V
Trig slope allows triggering on either the positive or negative edge of a signal.
Triggered LED is ON (green) when a trigger point , as defined above, is detected.
Trig select determines which channel acts as the trigger.
Timebase varies the amount of real signal time to be captured and displayed. Total time
displayed is selectable.
RUN/STOP enables halting of the scope display for close inspection.
Y autoscale ON: enables toggling of the Y axis autoscale function for stable signal viewing with
varying amplitude signals.

This built in scope is a convenient, customized signal display for use in specific experiments.
Spectrum display is also available in certain TABs when required.

Note for ELVIS 2+ users

Due to the independent scope instrumentation available in the ELVIS 2+ it is possible to


simultaneously use the independent scope from the Instrument Launcher panel as well as viewing
the signals in the TAB based scope display.

The Dynamic Signal Analyser (DSA), a spectrum analyser, can also be used, but not at the same
time as the independent scope.

1-16 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Laboratory Experiment ‘X’ TABS

Each experiment in the SIGEX Lab Manual has its own SFP TAB if required.
Select the TAB as required and the appropriate instrumentation will be displayed. Labs 3 to 18
have TABs available.

Some graphs also have cursors enabled. These are very useful for taking accurate & quick
measurements.

HINT: Right-clicking on a graph will display extra available options you can use. Different
options are available when you right-click while the SFP is not running eg: setting a graph from
linear to log display is done while SFP is not running.

Digital Filter Design TAB

This TAB makes available several of the digital filter design features from the toolkit in one
handy display. The user should select a filter type from which the transfer function will be
calculated. The coefficients from the transfer function are extracted and setup on the SIGEx
hardware as the triple ADDER gains when required by the user. This can be seen on the SFP.
The calculated responses are displayed onscreen.
To view the actual signals and responses from the hardware, switch to a TAB which contains a
scope and FFT, for example the ZOOM FFT TAB, whilst inputting an appropriate source signal.

Note that SIGEx is limited to implementing only up to 2 nd order filters. A red “error” LED will
highlight when orders >2 are selected.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-17
ZOOM FFT TAB

This TAB contains a scope display, a spectrum display, and a zoomable view of the FFT display.
This TAB is a general purpose display TAB and is not associated with any particular experiment.
The FFT display is a 1000 point display, and the “# samples” control allows the user to select a
zoom window from 0 to 1000 points to display alongside. The “zoom region” slider enables the
zoom region to be selected from the overall 1000 point FFT display.

PZ PLOT TAB

This TAB uses components from the Digital Filter Design toolkit to calculate and plot the poles
and zeros on the unit circle from the coefficients of the transfer function as it is set up on the
SIGEx board.

The coefficient values from the triple ADDER gain controls are read by this TAB and plotted as
the equivalent poles and zeros in real time.

This is especially interesting when the coefficients are being varied manually by the onboard
GAIN ADJUST knob, in that the user can see the poles and zeros moving about the unit circle
in real time alongside the hardware.

1-18 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-19
Experiment 12 – Sampling and Aliasing

Achievements in this experiment

You will be able to intuitively visualize the spectrum of a sampled signal, and aliasing. You will be
able to use this to gain an intuitive understanding of sampling theorems for minimum sampling
rates.

Preliminary discussion

The conversion of analog signal to digital format involves two stages:


- first, the capture of "frozen" sample values
- then, the digitization of these frozen analog values

Further processing may be applied to improve the storage efficiency, ie, to reduce the memory
needed to a minimum.

In this lab we are concerned only with the sampling process. It is evident that the choice of
sampling rate is the paramount issue: Too slow means that some details are lost with samples
too far apart. If the sample spacing is too fine, resources are wasted, i.e. storage and
processing time. A suitable balance between these considerations is needed.

You will start with the sampling of some typical signals, then observe the recovery of the
continuous-time signals from sample sequences at various rates. From this you will be able to
discover the link between the minimum sampling rate and bandwidth.

This lab opens the door to gaining an intuitive understanding of the theory and practical issues
underlying sampling.

In Part 1 you set up sampling operations of selected test signals and carry out observations in
the time domain. Next, you investigate the reverse process, recovering the analog signal, and
examine the effect of various sampling rates.

In Part 2 you retrace the time domain investigations of Part 1 with observations in the
frequency domain. This provides a systematic structure for the processes involved and makes
possible intuitive mathematical interpretation. Equipped with this insight, you will be able to
easily formulate criteria for choosing efficient sampling rates.

1-20 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Pre-requisite work

Question 1
Look up or derive the trigonometric identity for the product of two sines expressed as a sum.
Confirm that the frequencies in this sum are (f1 + f2) and |f1 - f2|, where f1 and f2 are the
input frequencies. Confirm that the output components are of equal magnitudes.

Question 2
Look up or derive the Fourier series of a squarewave of duty ratio other than 50% (25% and 1%
say). Note the sinx/x shaped spectrum envelope. Locate the frequency of the first null of the
envelope for each case and note the relationship with the pulse width.

Now consider the 50% duty ratio case. Comment on the disappearance of the even harmonics.

Question 3
Derive the spectrum of the product of a sinewave and a 1% duty ratio squarewave. You can do
this easily by using superposition with the results in Question 1 and Question 2. For convenience,
make the frequency of the squarewave around five times the sinewave frequency. Plot the
resulting spectrum.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-21
Equipment

 PC with LabVIEW Runtime Engine software appropriate for the version being used.

 NI ELVIS 2 or 2+ and USB cable to suit


 EMONA SIGEx Signal & Systems add-on board
 Assorted patch leads

 Two BNC – 2mm leads

Procedure
Part A – Setting up the NI ELVIS/SIGEx bundle

10. Turn off the NI ELVIS unit and its Prototyping Board switch.

11. Plug the SIGEx board into the NI ELVIS unit.

Note: This may already have been done for you.

12. Connect the NI ELVIS to the PC using the USB cable.

13. Turn on the PC (if not on already) and wait for it to fully boot up (so that it’s ready to
connect to external USB devices).

14. Turn on the NI ELVIS unit but not the Prototyping Board switch yet. You should observe
the USB light turn on (top right corner of ELVIS unit).The PC may make a sound to indicate that
the ELVIS unit has been detected if the speakers are activated.

15. Turn on the NI ELVIS Prototyping Board switch to power the SIGEx board. Check that
all three power LEDs are on. If not call the instructor for assistance.

16. Launch the SIGEx Main VI.

17. When you’re asked to select a device number, enter the number that corresponds with
the NI ELVIS that you’re using.

18. You’re now ready to work with the NI ELVIS/SIGEx bundle.

19. Select the EXPT 12 tab on the SIGEx SFP.

Note: To stop the SIGEx VI when you’ve finished the experiment, it’s preferable to use the
STOP button on the SIGEx SFP itself rather than the LabVIEW window STOP button at the
top of the window. This will allow the program to conduct an orderly shutdown and close the
various DAQmx channels it has opened.

1-22 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Ask the instructor to check
your work before continuing.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-23
Experiment

Part 1: through the time domain

20. In this exercise we observe the sampling of a sinewave. Patch up the model in Fig 2.

Fig 1: block diagram for sampling with narrow pulses

Fig 2: SIGEx model for sampling with narrow pulses

The sampling signal is obtained from the FUNCTION GENERATOR square wave output which is
set up specifically to drive the MULTIPLIER block like a switch. When the sampling signal is
non-zero, ie at 1V, the input sinewave is passed. However when the sampling signal is zero volts,
then the input signal is not passed, and 0V is output. This emulates an open/close switch.

Settings are as follows:


FUNCTION GENERATOR: Squarewave selected; 10kHz; 1Vpp, 0.50V Offset, with DUTY
CYCLE=50%
SCOPE: Timebase 2ms; Rising edge trigger on CH0; Trigger level=0V
ANALOG OUTPUT (DAC-1): 4Vpp sinewave at 1kHz

21. View the sinewave input to the MULTIPLIER on CH0, and the sampling signal at the
MULTPLIER on CH1. Confirm that they are as expected.

1-24 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
22. Display the analog input and the output sampled at 10,000 samples/sec. Try one or two
other sampling rates and various DUTY CYCLES settings. These parameters are controlled from
the FUNCTION GENERATOR instrument panel. Slippage between signals will occur due to lack
of synchronisation between signals.

This demonstration of the sampling process is evocative because it makes it possible to view the
samples as we imagine them, as individual narrow pulses with amplitude proportional to the
sample value, over the entire width of the pulse. However in most applications further
processing will be involved, such as encoding this sampled level as a digital representation (i.e.,
analog-digital conversion). Hence the sampled value must be held while this is carried out. A
sample-and-hold device is provided in the DISCRETE-TIME section of the SIGEx board.

23. Repeat step 13 using sample and hold. Refer to Fig 4 for the SIGEx model. Compare the
outcome with step 13 .

Fig 3: block diagram for sampling with full width pulses (using Sample/Hold)

Fig 4: SIGEx model for sampling with full width pulses (using S/Hold)

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-25
Fig 5: example signals from SIGEx model of Fig 2 & 4

Next we consider the recovery of the original analog waveform from the sample train. We will
use a lowpass filter to smooth out the jagged corners of the stepped signal generated with the
Sample/Hold. This has a good chance of succeeding when variations between samples are
relatively small.

Fig 6: block diagram for recovering the analog signal

24. Attempt the recovery of the analog signal from the stepped sample train from the
SAMPLE/HOLD by means of the TUNEABLE LOWPASS FILTER (Fig 7). Set the Fc tuning knob
to full clockwise. Set the GAIN to give a gain of 1 (knob at mid-range). Start with a high
sampling rate, 10k samples/sec, say. Display the filter output and observe the effect of
reducing the filter bandwidth. Compare this output with the original unsampled signal.

25. Since the sample rate is set by the clock signal, we will interchangeably refer to the
sampling rate as a clock rate, and use the unit “Hz” rather than “samples/sec”.

Question 4
Repeat this for a few other sampling rates, from 10000Hz, down to 2000Hz, say. Document your
readings in Table 1 below. From these observations, what is the minimum sampling rate you
consider adequate to allow recovery of the analog signal without too much distortion, on the
basis of this sampling format (i.e. using the SAMPLE/HOLD function).

1-26 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Table 1: sample rate readings for recovery from S/H

Sample rate (Hz) TLPF setting Recovered


(approx.position) amplitude (V)

Question 5
Repeat the procedures in step 15 for recovery using the TUNEABLE LPF using the sample train
generated with the system in Fig 2, i.e. with narrow pulses. Document your readings in Table 1
below. Compare the outcome with those obtained with the S/Hold method. Do you expect one
of these sample formats to be better for interpolation to analog form? Is this borne out by
your results?

Table 2: sample rate readings for sampled pulse train recovery

Sample rate (Hz) TLPF setting Recovered


(approx.position) amplitude (V)

26. Leave the TLPF Fc control set as per the last few results, for the next few questions.

Question 6
Examine the step and impulse responses of the filter at the settings that give you the best
outcomes. Measure risetime and related properties and compare with the sample interval. 2 Use

2
You may wish o refer back to your notes from “Experiment 3: Special signals”, where step and
impulse responses were covered.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-27
the PULSE GENERATOR module set to 10Hz, and various DUTY CYCLES settings to achieve this
easily.

Question 7
For the same settings as in step 17, carry out a quick examination of the frequency response of
the filter. Obtain and record the 3dB cut-off frequency, and the attenuation of the stop-band.

As we have already seen, the sinusoid has a special role in linear systems. It turns out that the
sampling properties of sinewaves make it possible to establish precise limits for sampling rates.
This is developed thoroughly in Part 2.

27. Carefully observe the result when the sampling rate is less than two samples per period
(e.g. less than 2kHz). The frequency of the sinewave recovered at the filter output will have
changed (use the filter output as trigger source for the scope). The recovered signal is not the
sinewave at the input of the sampler.

This is easily achieved by slowly decreasing the FREQUENCY setting of the FUNCTION
GENERATOR. Using the “down arrow” to slowly decrement frequency works well.

Check that this outcome occurs with both sampling formats.

One way to see how this comes about is to plot the sample points on graph paper and draw a
smooth curve through these points by eye. The new sinewave is called an alias of the original.
The effect is known as aliasing. Try this below for a sampling rate much less than 2kHz, say
1500Hz. Draw 4 cycles of the 1kHz sinewave as a reference on Graph 1 below.

1-28 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Graph 1: alias waveforms

Confirm that the sum of the original and alias frequencies = sampling frequency.

Insight into these outcomes is best achieved from a frequency domain perspective.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-29
Part 2: through the frequency domain

In Part 1 we examined sampling and reconstitution through observations in the time domain.
However, the mathematical structure underlying these processes is more readily revealed in the
frequency domain.

In the next task we examine the spectrum of the product of two sinewaves. This will be needed
later as a tool for analyzing the spectrum of sampled signals. Patch together some blocks as
shown in Figure 7.

Figure 7:block diagram for product of two sinewaves

28. Set the FUNCTION GENERATOR frequency to 5 kHz. Display the MULTIPLIER output
as well as the lower frequency input sinewave from ANALOG OUTPUT: DAC-1.

Settings are as follows:


FUNCTION GENERATOR: Sine wave output, 2Vpp; 0V offset.
SCOPE: Timebase: 4ms; Ch0: DAC-1 ; Ch1: MULTIPLIER output

The two lines straddling the FUNCTION GENERATOR frequency are clearly displayed. Confirm
that the outcome agrees with the theoretical predictions in Pre-lab preparation Q1. This is an
important fundamental result which you must be familiar and comfortable with.

Next, the spectrum of the sampled sinewave.

29. Keep this patching but change the signal type output from the FUNC OUT terminal of
the FUNCTION GENERATOR to recreate the patching of the sampled sinewave from Figure 2.

Settings are again as follows:


FUNCTION GENERATOR:Squarewave output; 5kHz; 1Vpp, 0.50V Offset, with DUTY
CYCLE=50%
SCOPE: Timebase 4ms; Rising edge trigger on CH0; Trigger level=0V
ANALOG OUTPUT (DAC-1): 4Vpp sinewave at 1kHz

30. Disconnect the scope lead from the MULTIPLIER output and use it to view the sampling
squarewave only. Confirm you understand why its spectrum is a series of odd numbered
harmonics, including a DC component. This was covered in Pre-lab preparation Q2.

31. Reconnect the scope lead to the MULTIPLIER output and view the sampled sinewave
along with the sampling squarewave. Observe the spectral lines straddling each of the

1-30 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
squarewaves harmonics. Each one of these harmonics is straddled by a sum and difference
signal. Satisfy yourself that each of these sinewave components can be considered as being
separately multiplied by the sampler input, i.e. the 1kHz sinewave. Thus, by focusing on just one
Fourier component of the squarewave pulse train in turn, we are able to build the array of line
pairs of the form observed earlier, each pair centered at the respective harmonics of the
FUNCTION GENERATOR squarewave frequency. Confirm you understand completely why the
spectrum looks like this.

Question 8
Explain why the sampled signal spectrum looks the way it does and specifically relate this to
your understanding of pre-lab preparation item 1 & 2.

In Prep Q2 you showed that the squarewave signal can be expressed as a Fourier Series, i.e. as
the weighted sum of sinewaves (in this instance at 5kHz, 15kHz,...) for a 50% duty cycle signal.
Vary the duty cycle of the squarewave by changing the DUTY CYCLE value in the FUNCTION
GENERATOR control panel to 25%.
Satisfy yourself that you understand the source for the appearance now of even harmonics also.

Question 9
Note the frequency of the first and second nulls in the spectrum and explain why they are at
those frequencies.

Experiment with the duty cycle and view the effect of other duty cycles upon the spectrum. Try
using a 10% sampling duty cycle. Confirm with your theoretical understanding.

Aliasing and the Nyquist rate

In the next tasks we revisit the investigation in step 18, where aliasing was discovered at
sampling rates below a critical limit. The view through the frequency domain reveals a
straightforward mathematical interpretation. Once again we will use the FUNCTION
GENERATOR to generate the sampling clock. Whilst we are mainly interested in the frequency
display, in the time domain scope display some clock slippage will be visible but is not of concern.

With the same patching as before in the previous step (Figure 7), select a 25% duty cycle so as
to have both odd and even harmonics present:
Settings are again as follows:
FUNCTION GENERATOR:Squarewave output; 5000 Hz; 1Vpp, 0.50V Offset,
with DUTY CYCLE=25%
SCOPE: Timebase 20ms; Rising edge trigger on CH0; Trigger level=0V
ANALOG OUTPUT (DAC-1): 4Vpp sinewave at 1000Hz. View on CH1

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-31
Selecting a time base of 20ms allows us to have higher resolution in the frequency domain and
see the harmonics more closely, although the individual samples in the time domain display are
more difficult to discern.

32. Begin with a sampling rate of 5kHz, which is 5 samples per period of the 1kHz sinewave.
Display the spectrum of the sampled output (on CH1) as well as the spectrum of the sampling
pulse train (on CH0). Now progressively reduce the sampling rate in 500Hz steps ie 4500Hz,
4000Hz, 3500Hz, and observe the effect on the spectrum. Carefully keep track of the
positions of the spectrum images about each harmonic of the sampling clock. Note that the only
component that is not shifting is the one at 1000 Hz, corresponding to the input sinewave.
Use RUN /STOP to hold the time domain display if slipping.

33. When you have reduced the sampling rate to 3000Hz, locate the component adjacent to
the one at 1000Hz. It should be at 2000Hz. We denote this component as the lower sideband
of the first spectrum image. (The upper sideband of the first spectrum image is at 4000Hz).
Continue reducing the sample rate and carefully follow the further movement of this component.
Note the sample rate when the lower sideband is at the same frequency as the input sinewave.

Question 10
At what sampling rate does the lower sideband of the first spectrum image become located at
the same frequency as the input sinewave ?

34. Proceed further, to 1500Hz say, and note that the first lower sideband is now at a
frequency below that of the input sinewave. Examine the overall spectrum and check that you
are able to identify the pairing of the sidebands about their respective mirror frequencies.
Note that the image patterns/pairs are now overlapping.

35. Proceed to 1000Hz . Now note that the output also contains a DC component. If you
were sampling at the exact rate of the input signal, and were exactly in phase as well (something
we are not able to due to slippage between the sampling pulses and the input) then you would
expect to sample the sinewave at the exact same point in each period, resulting in a DC output.
Consider this especially in relation to the frequency domain display you have.

Now that we have seen the effect of the sample rate on the spectrum of the sampled sinewave,
we are ready to focus on the recovery of the analog input with a lowpass filter as examined in
step 3 and 4. We will watch the spectrum of the filter input and output as the cut-off
frequency is tuned to suppress the unwanted components, and discover the challenges that arise
as we strive for the lowest achievable sampling rate.

36. Add the TUNEABLE LPF to the experiment setup as shown in Figure 6. Display the
spectrum at the TUNEABLE LOWPASS FILTER output. Set the sampling frequency back up to
5kHz and the TUNEABLE LOWPASS FILTER cut-off to the highest available (Fc knob fully
clockwise). Set the TUNEABLE LPF GAIN to approximately 1 (mid position). Progressively

1-32 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
reduce the TUNEABLE LOWPASS FILTER cut-off so that all components of the sampled
spectrum are suppressed except one. Note its frequency and compare this with the spectrum
of the sampled signal. Satisfy yourself that this is as expected.

Repeat this with the FUNCTION GENERATOR at 1500Hz. Again, compare the result with the
spectrum of the sampled signal and verify the validity of the outcome. Why is the original
analog signal not recovered in this case? Why is the term alias is used to describe this non valid
output?

Question 11
You should be able to recover a clean sinewave. What is its frequency ? Where does it come
from?

In the next segment we look for the lowest sampling rate that allows proper recovery of the
input sinewave without generating alias components.

37. Return to the setup at the start of step 13. Decrease the sampling rate to 2000Hz and
tune the TUNEABLE LOWPASS FILTER as before. Continue reducing the sampling rate and
retuning the TUNEABLE LOWPASS FILTER until the filter can cleanly resolve the desired
input component at 1000Hz, but not reduce its amplitude. We are trying to isolate the wanted
component alone and separate it from the unwanted “images”. Note the sampling rate
corresponding to this situation, and the frequency of the first unwanted sideband. Satisfy
yourself that this frequency corresponds to the lower edge of the stopband of the filter and
that the edge of the passband is at 1000 Hz.

Consider how the sampling rate could be decreased further if a filter with tighter transition
band was available. In theory, an ideal “brickwall” filter is needed to achieve ideal results. We
will have to make do with the capabilities of the TUNEABLE LPF. Check the SIGEx User Manual
to inform yourself about its performance characteristics.

Question 12
Why is it not possible to recover the analog input when the number of samples per cycle of the
input sinewave is less than two?

Question 13
What is the minimum sampling rate that allows a filter to be able to recover the original
sinewave signal without any other unwanted components ?

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-33
Multi-frequency input spectrum

Up until now we have simply worked with a single frequency input sinewave for simplicity. The
sampling theorem also works with multiple component input signals such as voice or noise. You
have discovered that the minimum sampling rate that can be used to recover a message
correctly is twice the bandwidth of the signal to be sampled. This rate is commonly known as the
“Nyquist rate”.

In this section we will repeat the previous steps quickly, but with a multi-frequency input signal.
This will allow us to enhance our visualisation of the sampled spectrum and the occurrence of
“aliasing”. There is a two component signal available at ANALOG OUTPUT DAC-0. It has an easy
to recognise “triangular” envelope. This signal is arbitrary and has been created to assist in
visualisation of the sampling process.

Figure 8: example of a 2-component signal at DAC-0: time and frequency representation

Figure 9: example of a sampled multi-frequency signal, in time and frequency domains

38. Repeat the steps 23,24,& 25 in the section above: “Aliasing and the Nyquist rate” whilst
using this multi-frequency signal source. Start with a sampling rate of 10kHz to more clearly see
the images.

Notice how the triangular spectrum is reflected about each harmonic of the sampling signal,
forming a series of spectral pairs.

1-34 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
OPTIONAL: Uses of undersampling in Software Defined Radio

This section is optional and builds upon your understanding of the sampling process.
As has been seen so far, the sampling process can also be thought of as a simultaneous, multi-
frequency multiplying process, where the sampling waveform is a series of harmonics with
decreasing amplitudes. We also know precisely what the outcome of each multiplication will be.

With this in mind, we can take a closer look at the sampling theorem for lowpass signals. Rather
than stating that a signal must be sampled at least at twice the rate of the highest component
in that signal, it states that the signal must be sampled at twice the bandwidth of the signal in
question regardless of its position in the passband. This means that signals in the passband need
only be sampled a minimum of twice the signal’s bandpass bandwidth, and NOT twice the
absolute frequency of the passband signal.

For example, a DSBSC signal of a message with 2Khz bandwidth, at a bandpass frequency
centered at 100kHz (such as is used in EMONA DATEx DSB-SC experiments) need only be
sampled at 2 * 2kHz, and not 2 * 102kHz.

The reason for this is important and has hopefully become evident in previous sections. The
sampling process creates upper and lower sideband pairs about each harmonic of the sampler.
The “Nyquist rate” limitation exists to avoid the created “pairs” overlapping each other and
creating new and unknown components inside the message bandwidth.

This means we can sample at frequencies lower than the passband which is less demanding of
the sampling circuitry and has been utilised in contemporary wireless front-end convertors
which sample directly at RF frequencies, an already demanding task.

In this part of the experiment, we will firstly create a passband DSB-SC signal with a two-tone
“message” signal at a “carrier” frequency of 10kHz. We will then sample this signal at greater
than the 4000Hz (twice the message bandwidth of 2000Hz), but much lower than the actual
maximum frequency of the passband signal itself, 11kHz multiplied by 2 ie: 22kHz.

Remembering that the sampling signal can have harmonics, Fs, 2Fs, 3Fs,… should alert you to the
fact that we are again simply doing a simultaneous, multi-frequency multiplication in which the
smaller 10kHz component (2nd harmonic of 5000Hz) will multiply our message band down to
baseband, where we can directly receive it. This is the essence of a direct down-conversion
receiver in telecommunications.

In effect we are carefully exploiting the “aliasing” effect which in the previous section we were
careful to avoid. Notice that we need to select a sampling frequency which has an integer
harmonic multiple equal to the center of the passband signal.

39. Patch together the experiment setup in Figure 10. The ANALOG OUTPUT: DAC-0 will
supply the passband DSB-SC signal at 10kHz. Select the “PASSBAND” option on the SFP TAB 12
with the toggle switch.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-35
Figure 10: direct down-conversion receiver using undersampling

40. View both inputs to the MULTIPLIER. One is the passband signal, with 2 upper sideband
components, and 2 lower sideband components with a total bandwidth of 2kHz. The other is the
sampling signal with harmonics at DC, 5kHz, 10kHz, 15kHz visible.

Figure 11:examples of inputs and outputs to down-convertor in time and frequency domains

Settings are again as follows:


FUNCTION GENERATOR:Squarewave output; 5kHz; 1Vpp, 0.50V Offset, with DUTY
CYCLE=25%
SCOPE: Timebase 10ms; Rising edge trigger on CH0; Trigger level=0V

41. Remove the scope lead from the sampling signal and use it to view the output of the
MULTIPLIER. Confirm that there is a small image of the “triangular” message from 0 to 1kHz ie
at baseband.

42. View the input and output to the TUNEABLE LPF and gradually tune out all frequencies
except for the baseband message. The characteristic “triangular” envelope of the message in
the frequency domain lets us see that the signal is in fact available at baseband. There will be
some modulation of the signal levels due to non-synchronisation of the sampling signal.
Synchronisation is a major issue in this type of down conversion.

1-36 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
It is also labelled “undersampling” due to the use of low sampling rates, and these techniques
feature in modern Software Defined Radio and wireless systems.

43. Experiment with different sampling rates and confirm that the signals you see are in
accordance with theory. Be aware of the phenonema of negative frequencies “folding” about the
0Hz point and being reflected into the positive frequency domain. This is often the source of
unaccounted-for components.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-37
Tutorial questions

Q1 re need for anti-aliasing filter:

Explain the role of the anti-aliasing filter in the sampling process. Show that
aliasing is caused by the sampling process, hence the anti-aliasing filter must
be ahead of the sampler.
Consider a signal of bandwidth 3.5kHz in the presence of wideband noise. The
noise spectrum is uniform and has a bandwidth of 500kHz. The SNR is 30dB.
The signal is sampled at 8k/s. What is the signal-to-noise-ratio (SNR) of the
sampled signal if a suitable anti-aliasing filter is used. Compare this with the
SNR that would be obtained if an anti-aliasing filter were not used.

Q2 re trade-off: excessively sharp cut-off lowpass filters.

Describe why the use of sharp cut-off anti-aliasing and interpolation lowpass
filters helps achieve sampling rates close to the theoretical limit. Indicate
the disadvantages of sharp cut-off lowpass filters, and the criteria for
obtaining a practical compromise.

Q3 re step 2

Suppose in the model of Fig 1 we were able to increase the duty cycle to the
point of taking up the entire interval between samples, would this be
equivalent to S/Hold ? Describe how you would implement a S/Hold device
(clue: a capacitor is needed to hold the sampled analog voltage).

Q4 Why is S/Hold used in practical DACs, in preference to narrow pulses?

Q5 x/sinx correction

Data sheets of commercial digital to analog converters mention "x/sinx"


correction. Why is this needed?

1-38 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-39
Experiment 13 – Getting started with analog-digital conversion

Achievements in this experiment

Practical knowledge of coding of an analog signal into a train of digital codewords in binary
format using pulse code modulation (PCM), i.e., analog to digital conversion. Understanding of the
decoding process, quantization issues and reconstruction of the output signal. Appreciation of
the need for both bit clock and frame synchronisation .

Preliminary discussion

This lab introduces the basics of digital-analog signal conversion with the PCM ENCODER and
PCM DECODER modules. The formatting of a PCM signal, will be examined in the time domain.
Part 1 deals with encoding. The recovery of the analog signal is covered in Part 2.

How did the idea of PCM Encoding come about ?

Imagine you wanted to send an analog signal such as voice across a noisy channel. Naturally the
received signal would be subject to a degree of additive noise, as well as other forms of signal
distortion due to bandwidth limitations. It may become unrecognisable and hence useless.

By converting that analog signal into packets of digital data, we are able to benefit from the
high level of noise immunity inherent in digital signals. Although digital data transmission has its
own issues, mainly, bandwidth limitations, we can be certain of the ability to reconstruct the
message if the digital error rate is kept within limits.

It should take you about 45 minutes to complete this experiment, not including the preparation
to be done before the hands-on lab work.

1-40 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Pre-requisite work

PCM ENCODER basics

The PCM ENCODER module converts an analog input into a stream of digital codewords. As
investigated in Lab 12, the maximum allowable input bandwidth will depend on the sampling rate.

The amplitude range must be matched to the input range of the encoder. If excessive,
overloading will occur. If too small, noise and interference will degrade signal quality. The
appropriate range is within the ± 2.5 volts range. This is specified in the SIGEx User Manual.

A step-by-step description of the operation of the module follows:

i. the module is driven by an external TTL clock.


ii. the input analog signal is sampled periodically. The sample rate is determined by the
external clock.
iii. the sampling process is carried out as a sample-and-hold operation, within the module.
The held output ( i.e., the amplitude of the analog signal at the sampling instant) is not available
on the front panel of the module 3.

iv. the PCM encoding is carried out by comparing each sample amplitude with a finite set of
amplitude levels. These are distributed (uniformly, for linear sampling) within the range
± 2.5 volts. These are the system quantizing levels.

v. each quantizing level is assigned a number, starting from zero for the lowest (most
negative) level, with the highest number being (L-1), where L is the available number of levels.
vi. each sample is assigned a digital (binary) code word representing the number associated
with the quantizing level which is closest to the sample amplitude. The number of bits ‘n’ in the
digital code word will depend upon the number of quantizing levels.

Question 14
Show that n = log2(L):

vii. the code word is assembled into a time frame together with any other bits as may be
required (described below). In the PCM ENCODER (and many commercial systems) a single
extra bit is added, in the least significant bit position. This is alternately a one or a zero.
These bits are used for frame synchronization in the decoder.
viii. the frames are transmitted serially. They are transmitted at the same rate as the
samples are taken. The serial bit stream is accessible on the front panel of the module.

3
Sampling with a sample and hold operation is introduced in Lab12 where you are able to display the
"held" output.The PCM ENCODER effectively has a “sample and hold” unit within its front end.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-41
ix. also available from the module is a synchronizing signal FS (‘frame synch’). This signals
the end of each data frame.

Before proceeding with the experiment tasks, we briefly review the essential features of the
ENCODER module.

Figure 1:Layout of the PCM ENCODER

The SIGEx board layout of the module is shown in Figure 1. Technical details are described in
the SIGEx User Manual.

Familiarize yourself with the purpose of each of the input and output connections, and the
three-position toggle switch. Counting from the top, these are:
 FS: frame synchronization, a signal which indicates the end of each data frame.

 Vin:: the analog signal to be encoded.

 PCM DATA: the output data stream, the examination of which forms the major part of this
experiment.
 CLK: this is a TTL (red) input, and serves as the MASTER CLOCK for the module. Clock rate
must be 20 kHz or less. For this experiment you will use a 10kHz TTL signal from the PULSE
GENERATOR module.

PCM time frame

Each binary word is located in a time frame. The time frame contains eight slots, with one
clock period per slot. These slots hold the bits of a binary word, numbered 7 through 0, from
first to last. The least significant bit (LSB) is contained in slot 0.

1-42 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Equipment

 PC with LabVIEW Runtime Engine software appropriate for the version being used.
 NI ELVIS 2 or 2+ and USB cable to suit

 EMONA SIGEx Signal & Systems add-on board


 Assorted patch leads
 Two BNC – 2mm leads

Procedure
Part A – Setting up the NI ELVIS/SIGEx bundle

44. Turn off the NI ELVIS unit and its Prototyping Board switch.

45. Plug the SIGEx board into the NI ELVIS unit.

Note: This may already have been done for you.

46. Connect the NI ELVIS to the PC using the USB cable.

47. Turn on the PC (if not on already) and wait for it to fully boot up (so that it’s ready to
connect to external USB devices).

48. Turn on the NI ELVIS unit but not the Prototyping Board switch yet. You should observe
the USB light turn on (top right corner of ELVIS unit).The PC may make a sound to indicate that
the ELVIS unit has been detected if the speakers are activated.

49. Turn on the NI ELVIS Prototyping Board switch to power the SIGEx board. Check that
all three power LEDs are on. If not call the instructor for assistance.

50. Launch the SIGEx Main VI.

51. When you’re asked to select a device number, enter the number that corresponds with
the NI ELVIS that you’re using.

52. You’re now ready to work with the NI ELVIS/SIGEx bundle.

53. Select the EXPT 13 tab on the SIGEx SFP.

Note: To stop the SIGEx VI when you’ve finished the experiment, it’s preferable to use the
STOP button on the SIGEx SFP itself rather than the LabVIEW window STOP button at the
top of the window. This will allow the program to conduct an orderly shutdown and close the
various DAQmx channels it has opened.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-43
The experiment

We are now ready to proceed. Note that the PCM ENCODER is the only module used in
Part 1.

It is not necessary to become involved with how the PCM ENCODER module achieves its purpose.
What will be discovered is what it does under various conditions of operation.

PCM encoding and quantisation


Examination with DC input
We begin with some basic aspects of the analog to digital conversion process. For this purpose
we will use a constant (DC) analog input. This ensures completely stable oscilloscope displays,
and enables easy identification of the quantizing levels.

54. Patch the PCM ENCODER as shown in Figure 2.

Figure 2:patching diagram for PCM ENCODER

Settings are as follows:


PULSE GENERATOR: 10,000 Hz with DUTY CYCLE=0.5 (50%)
SCOPE: Timebase 2ms; Rising edge trigger on CH0; Trigger level=1V

Zero input to PCM ENCODER

55. connect the PCM INPUT terminal to a GND terminal on the SIGEX board.

56. display FS on CH0. Adjust the timebase to show three frame markers. These mark the
end of each frame, that is, the last bit of the frame.

57. display the CLK signal on CH1.

Question 15
Record the number of clock periods per frame.

1-44 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Question 16
Currently the analog input signal is zero volts (since INPUT is grounded). Before checking with
the scope, consider what the PCM encoded output might look like. Can you assume that it will be
00000000?. What else might it be, bearing in mind that this PCM ENCODER outputs offset
binary format.

Question 17
On CH1 display the signal at PCM DATA output.The display should be similar to that in Figure 3
(possibly with fewer frames). Is it in agreement with your expectations?

The same codeword appears in each frame because the analog input is constant. This codeword
represents the 8-bit binary output number, corresponding to the zero volt analog input.

Figure 3: PCM Encoder input and output signals

Confirm the following three points:

1. the number of slots per frame is 8

2. the location of the least significant bit is coincident with the end of the
frame
3. the binary word length is 8 bits

Variable DC input to PCM ENCODER

58. remove the ground connection, and connect the INPUT to output of the ANALOG
OUTPUT: DAC 1. This programmable output is set to be a VARIABLE DC voltage, which is
controlled from the control on the Lab13 TAB on the SIGEX SFP. Sweep the DC voltage slowly

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-45
backwards and forwards over its complete range, and note how the data pattern within each
frame changes in discrete jumps.

Question 18
Adjust VARIABLE DC to its maximum negative value. Record the DC voltage and the pattern of
the 8-bit binary number.

Question 19
Slowly increase the amplitude of the DC input signal until there is a sudden change to the PCM
output signal format. Record the format of the new digital word, and the input DC voltage at
which the change occurred. Use the INCREMENT arrows on the digital value entry box for a
steady stable increase in DC value.

59. continue this process over the full range of the DC supply. Note a selection of DC
voltages and corresponding binary output words in the table below.

Table 3: DC VOLTAGE input vs. PCM codewords

DC VOLTAGE (V) 8 bit PCM codeword

1-46 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
60. draw a diagram showing the quantizing levels and their associated binary numbers in the
graph below.

Graph 2:DC to binary word plot

Review of the 8-bit data format

Question 20
On the basis of your observations so far, provide answers to the following:

* what is the sampling rate ?


* what is the frame width ?
* what is the width of a data bit ?
* what is the width of a data word ?
* how many quantizing levels are there ?
* are the quantizing levels uniformly (linearly) spaced ?
* what is the the minimum quantized level spacing ? How does this compare to theory ?

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-47
Question 21
The relationship between the sampled input voltage and the output codeword has been
described above. Suggest some variations of this relationship that could be useful ?

Working with periodic signals

In this section we consider the challenge of generating a stable display of the encoded output
with a conventional scope when a periodic input signal is used. Carry out the three tasks below
to see the problem.

This difficulty does not arise if you have access to an instrument with signal capture capability,
such as a digital scope. You can use the RUN/STOP button on the SFP to hold a single screen
display of the data when necessary.

In Part 2 this issue is further examined when we display the reconstructed signal at the
decoder output.

61. Take a periodic signal from the ANALOG OUTPUT: DAC0 terminal.

Question 22
Adjust the scope to display this waveform. Record its shape and frequency. Check whether
this conforms with the Nyquist criterion. Show your reasoning.

62. Display the PCM DATA output on CH1. Again, synchronize the scope to the frame signal
FS. Display two or three frames on CH1. Notice how they differ as expected.

63. Move the scope lead from the FS and view the INPUT signal on CH0. You are now viewing
the input sinusoid as well as the output codeword as in Figure 4. Freeze the display occasionally
(using RUN/STOP) and look at the relationship between input and output. See if you can see the
pattern.

1-48 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Figure 4: input and output from PCM ENCODER

PCM decoding and reconstruction

In this part we proceed with the decoding 4 of the output of the PCM ENCODER to reconstitute
the analog input. Before proceeding with the experiment tasks, we briefly review the
OPERATION of the DECODER.

PCM DECODER

The operation of the PCM DECODER module is as follows:


 a frame synchronization signal FS is received from the transmitter.

 the binary number representing the coded (and quantized) amplitude of the sample from
which it was derived, is extracted from the frame.

 the quantization level represented by the input codeword is determined.

 a voltage proportional to this amplitude level is generated.


 this voltage appears at the output terminal OUTPUT for the duration of the respective
frame.

 signal reconstruction is completed by lowpass filtering, as seen in Lab 12. A built-in


reconstruction filter is not provided in the module so that you can see the quantization
steps in the output. The recovered signal will not be identical to the original due to
quantizing. Other imperfections may be due to aliasing distortion, as already considered in
Lab 12.

The DECODER is driven by an external clock which must be synchronized to that of the
ENCODER. It is possible to “embed” the frame sync signal into the data, but this feature is
outside the scope of this lab and is not included in the functionality of the SIGEx board 5.
An alternative to automatic frame synchronization is to steal the synchronization signal, FS,
from the PCM ENCODER module. Use of this signal would assume that the clock signal to the
PCM DECODER is of the correct phase. This is assured in this experiment, but would need

4
it is common practice to refer to demodulation from analog signals, and decoding from digital signals.
5
This feature is available on the EMONA DATEx Telecommunications Trainer board for NI ELVIS

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-49
adjustment if the PCM signal is transmitted via a bandlimited channel. Hence the use of
embedded frame synchronization information in some systems.

The front panel of the DECODER module is shown in Figure 3. Technical details are described in
the SIGEx User Manual.

Figure 5: Layout of the PCM DECODER

The following is a summary of the input and output connections :


 FS: connect an external frame sync. signal here

 PCM DATA: the PCM signal to be decoded is connected here.

 OUTPUT: the decoded signal.

 CLK: this is a TTL (red) input, and serves as the CLOCK for the module. Clock rate must be
20 kHz or less. For this experiment you will use the same clock as used for the PCM
ENCODER.

Figure 6: PCM Encoding and decoding patching diagram: input from DAC 0.
TLPF serves as recontruction filter

Decoder Experiments

1-50 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
64. The PCM ENCODER provides the digital input for the DECODER. Patch together as
shown in Figure 7.
Settings are as follows:
PULSE GENERATOR: 10,000 Hz with DUTY CYCLE=0.5 (50%)
SCOPE: Timebase 20ms; Rising edge trigger on CH0; Trigger level=1V
TUNEABLE LPF: Fc set to max, GAIN set to max.

65. Connect CH1 of the SCOPE SELECTOR to the OUTPUT of the PCM DECODER, and CH0
to the INPUT signal at the ENCODER. Trigger the SCOPE on the INPUT signal. Your display
should resemble Fig. 7.

Figure 7: input and output signals

The recovered analog signal & reconstruction

In this section we use a periodic signal to observe the quantized appearance of the decoder
sample-hold output.The internal DAC output implements a “zero-order hold” operation, in that it
holds the value for a complete clock period. This has an inherent filtering effect, prior to any
reconstruction filtering.

The OUTPUT signal is distinctly different from the input signal. The output is only updated once
every frame, hence there is a large step change between output samples. This difference is
known as “sampling distortion”.

As well the “granularity” of the output only having 256 possible levels will contribute some
error, known as “quantizing distortion”, however, it is not easily observable with this input signal.
In the previous section you will have calculated the step size due to quantization by the encoder.

You can see, qualitatively, that the stepped output signal bears a resemblance to the input. We
saw in Lab 12 that the use of a lowpass filter made it possible to smooth out the steps. The
need for pulseshape equalization in the form of so called “x/sinx” correction was also mentioned
there.

Question 23

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-51
Momentarily, vary the clock rate from 10,000 to 20,000 Hz. How does this affect the “sampling
distortion” viewable in the output signal ?

An interpolation LPF is provided in the TUNEABLE LPF block.

66. Adjust the TUNEABLE LPF in the output path of the PCM DECODER to vary the filters
corner frequency, and observe the reconstructed signal. Adjust the TUNEABLE LPF GAIN
control to set the output signal to the same amplitude as the input. This makes the overall
conversion gain equal to unity. The PCM DECODER does not have the same conversion gain as the
ENCODER.

Question 24
View the input to the TUNEABLE LPF, ie the output of the PCM DECODER and compare with the
INPUT sinusoid. What is the gain of the PCM DECODER itself.

Again viewing the output from the TUNEABLE LPF, which is acting as the reconstruction filter,
slowly reduce the Fc until the steps are eliminated, and the original signal is recovered.

Question 25
Can you explain the source of the delay between input and output signals ? Both with and
without the TUNEABLE LPF ?

Question 26
Momentarily, vary the clock rate from 10,000 to 20,000 Hz. How does this affect the required
Fc needed to recover the signal without distortion ?

1-52 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Tutorial Questions

Q6 from your knowledge of the PCM ENCODER module, obtained during preparation for the
experiment, calculate the sampling rate of the analog input signal. What can you say
about the bandwidth of an input analog signal to be encoded ?

Q2 define what is meant by the data ‘frame’ in this experiment. Draw a diagram showing the
composition of a frame for the 8-bit coding scheme

Q7 quantizing distortion decreases as the number of quantizing levels is increased. Explain why
an excessive increase of the number of quantizing levels may incur a bandwidth
penalty: describe how to manage this trade-off. Look up Shannon's formula and
show how it relates to this trade-off. Explain whether this issue could be observed
in this lab ?
Q8 explain why a DC input provides a stable display of the PCM DATA output on a conventional
scope. Why is the display ‘unstable’ when the input is a sine wave (for example) ?
Q9 look up “two’s complement” encoding and find out a field of application where it is used.
What is the advantage of “offset binary” encoding used in this lab? Devise or look
up a method to convert from offset binary to two’s complement.

Q10 carry out a brief internet search of the principles and applications of companding. Compile
a summary of its advantages. Compare this with published information about the ‘A’
and ‘’ companding laws used respectively in Europe and the USA.
Q11 two sources of distortion in the reconstructed message have been identified; they were
called sampling distortion and quantizing distortion.

a) assuming a sample-and-hold type sampler, what can be done about minimizing


sampling distortion ?

b) what can be done about minimizing quantizing distortion ?

Why is “x/sinx” correction required with sample-hold interpolation? (Refer to Lab


12)
Q12 describe how to determine the specification for the reconstruction filter used in the
decoder ?

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-53
1-54 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Experiment 8 – A Fourier Series analyser

Achievements in this experiment

Compose arbitrary periodic signals from a series of sine and cosine waves. Confirm the Fourier
Series equation. Compute fourier coefficients of a waveform. Build and use a Fourier Series
analyser. Demonstrate that periodic waveforms can be decomposed as sums of sinusoids.
Introduce complex notation.

Preliminary discussion

In Lab 3 we discovered that sinewaves are special in the context of linear systems (time
invariance assumed). Unlike other waveforms, a sinewave input emerges at the output as a
sinewave. We saw in Lab 4 that this makes it possible to completely characterize the behaviour
of a system in this class by simply measuring the output/input amplitude ratio and the phase
shift of the sinewave as a function of frequency.

Now, this is fine if we only need to process sinewaves -- is it feasible to make use of this when
dealing with other kinds of inputs ? For example, when the input is a waveform like the
sequence of digital symbols we investigated in Lab 4.

One possibility is to see whether a non-sinusoidal waveform could be expressed as a sum of


sinewaves, over a suitable frequency range, either exactly, or even approximately. If this could
be done, the system output can then be obtained by exploiting the additivity property of linear
systems, i.e., first obtain the output corresponding to each sinusoidal component of the input
signal, then take the sum of the outputs. This was covered in Lab 4.

In this Lab we explore this idea by means of an ancient technique based on the generation of
beat frequencies -- somewhat like when a musician uses a tuning fork. We will begin by adding
together many beat frequencies and view the resulting waveform. From there we will look at the
equations and use what we know from trigonometry to decompose waveforms into their
constituent components.

Pre-requisites:
Familiarization with the SIGEx conventions and general module usage. A brief review of the
trigonometry required will be covered as needed.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-55
Equipment

 PC with LabVIEW Runtime Engine software appropriate for the version being used.

 NI ELVIS 2 or 2+ and USB cable to suit


 EMONA SIGEx Signal & Systems add-on board
 Assorted patch leads

 Two BNC – 2mm leads

Procedure

Part A – Setting up the NI ELVIS/SIGEx bundle

67. Turn off the NI ELVIS unit and its Prototyping Board switch.

68. Plug the SIGEx board into the NI ELVIS unit.

Note: This may already have been done for you.

69. Connect the NI ELVIS to the PC using the USB cable.

70. Turn on the PC (if not on already) and wait for it to fully boot up (so that it’s ready to
connect to external USB devices).

71. Turn on the NI ELVIS unit but not the Prototyping Board switch yet. You should observe
the USB light turn on (top right corner of ELVIS unit).The PC may make a sound to indicate that
the ELVIS unit has been detected if the speakers are activated.

72. Turn on the NI ELVIS Prototyping Board switch to power the SIGEx board. Check that
all three power LEDs are on. If not call the instructor for assistance.

73. Launch the SIGEx Main VI.

74. When you’re asked to select a device number, enter the number that corresponds with
the NI ELVIS that you’re using.

75. You’re now ready to work with the NI ELVIS/SIGEx bundle.

76. Select the Lab 8 tab on the SIGEx SFP.

Note: To stop the SIGEx VI when you’ve finished the experiment, it’s preferable to use the
STOP button on the SIGEx SFP itself rather than the LabVIEW window STOP button at the
top of the window. This will allow the program to conduct an orderly shutdown and close the
various DAQmx channels it has opened.

1-56 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
The experiment

Part 1 – Constructing waveforms from sine & cosines

A simple sinusoid with zero phase can be represented by the equation

(Eqn 1)

And a cosinewave with a frequency of n times can be simply represented by the equation

(Eqn 2)

Any wave which is an integer multiple of another frequency is known as a harmonic of the
frequency. So equation 2 represents the harmonics of the signal in equation for n >1.
We can use the “harmonic summer” simulation in Experiment TAB 8 to view and sum multiple
signals which are harmonics of the fundamental signal ie: the signal for n=1. Harmonics for which
n is even are known as even harmonics, and when N is odd are called odd harmonics. This
simulation allows us to view and sum any sinusoid for which 1 <= n <= 10, that is, the fundamental
and nine harmonics. The numeric entry boxes allow you to enter the amplitude of each sinusoid.

77. Experiment a little by entering various amplitudes into the numeric entry boxes for the
cosine row. Confirm for yourself visually that what is displayed is as you would expect.

78. Set all amplitudes to zero, except for the “1 st” component, the fundamental, which you
can set to 1. Moving from the second to the ninth sequentially, set each amplitude to the equal
to 1. As you do this notice how the combined signal is changing. Do this for the cosine row ONLY
at this point.

Question 27
How would you expect the summation of to look if you could add up many more harmonics ?

Question 28
What is its peak amplitude and is this as expected ?

Question 29
Is the fundamental an odd or even function ? Is the summation odd or even ?

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-57
Question 30
Write the equation for the summation of the 10 signals ? Is it symmetrical about the X axis?

Question 31
Vary the amplitudes and notice how the signal changes . You may set the amplitude of certain
components to 0 as you see fit. Can you create a wave form which starts at a zero value ?
Write the equation for your new varied amplitude signal ? Does it start at a zero value ?

79. Sketch your arbitrary wave form, for which you have just written the equation, below.

Graph 1: sine wave summation

1-58 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
The general form of the equation for the summation of cosine harmonics is as follows:

where are the amplitude values of each cosine wave.

80. Set all cosinewave amplitudes equal to 0 and now set the sine waveform amplitudes equal
to 1, starting from the first harmonic and moving sequentially until the 10th harmonic. Notice
how the summation changes as you add harmonics.

Question 32
How would you expect the sine summation of to look if you could add up many more harmonics ?

Question 33
What is its peak amplitude and is this as expected ? Is this an odd or even function ?

Question 34
Vary the amplitudes and notice how the signal changes . You may set the amplitude of certain
components to 0 as you see fit. Can you create a wave form which starts at a non-zero value ?
Write the equation for your new varied-amplitude signal ? Does it start at a non-zero value ? Is
it symmetrical about X axis.?

The general form of the equation for the summation of sine wave harmonics is as follows:

where are the amplitude values of each sine wave.

The general form for the summation of both sine and cosine harmonics is:

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-59
Even functions are symmetrical about the Y axis.
Odd functions are not symmetrical about the Y axis, but appear to be inverted about the X axis
on the negative side of the Y axis.

Sine and cosine waves, as well as their sums of sine and cosines, are always symmetrical about
the X axis. Being symmetrical means that they cannot represent a DC offset. In order to have a
DC offset we must add a constant to the equation.

81. Add a DC component to the signal by inputting the value into the DC numeric entry box ?

Let us add a value a0 to represent that constant and the general equation for our arbitrary
wave form becomes

where N is max number of harmonics present. In our experiment above, N=10.

This equation describes any arbitrary wave form with the proviso that it is periodic. Any
periodic waveform, no matter how complicated, can be represented by the summation of many
simple sine and cosine waveforms. This equation is known as the Fourier series equation,
naturally enough named after Jean Baptiste Joseph, Baron de Fourier, 1768 – 1830.

Figure 1: Portrait of Joseph Fourier

Let us have a further look at this important equation.

When N equals one, this frequency known as the fundamental frequency, is also called the
resolution frequency. Being the smallest frequency in this series it defines the minimum
separation between components in a particular waveform.

In the Fourier series equation above we have grouped waves in terms of whether they are sine
or cosine waveforms. Let us now modify this equation and group individual components by their
harmonic number. This is easy enough and is as follows

1-60 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Grouping in this way allows us to think of each frequency as having both a sine and cosine
component.
Let us have a quick revision of what adding a sine and a cosine of the same frequency together
may result in.

82. Using the “harmonics summer” simulation in the Experiment 8 TAB of the SIGEx SFP,
set all amplitudes including that of the DC equal to 0. Set the amplitude of the sine and cosine
first harmonic equal to 1. View the resulting summation.

Question 35
Write the equation for the summation of these 2 waves ? Write the equation for the summation
in terms of the sine wave with a non zero phase shift.

83. Vary the amplitudes from 0 to 1 and notice how the signal changes .

Question 36
Describe how the summation changes as you vary the respective amplitudes?

Question 37
For a particular pair of amplitudes you have set, write the equation for the summation in terms
of sine and cosine as well as its equivalent polar representation ?

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-61
84. Sketch a vector or for phasor representation of these two signals and their resulting
summation, known as the resultant.

Graph 2: components & resultant

For each harmonic, nwt, a signal may have a sine and cosine component, implemented by their
own respective amplitude, an and bn. It is helpful to think about these component pairs as a
single entity at a particular frequency. The only difference between them being their respective
amplitude and the respective orientation or phasing. We know that a sine wave is 90° out of
phase with a cosine wave, a quality which makes those two components orthogonal to each other.

By orthogonal we mean that they operate independently of each other. And so we need a
notation and document these two-dimensional pair of components and this notation is provided
to us by Euler with his famous equation:

Where j the notes the component at 90° out of phase with the other component, hence the sine
and cosine pair.

1-62 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Hence we can replace all sine/cosine pairs at a particular harmonic n with the complex
exponential function ejnwt, and in this way the Fourier series can be rewritten as

where Cn represents the resultant from the pair of respective amplitudes for the sine and
cosine components. ie: Cn2 = bn2 + an2, and is known as the “complex fourier series”.

Euler's formula allows us to process the sine/cosine component pair , simultaneously, rather
than individually. It is a form of two-dimensional notation where the sine and cosine components
for a frequency are instead treated together as a resultant with particular phase ie polar
notation. This notation is known as “complex” notation and was introduced in the previous
experiment, Experiment 7.

Remember that the practical part of this experiment just completed above shows us how a
resultant waveform is represented by two orthogonal components.

Part 2 – Computing Fourier coefficients

In the previous part of this experiment we discovered that we can construct any arbitrary
periodic waveform by the summation of a number of sine and cosine harmonics. This knowledge
is the basis of signal synthesis and in this part of the experiment we will do the reverse
process, that is, the analysis of an arbitrary wave form to discover the presence and amplitude
of its constituent harmonics. We call these amplitudes the Fourier coefficients of the waveform
as they are the coefficients within the Fourier series equation we have just derived.

Armed with only some basic trigonometry we will now explore some more qualities of sinusoids.
Before we create our arbitrary wave form to be analysed let us determine some rules with
which we can build our analyser.

We know that the area under a sine wave or a cosine wave over a timeframe of one period will
always be equal to 0. Consequently we know that the area under a sine wave or cosine wave for a
timeframe of any number of periods will also be equal to 0. To determine the area
mathematically we would integrate over the timeframe of interest. This process would give us
the average value of the signal during that time. This average value is the DC component of the
signal.

Figure 2: model for integrating one period of a sinusoid

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-63
The INTEGRATE & DUMP module can be used to integrate over a single period as denoted by
the input clock. This is well suited to integrating periodic waveforms such as sinusoids and
products thereof.

In this next exercise we will integrate a sinusoid over a single period to prove the assertion that
the area under a sine wave or a cosine wave over a timeframe of one period will always be equal
to 0.

85. Connect the model as per Figure 2 above. The clock connection is necessary for this
module, unlike for the continuous time INTEGRATORS on the SIGEx board.

Settings are as follow:


SCOPE: Timebase: 4ms; Trigger on Ch0; Connect Ch0 to CLK input; Level=1V
FUNCTION GENERATOR: Select SINE output, AMPLITUDE = 4vpp, FREQUENCY=1kHz
Refer to the SIGEx User Manual for instructions on how the I&D and I&H functions work if
this is not obvious. NOTE: The I & D period is from positive clock edge to positive clock edge.

Question 38
What is the output value at the end of the integration period ? HINT: the I&H function will
hold the final value.

86. While viewing the I&D output, to broaden your understanding of the integration process,
change the incoming signal from sine to triangle to bipolar squarewave at the FUNCTION
GENERATOR VI and confirm that the integrated output is as you would expect over one period.
You should be able to confirm that integration is the accumulation of the total signal charge,
with positive signals adding to the total, and negative signals subtracting from the total.

DC extraction using LPF

Another way of extracting the DC component of a signal is by using a filter which is tuned to a
sufficiently low-frequency to exclude all harmonics except for the DC component. The
integration process you have just explored is also a form of filtering, (as discussed in
Experiment 6 on matched filtering.) We will use the filtering method next.

Note that in this next part of the experiment the signals we are using are generated from data
arrays in LabVIEW and output in a synchronized manner from the ANALOG OUT terminals
DAC-0 and DAC-1.These signals are thus synchronized to each other, just as they appear on
screen and in the textbook.

87. Using the left hand side of Experiment 8 TAB of the SIGEx SFP, select a sine wave , 1st
harmonic. Connect DAC-1 to the input of the TUNEABLE LPF and view both input and output
with the scope.
Settings are as follow:
SCOPE: Timebase 4ms; Rising edge trigger on CH0; Trigger level=0V
TUNEABLE LPF: GAIN=mid position

1-64 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Adjust the frequency control, fc, of the TLPF from fully clockwise moving counterclockwise
until the output signal is a DC value of approximately 0 V.
Try this test for several harmonics. Change the “sine harmonic” value to 2,3 or 5 etc to try this.

INSIGHT 1: average value of an integral number of periods of sine or cosine waves equals zero.

Note that as far as the filter is concerned a single cosine wave is the same as a sine wave, so
Insight 1 holds true for both. You can vary the phase of the sinewave out of DAC-1 using the
“sine phase” control. The signal out of DAC-0 remains constant as a cosine wave.

88. Set the “sine harmonic “ value back to 1. Set “sine phase” to 0. View DAC-1 with CH1
and DAC-0 with CH0.
Settings as follows:
SCOPE: Timebase 4ms; Rising edge trigger on CH0; Trigger level=0V
DAC-1 will be a sine wave and DAC-0 a cosine wave, relative to each other.
Connect as shown in the figure below. View the output of the MULTIPLIER as well as the output
of the TUNEABLE LOW PASS FILTER.

Figure 3: comparing sinusoids

You will now multiply a sine wave by a cosine wave and determine its average value.
Repeat this with the second and third harmonic of the sinusoid.

Question 39
What is the average value of these three products ?

INSIGHT 2: average value of an integral number of products of any sine or cosine harmonics
equals zero.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-65
89. Set the “sine harmonic “ value back to 1. Set “sine phase” to 90. View DAC-1 with CH1
and DAC-0 with CH0.
Settings as follows:
SCOPE: Timebase 20ms; Rising edge trigger on CH0; Trigger level=1V

DAC-1 will now be a cosine wave and so will be DAC-0.


NB: This is relative to the start of the signal data array. See the ANALOG OUT VIEWER
window for confirmation.
Connect as shown in the figure above.
View the output of the MULTIPLIER as well as the output of the TUNEABLE LOW PASS
FILTER with the scope.

You will now multiply a cosine wave by itself and determine its average value.

Question 40
What is the average value of the product of a cosine by itself ?

INSIGHT 3: average value of an integral number of products of any sine by its harmonic equals
zero.

INSIGHT 4: average value of an integral number of products of any sine by itself equals a non
zero value.The same holds for cosine.

Question 41
Write the complete formula for the product of a cosine, Acoswt, by itself? What do the terms
represent?

At this point we can see that the only product to yield a non-zero average value is that of a sine
wave by the same sine wave. The same is true for cosine. So if we multiply an arbitrary
waveform by a particular “probing” sine or cosine harmonic and extract the average value of this
product there will only be non-zero when that arbitrary wave form contains that particular
“probing” harmonic as one of its constituent components. This is a very powerful insight and
allows us to have a simple tool with which to analyse arbitrary wave forms.
Let us now give this a try.

90. Construct the following arbitrary wave form using the HARMONIC SUMMER on the
right hand side of the SIGEx SFP, Experiment 8 TAB.
Settings are as follows :
Cosine amplitudes: 1, 0, 0.5,0,0,1,0,0,0,0
Sine amplitudes: 0,0.3,1,0,0,0,2,0,0,0
DC level: 0.5

1-66 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Switch “to DAC-0” ON: This will output the summation to DAC-0. See the ANALOG VIEWER
window.
Set “sine harmonic” =1; Set “sine phase = 0. This signal is output to DAC-1.
SCOPE: Timebase 4ms; Rising edge trigger on CH0; Trigger level=0V

Figure 4: comparing sinusoids

91. You will need to now ensure that the overall gain of the MULTIPLIER and TLPF is unity.
We know from the User Manual specifications that the MULTIPLIER gain is approximately
unity, whereas the TLPF GAIN is variable. Connect both MULTIPLIER inputs to the same 1st
harmonic sinewave and view the output. While viewing the TLPF output, turn the fc control
clockwise to pass the entire signal. Adjust the TLPF gain precisely for a 4Vpp output, so as to
have unity gain throughout the “analyser” path.

92. Return to your previous setup but do not touch the TLPF GAIN setting for the rest of
the experiment. At this point we are multiplying the arbitrary wave form which investigated by
a first harmonic sine wave.

Figure 5: example of SIGEx SFP Tab “Lab 8” including


harmonic generator bottom left, and summer on the right

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-67
93. View the product at the output of the multiplier on CH0 and the TLPF output. Adjust
the TLPF frequency control to isolate the DC component. Note the value of the DC level as the
amplitude of the first harmonic sinusoid in the table below. Increase harmonics one by one,
adjust theTLPF frequency setting if necessary and note the amplitude for the remaining 10 sine
harmonics in table.

Now to analyze for the cosine components.

94. Set “sine harmonic” back to 1. Change “sine phase” to 90. This will convert the sine wave
into a cosine wave , as sin(wt + 90) = cos(wt). Repeat the above steps to all 10 cosines and enter
your measurements of the TLPF DC output level into the table .

Harmonic sine cosine


number (V) (V)

1st

2nd

3rd

4th

5th

6th

7th

8th

9th

10th

DC (V) =

Table of measured coefficients

95. Connect the input of the TLPF directly to the arbitrary wave form at DAC-0 to measure
the DC value of that waveform alone, and enter into the table at “DC (V) = “.

Question 42
How do your readings compare with expectations ? . Explain any discrepancies .

1-68 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
96. While you have the experiment setup, vary the harmonic summer settings and see the
resulting output from the TLPF. Experiment a little with values while you have the system setup
and ready.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-69
Part 3 – Build a manually swept spectrum analyzer

In the previous part of this experiment we use synchronised signals which were generated in
LabVIEW and output via the DACs of the ANALOG OUT module. In this part of the experiment
we will analyse the constructed arbitrary signal using an independent sinusoid generator, that is,
the FUNCTION GENERATOR.

Figure 6:building a “wave analyzer”

97. Once again construct the following arbitrary waveform using the HARMONIC SUMMER
of the SFP, Experiment 8 TAB. Launch the FUNCTION GENERATOR as well.
Settings are same as above, and are as follows :
Cosine amplitudes: 1, 0, 0.5,0,0,1,0,0,0,0
Sine amplitudes: 0,0.3,1,0,0,0,2,0,0,0
DC level: 0.5
Switch “to DAC-0” ON
SCOPE: Timebase 20ms; Rising edge trigger on CH0; Trigger level=0V
FUNCTION GENERATOR: Frequency=1000Hz, Amplitude=4Vpp, Sine wave selected

98. Move the input to the multiplier which was connected to DAC-1 to the FUNC OUT
terminal of the FUNCTION GENERATOR . This signal will be a 4Vpp sine wave at 1000 Hz. View
both inputs to the multiplier on the scope. One is the arbitrary waveform, the other is the 1000
Hz sine wave.

Question 43
What do you notice about their phase relationship ? Is this to be expected ? Explain.

If the inputs are drifting relative to each other then you would expect the product of the
inputs to also be slowly varying.

99. View the sinusoid and the product, output of the multiplier, at the same time and
confirm that it is slowly varying. Trigger the SCOPE on the sinusoid to get a more stable display.

As it varies it will pass through the point of interest, the interface point that we wish to
measure. This point occurs twice per cycle lasts creating both are maxima and minima. If we
detect either the maximum of the minima the absolute value of these will give us the average
DC value which we require.

1-70 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
You may wish to review your understanding of why these maximas and minimas occur when
signals drift relative to each other. You can use both trigonometry and/or the DAC outputs and
the MULTIPLIER module to revisit this topic.

100. Now view both the output from the FUNCTION GENERATOR and the output of the
TLPF. Adjust the frequency of the TLPF to isolate only the DC component and confirm that it
has a maxima and a minima. HINT: if the DC value is varying too slowly, or you are impatient, or
just inquisitive (…a good thing), increase the frequency at the function generator by 1 Hz. This
will make your DC value vary at a rate of approximately 1 Hz (…much easier to view).
Trigger on the sinewave from the FUNCTION GENERATOR for a stable display.

HINT: use Y-AUTOSCALE ON/OFF to center the display

101. Vary the frequency of the function generator in steps of 1000 Hz starting from 1000
Hz up to 7000 Hz. Note the maximum value of the DC output in the table below. It will be more
accurate to measure peak to peak and then halve it.These will be the measured amplitudes of
the constituent harmonics making out the arbitrary wave form. How do they compare with the
actual amplitude value entered into the SFP itself.?

HINT: to vary the FUNCTION GENERATOR Frequency, place the cursor alongside the digit to
be varied and then use the UP and DOWN keyboard arrows to vary the digit value.

Input TLPF output Half of Entered Calculated


frequency (Hz) pp swing (V) pp (V) values resultant (V)

1000

2000

3000

4000

5000

6000

7000

DC (V) =

Table of measured coefficients

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-71
Question 44
Can you explain if your readings differ in some places from the actual value ?

HINT: you have one value per harmonic instead of two. Consider the previous discussion above
about resultants in your answer. And allow for MULTIPLIER and TLPF gains (although you should
have set the overall gain to unity in an earlier part of the experiment).

Whilst the theoretical modeling with the synchronized sine and cosine waves from the previous
part is able to yield the constituent sine and cosine components, a real world signal without the
benefit of synchronization can only measure the resultant amplitude. This is shown in the
exercise just completed.

102. This section of the experiment was about building a manually swept spectrum analyser.
The function generator instrument has the ability to be automatically swept. As an exercise in
automation enter an appropriate start, stop frequency, say 1001 & 10001 Hz, as well as step size
of 1000 Hz and a step interval of 2 seconds and allow the function generator itself to sweep the
analysing frequency while you view the amplitude of the DC value from the analyser which
corresponds to the amplitude of each harmonic present. Display the FUNCTION GENERATOR
sinewave also, and trigger the scope on it for a stable display of 4Vpp. Set the AUTOSCALE to
OFF.
Congratulations, you have just constructed a swept spectrum analyzer using basic mathematical
blocks.

1-72 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Part 4 – analyzing a square wave

We will now use our manually swept spectrum analyser to investigate which harmonics at present
in a square wave. The experiment set up is as for the previous section except that now the input
is taken from the PULSE GENERATOR module output.

Figure 7: working with a square wave

103. Vary the patching as shown in figure 7 above


.
Settings are as follows:
FUNCTION GENERATOR: Frequency=1000Hz, Amplitude=2Vpp, Sine wave selected
PULSE GENERATOR: FREQUENCY=1000Hz, DUTY CYCLE=0.5 (50%)
SCOPE: Timebase 4ms; Rising edge trigger on CH1; Trigger level=0V

104. Vary the frequency of the function generator in steps of 1000 Hz starting from 1000
Hz up to 7000 Hz. (Remember, you can vary the input frequency by 1 or 2 Hz to speed up the
resultant DC oscillation display).Note also the maximum value of the DC output in the table
below. These will be the amplitudes of the constituent harmonics making up the squarewave. You
may know from theory that a square wave of 50% duty cycle contains only odd harmonics. This
can help you focus your investigation around the appropriate frequencies.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-73
Input TLPF output Scaled measured values Calculated
frequency (Hz) amplitude (V) (V) resultant (V)

1000

2000

3000

4000

5000

6000

7000

DC (V) =

Table of measured coefficients for squarewave

Question 45
Why are some of the harmonics hard to detect ?

Varying the duty cycle of the PULSE GENERATOR from the SFP control “DUTY CYCLE”, for
example to 0.2 (20%) will introduce even harmonics.

Question 46
Can you now detect even harmonics in the squarewave of 20% duty cycle ?

View the output from the MULTIPLIER to see what signal you are measuring and extracting the
DC value from.

1-74 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Comparing measured Fourier series coefficients to theory

From the theory the relative value of the Fourier series coefficients for a 50:50 square wave
is a series like so:

1, 1/3, 1/5, 1/7….1/n where n is the odd harmonic present in the squarewave.

Question 47
Compare your measured coefficients for the first 4 odd harmonics as ratios to that expected
by theory ? Remember to normalize the measurements for the comparison.

References

Langton.C.,”Fourier analysis made easy ”, www.complextoreal.com

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-75
1-76 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Experiment 14 – Discrete-time structures:

Finite Impulse Response (FIR) filters

Achievements in this experiment

You will be able to relate the response of a discrete-time (DT) FIR filter to its transfer
function. You will use the zeros of the transfer function to visualize frequency responses
graphically at a glance, without math. You will be able to use this knowledge to intuitively design
low order discrete-time responses. You will be ready to extend this concept to recursive DT
filters and to higher order applications.

Preliminary discussion

In Lab 11 we used poles and zeros as an intuitive aid in working with continuous-time filters. In
this Lab we apply the same idea for discrete-time applications. DT filters can be implemented
with or without the use of feedback. The latter filters are generally known as nonrecursive or
Finite Impulse Response (FIR).

The transfer function of a nonrecursive filter can be expressed as a polynomial. Since there is
no denominator, there are no poles, only zeros, which makes it simpler for getting started. As
with the continuous-time case, you can intuitively predict and track system responses from the
zeros.

The absence of feedback is an important advantage in many applications as there is no risk of


unstable behaviour. This is very useful when working with adaptive filters.

Serious practical realizations of FIR filters generally require a large number of delay elements.
The most demanding are the bandpass. However, the notch filter works well as a two-delay FIR
example. We will use this example here to examine the relationship between the frequency
response and the coefficient values through the interpretation of zero positions in the z plane.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-77
Preparation

This preparation provides essential theory needed for the lab work to make sense.

Question 48
Consider the system in Figure 1, where nT are the discrete-time points, with T sec denoting the
unit time delay, i.e. the time between samples. Show that the difference equation relating the
output y(nT) and the input u(nT) is

Y(nT) = b0.u[nT] + b1.u[(n - 1)T] + b2.u[(n - 2)T] (Eqn 1).

Show by substitution that ejnTω is a solution, i.e. show that when the input is ejnTω , y(nT) is ejnTω
multiplied by a constant (complex-valued); ω is the frequency of the input in radians/sec.

+
OUTPUT

b0 b1 b2

INPUT
UNIT UNIT
DELAY DELAY

Figure 1: schematic of FIR filter with two unit delays

In Lab 11 we used a complex exponential input to represent the behaviour of a system that is
supposed to operate with real-valued signals. You could consider using u[nT] = cos(nTω) or
sin(nTω) instead. However, the use of the exponential function simplifies the math
considerably. We have already seen that cos(ωt) is Re{exp(jωt)}, so, you can carry out the
analysis with ejnTω , then simply take the real part of the result. After a while, working with
complex exponential functions to represent sinusoids becomes second nature and we don't even
bother thinking about taking the real part. Many practical systems implemented digitally
actually operate with complex-valued signals, for example modulators and demodulators working
with quadrature signals.

From the above, with input u(nT) = ejnTω , show that

H = y/u = b0 + b1. e-jTω + b2. e-j2Tω (Eqn 2).

Note that H is not a function of n.

Question 49
Use this result to obtain a general expression for the magnitude of y/u as a function of ω. You
will need to first write down the real and imaginary parts.
Set T = 1 sec for the time being, and plot the result for the case b0 = 1, b1 = -1.3 ,
b2 = 0.9025 over the range ω = 0 to 2.π rad/sec. Label the frequency axis in Hz as well as
rad/sec. You should find there is a significant dip in the response near 0.13Hz.

Question 50

1-78 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
As in Lab 7, we consider an alternative way of getting frequency responses. We will create a
graphical medium to provide an intuitive environment for visualizing and generating both
magnitude and phase responses.

First, return to the expression for y/u obtained in (a) and replace "exp(jTω)" by the symbol "z".
Look upon z merely as a convenient macro for exp(jTω) . At this point there is no need to
ascribe any deeper significance to this substitution. The result is the (complex-valued)
polynomial

y/u = H(z) = b0 + b1.z-1 + b2.z-2 = z-2 . [b0. z2 + b1.z + b2 ] (Eqn 3).

For the case b0 = 1, b1 = - 1.3 , b2 = 0.9025 (from (Q2)), express the quadratic in the brackets in
the factored form (z - z1)(z - z2), where z1 and z2 are the roots. Show that these are given by

z1 = 0.95e j0.260π
z2 = 0.95e -j0.260π (Eqn 4).

Satisfy yourself that the magnitude response of H can be expressed as

|H(ω)| = |(ejT ω - z1)|.|(ejT ω - z2)| (Eqn 5).

Write down the corresponding expression for the phase of H.

Question 51: Graphical plotting of poles & zeros

We are now ready to proceed with a graphical approach for evaluating the factors (z - z1) and (z
- z2) in Eqn 3. Place an "o" on a complex plane (we will refer to this as the z plane) at the
locations corresponding to z1 and z2, as obtained in Eqn 4. With T = 1, we will get an estimate of
|H| at ω = π/5.

Place a dot at the point ejπ/6. Join this point and the point z1 with a straight line. The length of
this line is |(ejπ/5- z1)|.
Do the same with z2 to obtain |(ejπ/5 - z2)|. From Eqn 5, the desired estimate of |H(π/5)| is
simply the product of the lengths of these two lines.

Question 52
By repeating this for other values of ω we are able to get a quick estimate of the graph of |H|
versus ω. It's important to note that the locus of ejTω is a circle of unity radius centered at
the origin (known as the unit circle). Hence, the general shape of the frequency response is
easily estimated by simply running a point counter-clockwise along the circumference of the unit
circle, starting at (1, 0). Note that the idea is just a variant on the procedure introduced in Lab
11, where we moved the frequency point along the j axis. Compare the outcome with the result
computed in (Q2).

Notice that the presence of the trough in the response can be seen at a glance from the
behaviour of the vector from the "zero" z1 as the dot on the unit circle is moved near z1. By
comparison, the rate of change of the other vector is small over that range.

Question 53

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-79
Modify Fig 1 by replacing the unit delays with a gain of 1/z and show that Eqn 3 follows by
inspection using simple algebra, without the need to work through the difference equation step.
While this is only a minor simplification in this example, it is very useful in more complicated
cases, especially where feedback loops are involved.

Although z was originally introduced in (Q3) as just a substitution for ejTω, our interpretation
appears to have been extended in (Q4) to include any complex number. Consider whether this is
the case, and why.

Question 54
In the above example, we had the sample interval T = 1. Suppose T = 125 microsec. Adjust the
frequency axis for this value of T. Extend this result for any value of T. How are the zeros of
H(z) affected by the value of T? Why is it appropriate to use T = 1 normally?

Show that |H(ω)| is periodic, and determine the period in Hz.

1-80 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Equipment

 PC with LabVIEW Runtime Engine software appropriate for the version being used.

 NI ELVIS 2 or 2+ and USB cable to suit

 EMONA SIGEx Signal & Systems add-on board


 Assorted patch leads

 Two BNC – 2mm leads

Procedure
Part A – Setting up the NI ELVIS/SIGEx bundle

105. Turn off the NI ELVIS unit and its Prototyping Board switch.

106. Plug the SIGEx board into the NI ELVIS unit.

Note: This may already have been done for you.

107. Connect the NI ELVIS to the PC using the USB cable.

108. Turn on the PC (if not on already) and wait for it to fully boot up (so that it’s ready to
connect to external USB devices).

109. Turn on the NI ELVIS unit but not the Prototyping Board switch yet. You should observe
the USB light turn on (top right corner of ELVIS unit).The PC may make a sound to indicate that
the ELVIS unit has been detected if the speakers are activated.

110. Turn on the NI ELVIS Prototyping Board switch to power the SIGEx board. Check that
all three power LEDs are on. If not call the instructor for assistance.

111. Launch the SIGEx Main VI.

112. When you’re asked to select a device number, enter the number that corresponds with
the NI ELVIS that you’re using.

113. You’re now ready to work with the NI ELVIS/SIGEx bundle.

114. Select the Lab 14 tab on the SIGEx SFP.

Note: To stop the SIGEx VI when you’ve finished the experiment, it’s preferable to use the
STOP button on the SIGEx SFP itself rather than the LabVIEW window STOP button at the
top of the window. This will allow the program to conduct an orderly shutdown and close the
various DAQmx channels it has opened.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-81
Ask the instructor to check
your work before continuing.

1-82 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Experiment

Part 1 Notch filter using two-delay FIR:

We will be implementing the filter in Fig. 1. Figure 2 shows the SIGEx wiring diagram. The gains
b0, b1, b2 in the triple ADDER module realize the coefficients b0, b1, b2, respectively.

115. Patch up the SIGEx model in Fig. 2.


Settings are as follows:
ADDER gains: b0 =1.0; b1 = -1.3; b2 = 0.902
PULSE/CLK GENERATOR: 10 kHz, Duty cycle = 0.5 (50%)
FUNCTION GENERATOR: 1000 Hz; 4Vpp, Sinewave output selected
SCOPE: Timebase 4ms; Rising edge trigger on CH0; Trigger level=0V

View the input signal on CH0, and output with CH1. Check that the time interval between samples
is consistent with the clock frequency.

Figure 2: SIGEx wiring model of FIR filter with two unit delays

116. Measure and plot the magnitude response over the range 300 Hz to 3kHz using the
FUNCTION GENERATOR. Note that the amplitude measurement could be a little challenging
at the upper frequencies due to the increasing interval between samples relative to the signal
period. It is suggested you vary the timebase appropriately, and use the RUN/STOP and Y-
AUTOSCALE buttons when necessary to achieve a stable display.

Confirm that the response has a deep notch.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-83
Graph 3:response plot

Question 55
Measure the notch frequency and the depth relative to the response at DC. Also measure the
time delay as a function of frequency at several points of interest.

117. Using the values of b0, b1, b2 entered, apply the method developed in the preparation
section to plot the zeros of this filter in the z-plane. Check that you have the correct sign of
the coefficients (the zeros should be in the right half-plane). Compare the measured frequency
response with the plot of the zeros. Verify that the measured notch frequency agrees with the
position of the zeros (remember, the frequency at the 180 degree point on the unit circle
corresponds to f_sample/2 = 1/2T Hz).

118. Decrease the b1 gain slightly and observe the effect on the magnitude response.
Measure the new notch frequency. Use this to determine the new positions of the zeros and the
corresponding value of b1. Verify the agreement between measurement and theory.

Question 56

1-84 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Determine and note the new notch frequency, for the b1 gain entered. Document the
relationship between b1 and notch frequency

119. This time, reduce b2 gain very slightly (order of 2-3%, say) and again, observe the
effect on the magnitude response. The outcome should be a reduced notch depth. Try to
determine the approximate position of the zeros from the notch depth (notch depth relative to
DC gain, say).

Part 2 Using notch filter to eliminate interference

In the next exercise we use the notch filter to remove an interference tone. Consider this
practical situation: we are trying to receive a message at frequency f1 from a distant
transmitter, but in our neighbourhood there is another transmitter sending an unwanted signal
at frequency f2 affecting our reception of f1.

120. Keep the PULSE/CLK GENERATOR frequency at 10,000Hz and maintain the coefficients
values as for Part 1 of this experiment.

121. Use the ANALOG OUTPUT as a source of signals f1 ,and f2. Add these using the “f + g”
ADDER block to create f1 + f2 .
Confirm that DAC-0(f1 ) = 500Hz sinusoid, and DAC-1 ( f2 ) = 1300 Hz sinusoid.

122. View each output individually as well as the sum of the outputs. View them both in the
time domain as well as in the frequency domain.Show that the f2 signal can be suppressed with
the notch filter. Remember that the notch is set to 1.3kHz.

Question 57
What is the level of attenuation of the f2 signal for the original zero positions.

123. Vary the value of b1 slightly in each direction and notice the affect on the output.
Remember that b1 controls the frequency of the notch. This is a finding from a previous part of
this experiment.

NOTE: To vary the value of a control slightly, set the cursor next to the digit you wish to
vary and then use the UP and DOWN arrow buttons on the control.
As well, the GAIN ADJUST knob on the SIGEx board itself can be used to vary by hand
the coefficient value of the ADDER.

Question 58
From your previous findings in this experiment, what change is required to gain b1 to reduce the
notch frequency ?

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-85
124. View both the input two-tone signal on CH1 and the output signal from the notch filter
on CH0. In particular, view them on the FFT display of Lab14 SFP.

125. As well, switch between the Lab 14 TAB and the PZ PLOT TAB on the SFP while making
these adjustments. Notice how the zeroes move when b1 is adjusted. In particular, interpret
the notch frequency from the position of the zeroes. By entering the sample clock frequency
into the “clock freq” control on the PZ PLOT TAB, you can automate the calculation of the notch
frequency somewhat. Ensure you understand what is being calculated.

Figure: example of PZ PLOT TAB displaying a FIR structure. Zeroes only.

Remember that the POLE-ZERO PLOT is an essential diagram for interpreting frequency
response of a structure.

Question 59
What is the equation relating theta of the zero to the frequency of the zero, as implemented in
the PZ PLOT TAB ?

126. Vary the value of b1 until you eliminate the lower frequency component of the two-tone
message signal. You are exploring using the selectivity of a filter through variation of its
transfer function. Use both the FFT display on TAB14 and the PZ PLOT TAB during this process
so you develop an appreciation for the relatedness of these two different display
representations.

1-86 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Figure : Notch filter set to attenuate the lower component of the message

Question 60
For what value of b1 did you achieve the maximum attenuation of the lower message component
RELATIVE to the higher component ? What levels did you measure ?

127. Pass the notch filter output, which is sampled and discrete, through a reconstruction
filter such as the BASEBAND LPF to “clean up” the signal. Experiment again with the b 1
coefficient whilst viewing the now, continuous, output signal as you select between each message
component. See how “clean” a sinusoid you can recover. Experiment with attenuating both
components.

HINT: if using the GAIN ADJUST knob to control b1, you can set the available output range of
the knob so as to be able to “fine tune” your coefficient value by hand.

Question 61
What components is the TUNEABLE LPF attenuationg in order to give a “clean” signal ?

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-87
Tutorial Questions

Q 1. In Eqn 4 the zeros are complex conjugates. Examine other cases in this Lab
and consider whether this is a coincidence or an outcome of a general
property of FIR filters.

Q 2. Lowpass FIR filters are sometimes called moving average (MA) filters. Using
an example, explain the reason behind this.

Q 3. For the system in Prep (c) show that when b0 = b2 the zeros are on the unit
circle. Plot a graph of the frequency of the zeros versus b 1/b0. Tip: to fast
track the math, factor out z.
Interpret the result in the context of step 9.

Q 4. Consider a zero at the origin of the z plane. Show that its magnitude response
is constant and its phase response linear. Show that the factor z -2 in Equation
(3) generates a pair of poles at the origin. What is the effect of these poles
on the overall response H_y?

Q5. The z plane method generates frequency responses that are periodic. Is this
an artificial mathematical side effect resulting from the use of complex
variables, or does this reflect reality (refer to the Lab on sampling)?

Q. 6. Find the zeros for the following 4-delay FIR filters (hint: exploit the
symmetry)
(i) [1, 2sqrt2, 4, 2sqrt2, 1]

(ii) [1, -2sqrt2, 4, -2sqrt2, 1]


(iii) [1, 0, 0, 0, 1]

(iv) [1, 0, 1, 0, 1]
(v) [1, 0, 2, 0, 1]
(vi) [1, 1, 1, 1, 1] (hint: this is a geometric progression)

(vii) [1, sqrt3, 2, sqrt3, 1]

State the type of filter realized in each case (lowpass/ highpass/ other).
Compare cases (i) and (ii), and derive a rule of thumb for converting a lowpass
FIR filter to highpass (make reference to the coefficients and to the zeros).

Which of these is relevant to the implementations in step 12 and 15?


Confirm that in each case the zeros are on the unit circle. Is it a coincidence,
or is there a systematic property that these examples share?

1-88 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Q. 7. Show that the phase responses of the filters in Q.6 are linear.
Q. 8 In Prep (h) consider an alternative case: move the zeros at +/- 150deg to
180deg (the other zeros remaining fixed). What is the effect on bandwidth
and attenuation in the stop band? What is the result if all the zeros are
placed at 180deg?

Suppose the FIR has 48 zeros. Discuss alternatives for the design of a
lowpass filter: is it preferable to spread the zeros across the stopband or to
place all the zeros at 180deg?

Q 9. Find and plot the zeros for the coefficients in step 13. Note that the
transfer function is a truncated GP. Apply this to simplify the factorization.

Q 10. Write down the transfer function of a first-order continuous-time LPF. The
impulse response of this filter is a decaying exponential that can be matched
approximately to the unit pulse response of the FIR in step 13. Obtain the
time constant and pole of the CT LPF that matches the FIR. Estimate the
bandwidth of the CT filter. Compare this with the bandwidth of the FIR.

Q11. Show how an analog FIR can be implemented with short equal lengths of
coaxial cable as delay elements. Satisfy yourself that such a filter can be
used with continuous-time inputs, i.e., without sampling. On this basis we
should expect a transfer function in terms of the Laplace variable s. Obtain
such a transfer function for the case in prep (b) and show that it is a
quadratic in exp(-sT), where T is the delay of a cable element. Show that in
order to apply the graphical method for estimating responses, a z plane
representation is needed, with z = exp(sT). Filters of this kind were used
with early TV systems in the 1940's. The inventor was Kalmann (not to be
confused with Kalman filters in optimization theory).

Q12. Consider the periodicity issue in Q5 again, in the context of Q11. Satisfy
yourself that frequency responses of this continuous time system are also
periodic.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-89
1-90 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Experiment 15 – Poles and zeros in the z plane: IIR systems

Achievements in this experiment

You will be able to interpret the poles and zeros of the transfer function of discrete-time
filters to visualize frequency responses graphically at a glance, without math. You will be able to
use this knowledge to intuitively design recursive/IIR discrete-time responses.

Preliminary discussion

In Lab 11 we discovered how poles and zeros can be used as an intuitive tool for analyzing and
designing continuous-time (CT) filters. Next, in Lab 14 we examined discrete-time (DT) FIR
filters and found the same ideas could be applied there. The complex "s" plane was replaced
with the complex "z" plane, and the unit circle used instead of the j axis for the representation
of frequency. Because zeros only are involved in FIR filter work, this provided a convenient
gateway to getting started with z-plane ideas.

In this Lab we will investigate more general DT filters that are characterized with both poles
and zeros. These filters are known as recursive since they use feedback, and also as Infinite
Impulse Response (IIR). With feedback we will be able to realize much higher selectivity than
possible with a comparable complexity FIR implementation. The most conspicuous example is
the second-order resonator, which will open the way to achieving realistic bandpass responses.
As we proceed, we will find many parallels with the CT(continuous time) filter experiments in
Lab 11.

Part 1: we examine the behaviour of the basic second-order resonator implemented without
zeros.

Part 2: zeros are introduced to generate lowpass, bandpass, highpass and allpass responses
using the Direct Form 2 structure.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-91
Pre-requisite work:

This preparation extends the theory covered in Lab 14 to include poles.

INPUT x0 x1 x2
UNIT UNIT
DELAY T DELAY T
u

-a1

-a2

Figure 12: schematic of 2nd-order feedback structure without feedforward.

Question 62
Consider the feedback system in Figure 1.

Show that the difference equation relating the adder output x0(nT) and the input u(nT) is

x0(nT) = u[nT] - a1.x0[(n - 1)T] - a2.x0[(n - 2)T] (Eqn 1),


where nT are the discrete time points, T sec denoting the unit delay, i.e. the time between
samples.

Show by substitution that ejnTw is a solution, i.e. show that when x0(nT) is of the form ejnTw, the
input u(nT) is ejnTw, multiplied by a constant (complex-valued); w is the frequency of the
input in radians/sec; (the use of complex exponentials for the representation of sinusoidal
signals is discussed in Lab 8, 10 and 13.

From the above, with input u(nT) = ejnTw obtain

x0/u = 1/[ 1 + a1. e-jTw + a2. e-j2Tw] (Eqn 2).

Note that x0/u is not a function of the time index n.

Question 63
Use this result to obtain a general expression for |x 0/u| as a function of w.

1-92 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Tip: to simplify the math, operate on u/x0 instead of x0/u, expressing the result in polar
notation.

Set T = 1 sec for the time being, and plot the result for the case a1 = -1.6 , a2 = 0.902 over the
range w = 0 to π rad/sec. Label the frequency axis in Hz and in rad/sec. You should find there
is a peak in the response near 0.09Hz.

Graph 4:response plot

Question 64
Replace "exp(jTw)" by the symbol "z" in Eqn 2. The result is

H_x0(z) = x0/u = 1/(1 + a1.z-1 + a2.z-2 ) = z2 / ( z2 + a1.z + a2 ) (Eqn 3).

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-93
The quadratic ( z2 + a1.z + a2 ) can be expressed in the factored form (z - p1)(z - p2).

1-94 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-95
Figure 13: Notes on the graphical interpretation of pole-zero plots

1-96 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Reviewing the finding of roots of the quadratic polynomial

From equation 1 above


x0(nT) = u[nT] - a1.x1(nT) - a2.x2(nT) substituting x1=x0.z-1 and x2=x0.z-1.z-1 we arrive at
x0 = u –a1x0/z1 – a2x0/z2
Grouping x0 terms:
x0(1 + a1/z1 + a2/z2) = u

At this point we can see that although we started with negative gains in the circuit model, we now
have positive values as coefficients in the quadratic equation.

Further, we arrive at:


x0/u = z2/(z2 + a1z1 + a2) which we earlier named Eqn 3.
We now have the general quadratic form with positive coefficients.
INSIGHT: positive coefficients result in negative gains in the actual implementation

This quadratic (z2 + a1z + a2) can be expressed in factored form, as (z-p1)(z-p2)
Remember that z, p1 & p2 are complex numbers. You can think of these as vectors: from the origin of
the z plane to a 2 dimensional point on that plane.

Each factor ie: (z-p1) and (z-p2) is a difference vector between a general point z, who’s locus we
restrain to the unit circle, and the 2 specific roots p1 & p2. It will be a vector, having direction and
magnitude, and can be expressed in polar notation as r⁄θ, or re jθ, or in Cartesian notation as (a + ib).
Both these representation are complex numbers.

If we define p1 as (σ + iw) and its conjugate, p2 as (σ – iw) we can express the quadratic factors as:
(z- p1)(z- *p1) = z2 + p.*p – pz – *pz
Switching to polar notation for convenience, p.*p = rejθ. re-jθ = r2
So that leaves z2 + r2 –z.(p + *p), and if using Cartesian notation in this instance for convenience, ie. p
= σ + jw then p + *p = 2σ so
z2 +(-2 σ)z + r2 = z2 -2 σ z + r2 = z2 +a1z + a2

Relating coefficients gives a1 = -2σ and a2 = r2

For stability the poles must always be inside the unit circle, hence 0 < a 2 < 1

Changes in a1 directly influence the real component of the pole position


a2 has a square law relationship with r of the pole.
Other relationships, such as θ, w, imag part, can be derived from these easily with trigonometry.

The general solution for the roots of the quadratic polynomial x 2 + a1x + a2 is:
x = -a1/2 +/- i√[a2-(a1/2)2]

With these equations in mind consider how changes in the coefficients from the math will move the
poles or zeros about the unit circle, and influence the response of the system.

This lab aims to make you more familiar of the interrelationships between these parameters.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-97
1-98 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Using the values of a1 and a2 given in Question 2 above, find the roots p1 and p2 (express the
result in polar notation). Mark the position of p1 and p2 on the complex z plane with an "x" to
indicate that they represent poles. The distance between these points and the unit circle is of
key importance.

This is a parallel process to that in Lab 11 where we plotted zeros. A similar procedure was
carried out in Lab 11 for a CT transfer function in the complex variable s.

Write down a formula for p1 in terms of a1 and a2. Note that p1 may be real or complex
depending on a1 and a2. Determine the conditions for p1 to be complex valued. For this case,
express p1 in polar notation. Take note of the fact that |p1| does not depend on a1 (this will be
useful later). Obtain p2 from p1.

Question 65
Satisfy yourself that the magnitude response of H_x0 is given by

|H_x0(w)| = 1/[|(ejTw - p1)|.|(expjTw - p2)|] (Eqn 4).

This provides the key for the graphical method described in Lab 13 to obtain an estimate of the
magnitude response. Again, we will use T = 1 .

Plot the magnitude of the denominator for selected values of w over the range 0 to . The
quantity |(ejTw - p1)| becomes quite small and changes rapidly as the point on the unit circle is
moved near p1. Plot additional points there as needed. Invert to get |H_x 0(w)| and compare this
with the result you obtained in (b).

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-99
Graph 5:response plot

1-100 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
b0
x0

b1
x1

x2

b2 y

1/Z 1/Z
u

-a
1

-a2

Figure 14: block diagram of 2nd-order Direct-form 2 structure with feedforward.

Question 66
Modify Fig 1 by replacing the unit delays with a gain of 1/z and show that Eqn 3 follows by
inspection using simple algebra.

Question 67
Apply this idea to show that the transfer function for the system in Fig. 3 is

H_y (z) = y/u = (b0 + b1.z-1 + b2.z-2 ) /(1 + a1.z-1 + a2.z-2 ) (Eqn5)

Question 68
Use the graphical pole-zero method (covered in Experiment 14) to obtain estimates of the
magnitude responses for the following cases (0 to Nyquist freq):

(i) b0 =b2 = 1, b1 = 2, a1 and a2 as in Question 2.


(ii) b0 = b2 = 1, b1 = - 2, a1 and a2 as in Question 2
(iii) b0 = 1, b1 = 0, b2 = - 1, a1 and a2 as in Question 2

Which of these is lowpass, highpass, bandpass?

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-101
Graph 6:pole-zero method

Question 69
Consider a DT system with sampling rate 20kHz. Obtain estimates of the poles and zeros that
realize a lowpass filter with cut-off near 3kHz. Obtain a highpass filter using the same poles.

Question 70
For the same sampling rate as in Question 8 obtain estimates of the poles and zeros that realize
a bandpass filter centered near 3.1kHz, with 3dB bandwidth 500Hz. HINT: review Question 7

1-102 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Equipment

 PC with LabVIEW Runtime Engine software appropriate for the version being used.
 NI ELVIS 2 or 2+ and USB cable to suit

 EMONA SIGEx Signal & Systems add-on board


 Assorted patch leads
 Two BNC – 2mm leads

Procedure
Part A – Setting up the NI ELVIS/SIGEx bundle

128. Turn off the NI ELVIS unit and its Prototyping Board switch.

129. Plug the SIGEx board into the NI ELVIS unit.

Note: This may already have been done for you.

130. Connect the NI ELVIS to the PC using the USB cable.

131. Turn on the PC (if not on already) and wait for it to fully boot up (so that it’s ready to
connect to external USB devices).

132. Turn on the NI ELVIS unit but not the Prototyping Board switch yet. You should observe
the USB light turn on (top right corner of ELVIS unit).The PC may make a sound to indicate that
the ELVIS unit has been detected if the speakers are activated.

133. Turn on the NI ELVIS Prototyping Board switch to power the SIGEx board. Check that
all three power LEDs are on. If not call the instructor for assistance.

134. Launch the SIGEx Main VI.

135. When you’re asked to select a device number, enter the number that corresponds with
the NI ELVIS that you’re using.

136. You’re now ready to work with the NI ELVIS/SIGEx bundle.

137. Select the EXPT 15 tab on the SIGEx SFP.

Note: To stop the SIGEx VI when you’ve finished the experiment, it’s preferable to use the
STOP button on the SIGEx SFP itself rather than the LabVIEW window STOP button at the
top of the window. This will allow the program to conduct an orderly shutdown and close the
various DAQmx channels it has opened.

Ask the instructor to check


your work before continuing.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-103
Experiment

Part 1: IIR without feedforward: a second-order resonator

In this part we implement and investigate the system in Fig 1.

Figure 15: patching diagram for feedback structure without feedforward from Figure 1

138. Patch up a SIGEx model of the system in Fig 1.


Settings are as follows:
ADDER GAINS: a0=1; a1=+1.6; a2= -0.902
PULSE GENERATOR: 20kHz, DUTY CYCLE=0.5 (50%)
FUNCTION GENERATOR: Sinewave selected, FREQUENCY=1k; Amplitude= 2V pp
SCOPE: Timebase = 4ms, Trigger on input signal, Trigger level = 0V

Question 71
Calculate the poles corresponding to these values. Measure and plot the magnitude response at
the output of the feedback adder. Note and record the resonance frequency and the
bandwidth. Use the poles to graphically predict these parameters; compare with your
measurements.

HINT: Do a quick sweep of frequency range, and turn AUTOSCALE off at maximum amplitude,
then sweep the range more slowly while taking measurements. This will enable you to see the
variation in gain of the output more easily than with AUTOSCALE on.

Question 72
Decrease |a1| by a small amount ( around 5-10%, say) and measure the effect on the resonance
frequency and bandwidth. Use this to estimate the migration of the poles. Does this agree with
your expectations?

1-104 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Question 73
Repeat step 3 for a 5% decrease of a2. Compare the effects of varying a1 and a2. Which of
these controls would you use to tune the resonance frequency? Use the formulas you obtained
in the preparation to explain this.

NOTE about TAB “ PZ plot” on the SIGEx SFP.

This panel calculates the poles and zeros relating to the currently set ADDER gains which relate
to the coefficients of the transfer function. Use this visualization tool to confirm your
understanding . You may wish to move back and forth between the experiment TAB and the “PZ
plot” TAB as required during the experiment.

Figure 16: “PZ plot” TAB from SIGEx SFP

You may wish to use the manual GAIN ADJUST knob on the SIGEx board to vary these
parameters. Remember to setup its range to suit your parameter.

Question 74
With a1 unchanged, gradually increase a2 and observe the narrowing of the resonance. Continue
until you see indications of unstable behaviour. At that point, remove the input signal and
observe the output (if needed, increase a2 a little more). Is it sinusoidal? Measure and record
its frequency. Measure a2. Calculate and plot the pole positions. Note especially whether they
are inside or outside the unit circle.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-105
1-106 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Figure 17: patching diagram for step response

139. We will now repeat step 11 in the time domain. Use the PULSE GENERATOR as a clock
source and SEQUENCE GENERATOR to set up a unit pulse input. The SYNC signal from the
SEQUENCE GENERATOR will act as a repetitive unit pulse source. What matters is that the
unit pulses are far enough apart that each pulse is a unique event to the system under
investigation.

Setting are as follows:


PULSE GENERATOR: 20kHz, DUTY CYCLE=0.5
SEQUENCE GENERATOR: DIPS set to UP:UP (short sequence)
ADDER gains: a0=1.0; a1=1.6; a2=-0.902; b0=1.0

Question 75
Begin with a2 around -0.9. Describe the effect on the response as the magnitude of a2 reduces.
Measure the frequency of the oscillatory tail of the response and compare with your
observations in step 5.

Figure 18: typical pulse response

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-107
Graph 7:pole only response plot

1-108 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Figure 19: Setup with feedforward and feedback sections implemented, as per Figure 9
below

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-109
Part 2 - IIR with feedforward: second-order filters

In this part we implement and investigate the system in Fig 9. Note that the system with
feedforward simply builds upon the previous system with feedback only. It also provides a new
output point. The system response x0 for the feedback only, all-pole system is still available as a
subset within this new arrangement and is unchanged by the additional feedforward elements.
The feedforward elements simply add numerator terms to the overall transfer function which
becomes y/u.

b0
x0

b1
x1

x2

b2 y

1/Z 1/Z
u

-a
1

-a2

Figure 20: block diagram of 2nd-order Direct-form 2 structure with feedforward.

140. Use ADDER B in a z-TRANSFORM module to convert the SIGEx model of Part 1 to the
system in Fig 9.

Figure 21: patching diagram for block diagram above

141. Implement case (i) in Prep (Q7).


Settings are as follows:

1-110 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
ADDER GAINS: b0=1; b1=2; b2=1; a0=1; a1=+1.6; a2= -0.902
PULSE GENERATOR: 20kHz, DUTY CYCLE=0.5 (50%)
FUNCTION GENERATOR: Sinewave selected, FREQUENCY=1k; Amplitude= 1V pp
SCOPE: Timebase = 4ms, Trigger level = 0V, Trigger on input signal

Figure 22: Using the Function Generator to sweep a sinusoid across the spectrum of
interest.

Observation: the high pass band gain due to the selection of coefficients resulting in poles very
close to the unit circle, as shown in the figure below.

Figure 23: details of the PZ PLOT TAB for the current settings
(NB: 2 zeros at (-1 +/- 0i) are difficult to see in figure.)

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-111
NOTE: The poles are very close to the unit circle. In fact, the pole radius is 0.95. Hence the
gain close to the poles is very large. You can use the PZ PLOT to visualize the poles and zeros
for any “live” coefficient settings. Zeros are also present at z = -1.

1-112 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Measure the magnitude response |y/u| and confirm that it is a lowpass filter.

Graph 8: plot of responses

Question 76
In the model of step 14, adjust a2 to reduce the peaking to a minimum. As well you will need to
reduce the amplitude of the input signal to 0.5Vpp to reduce saturation. Confirm this for
yourself. Plot the resulting response and measure the new value of a2. Calculate and plot the new
poles. Obtain an estimate of the theoretical magnitude response with these poles and compare
this with the measured curve. Why was a2 used for this rather than a1?

Question 77
Change the polarity of b1 in the lowpass of step 19 and show that this produces a highpass.
Compare with your findings in Question 7.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-113
NOTE: the following three questions refer to the transfer function coefficient values.
Remember to negate the a1 and a2 values when settings them up as ADDER GAINS.

Question 78
Repeat for case (iii) in Question 7, that is: b0 = 1, b1 = 0; b2 = -1 ; a0 = 1; a1 =-1.6; a2 =0.902;
Confirm this is a bandpass filter. Tune a1 and a2 to obtain a peak at 3.1 kHz and 3dB bandwidth
500Hz. Measure the resulting a1 and a2 and plot the new poles. Compare this with your findings
in Question 7.

Question 79
Implement the following case: a0 = 1, a1 = 0, a2 = 0.8, b0 = 0.8, b1 = 0, b2 = 1. Note that b0=a2 and
b1=a1. Measure the magnitude response. Confirm it is allpass. Locate the positions of the poles
and zeros. Plot them below for your records.

Question 80
Change a1 and b1 to - 1.6 and confirm the response is still allpass. Examine the behaviour of the
phase response. Look for the frequency of most rapid phase variation, and confirm this occurs
near a pole.
Plot the poles and zeros below for your records.

1-114 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Viewing spectrum of system with broadband noise input & FFT

As well as sweeping a single frequency signal from the FUNCTION GENERATOR across the
spectrum of interest it is also convenient to input a broad range of frequencies at once and view
the overall output frequency response of the system. Creating a broadband analog noise signal
was covered in Experiment 9. That methodology is shown in the figures below. You can revisit
this experiment with this setup in place and see the relationships of poles and zeros to system
response in real time.

Figure 24: IIR filter with flat noise input

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-115
Figure 25: experiment setup with noise input signal instead of Function Generator signal.
Uses SEQUENCE GENERATOR and TUNEABLE LPF, clocked from PULSE GENERATOR.

142. Ensure that SEQUENCE GENERATOR DIP switches are set to positions DOWN:DOWN
for the long sequence. Set TLPF knobs to fully clockwise for now. Switch to TAB “ZOOM FFT”
to view time and frequency domains simultaneously. Change scope timebase to 100ms.
Set up the coefficients as per step 14.

Setting up the input noise signal:

143. i) Reduce the TLPF GAIN by rotating counter clockwise until the output Ch1 signal (red)
is no longer saturated ie: less than 12V peak.
ii) Reduce the noise bandwidth to around 4khz by rotating the TLPF block’s “Fc” control-counter
clockwise. View the noise spectrum as the white trace on the SCOPE & FFT windows.

The SFP should be similar to Figure 15 below for a peaky LPF as shown.

Figure 26: ZOOM FFT TAB used to view Experiment 15 setup with flat noise input.

Due to high gain, input noise level is very small. Note the limited bandwidth of the input noise to
maintain a flat input response. (SEQUENCE GENERATOR must be set to long sequence.)

At this point we can see and explore the issues relating to :


-controlling our input signal level and bandwidth
-viewing the response in both time and frequency domains
-setting up a transfer function with appropriate internal gains

1-116 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
We can also confirm that the peak of the response is correct according to the position of the
poles. ie: PZ PLOT tells us that poles are at 32 degrees, hence we expect a peak close to
32/360*20,000 = 1777 Hz. You can use the cursors in ZOOM FFT window to confirm this.

Question 81
Show your calculation of the where you expect the peak frequency to be using the pole position
and sampling frequency.

Dynamically varying the poles and zeros to adjust response using GAIN
ADJUST manual control

144. Use the SIGEx board’s GAIN ADJUST knob to vary one of the coefficients by hand
while viewing the frequency response. Leave the default settings. Turn the knob until it reads
+1.6 (located in the COEFFICIENT SELECTOR window), then select radio button “ a1 ”. View the
frequency response while slowly varying the value of a1. You will find that the peak frequency
changes.

145. Find a range of a1 settings that work well and then view PZ PLOT while varying across
that range. You will see the poles moving and reflecting the changing a1 coefficient. (Theory
states that a1=-2σ, which is the real part of the pole and its conjugate.)

Question 82
Confirm this relationship from values displayed on PZ PLOT and show your working here:

146. Set a1 back to +1.6, select OFF, then set GAIN ADJUST to -0.9, and select a2 radio
button. For more resolution vary the setup parameters as required.

Question 83
Varying a2 will vary the gain or peak level of the filter. Notice what happens in the time domain
when a2 = -1.0. The filter breaks into oscillation. View the poles again using PZ PLOT while
varying a2. (Theory states that a2 = r2).

147. Set a2 back to -0.9, then select OFF again at the COEFFICIENT SELECTOR to disable
the GAIN ADJUST control.

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-117
1-118 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Using Digital Filter Design toolkit to implement Highpass filters

148. Switch to the DFD TAB. This will allow you to automatically load the computed
coefficients for the selected filter onto the SIGEx board. You can see the values on the TAB
setup in the GAIN input controls on the SIGEx SFP.
NOTE: Maintain the order of your filter structure <= 2, to match the structure you have built.

149. Connect CH0 to “ x0 ”, and CH1 to “Y” and view the internal signal levels at “x 0” by
switching to the ZOOM FFT tab. Set the TLPF GAIN higher but avoid saturating.These filters
have lower internal gains than the previous ones. Vary the filter design type (at the DFD tab by
clicking on “DESIGN METHOD” to select) and view the output responses using ZOOM FFT.
NOTE: Press the button to transfer the coefficients into the ADDER gains when you are ready
to do so.

Set timebase to 100ms.


Again you can use the cursors to compare the actual performance to theory and design.

You can expect to see a display like so:

Figure 27: Highpass filter response using FFT; x0 (grey); Y (white)

Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-119
Figure 28: DFD TAB used to design filters and setup coefficients to the patched SIGEx board

Default values are chosen to enable students to see textbook like responses which they can
easily measure.

Question 84
Confirm that the SIGEx hardware performs as designed by theory in terms of notch positions
etc. You will have to use the zero positions mostly in these cases. Why ?

Notches are implemented by placement of zeros on or near the unit circle.

Question 85
Try varying design values and take note of the ORDER of the filter designed. NOTE that the
SIGEx experiment we have implemented can only support a 2nd order structure. Note your
observations.

1-120 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2
Experiment 1 – An introduction to the NI ELVIS II/+ test equipment © 2011 Emona Instruments 1-121
Tutorial Questions
Q1. Why do the complex poles and zeros occur in conjugate pairs in the cases
covered in this lab?
Q2. Why is polar notation for complex valued poles and zeros preferred in the
discrete-time context? Using examples from the lab, explain the importance
of the position of complex poles/zeros relative to the unit circle when
estimating frequency responses.
Q3. Re Eqn 3, keeping a1 constant, plot the locus of the upper half plane pole with
respect to a2. Do this for several suitable values of a1. Holding a2 constant,
repeat this with respect to a1. Use the resulting contours to explain your
observations in Q11 and Q12 .
Q4. Determine the conditions on a1 and a2 for the poles to be complex. Display this
graphically on a plane (i.e. with a2 = 0 as horizontal axis and a1=0 as vertical
axis).

Q5. Calculate and plot the poles and zeros in Q19. Satisfy yourself that they
share the same radial line. Show that z1 = 1/p1* .
Q6. Prove that the values of the coefficients in Q18 and Q19 generate a constant
magnitude response over all frequencies. Write down the coefficient
relationship in the transfer function of a fourth-order allpass.

Q7. Consider the unit pulse response in Step 12. What is the effect on the decay
rate as the bandwidth is decreased? Find a simple formula or rule of thumb
to express this relationship.
Q8. Show that the magnitude responses at nodes x 1 and at x2 are the same as at
x0 (can be demonstrated without math).
Q9. Consider a bandpass filter realized with a2 = 0.98. What is the maximum
deviation allowable in a2 to maintain a bandwidth tolerance of 5 percent?
Q10. Consider the following assertion: "Continuous-time filters can be considered
as a limiting case of discrete-time filters, as the sampling frequency to
bandwidth ratio gets very large". Hint: show that the poles and zeros migrate
to the area near (1,0) as the Nyquist ratio increases and compare the shapes
of the unit circle and of the j axis in that region.
Q11. Find out the meaning of the term "maximally flat". Is this description
applicable to the filter produced in Q15 by reducing the value of a2?

1-122 © 2011 Emona Instruments Experiment 1 – An introduction to the NI ELVIS II/+ test equipment V1.2

You might also like