experiment 3 exploring complex numbers and exponentialsvvakilian/labsece330/labdescriptions/lab...
TRANSCRIPT
Experiment 3 – Exploring complex numbers and exponentials
Achievements in this experiment
You will be understand the fundamentals of complex numbers and their usage in signals analysis. You
understand the significance of the exponential and the use of the complex exponential ejθ. You
understand their relevance in terms of real signals.
Preliminary discussion
“That this subject [imaginary numbers] has hitherto been surrounded by
mysterious obscurity, is to be attributed largely to an ill-adapted notation.
If, for instance, +1, -1, √-1 had been called direct, inverse and lateral units,
instead of positive, negative and imaginary (or even impossible)
then such an obscurity would have been out of the question.
-Carl Friedrich Gauss (1777-1855)
This quote from Gauss is a good place to start in our exploration of what complex numbers mean and
how they are useful to mathematicians, scientists and engineers. From the very earliest use of these
concepts, confusion has abounded as to what and imaginary number actually is and how it is useful. By
relating as much as possible to real signals and their manipulation, this experiment hopes to clarify
and consolidate the understanding for the student about this issue.
Figure 1: portrait of Leonhard Euler 1707-1783
Leonhard Euler, one of the great mathematicians, was born in Basel,Switzerland. He achieved his
master’s degree at age 16. Private student of Johann Bernoulli, he then went on to author over 900
publications covering many diverse topics in mathematics and science. His memory was legendary and
he could recite the entire Aeneid word for word. A famous equation (worth reading about) is
Euler’s identity: eiπ + 1 = 0
Although in general mathematics the imaginary part of a complex number is identified by the letter
“i”, in electrical engineering in order to avoid confusion with the symbol for current “i”, the symbol
for the imaginary part of a complex number uses the letter “j”. As there is much overlap between
mathematics and electrical engineering, you will at time find these symbols used interchangeably.
Pre-lab preparation
Question 1
Confirm your understanding of the algebra associated with complex number by solving these
equations using the binomial method :
a) (3 + i2) + (5 – i6) b) (3 + i2) x (5 – i6) c) (3 + i2) - (5 – i6)
d) (a + ib) + (c + id) e) (a + ib) x (c + id) f) (a + ib) x (a – ib)
Question 2
Confirm your understanding of the algebra associated with complex number by solving these
equations using vectors. Sketch your working on the graph below:
a) (3 + i2) + (5 – i6) b) (3 + i2) x (5 – i6) c) (3 + i2) - (5 – i6)
d) (a + ib) + (c + id) e) (a + ib) x (c + id) f) (a + ib) x (a – ib)
Graph 1: Vector arithmetic
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
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.
10. Select the Lab 7 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 Complex numbers
In the pre-lab preparation work you refreshed your understanding of the arithmetic to do with
complex numbers. Each complex number can be represented as a point at two-dimensional plane and
when joined to the origin of the plane with a line they are known as vectors. They can be expressed
in either rectangular or polar coordinates depending on convenience for the task at hand.
Figure 2: diagram of complex number
The relationship between the Cartesian and polar coordinates systems is as follows:
x = cos (θ); y = sin(θ);
also it is convenient to express the number using Eulers formula:
eiθ = cos(θ) + isin(θ)
The use of i for the vertical component denotes that it is the component in the vertical or imaginary
axis. The use of θ is fairly obvious as the angle the number makes with the horizontal or real axis.
However the introduction of ‘e’ is somewhat more perplexing, so we will briefly mention it here.
Overview of the derivation of eix using series Knowing the following series:
ex = 1 + x + x2/2! + x3/3! + x4/4! + …
sin x = x – x3/3! + x5/5! - …
cos x = 1 – x2/2! + x4/4! - …
Where n! is factorial n
Now, substituting ix for x, we get
eix = 1 + ix + (ix)2/2! + (ix)3/3! + (ix)4/4! + …
And knowing that i2 = -1; i3 = -i; i4 =5 1; i = i and substituting in
eix = 1 + ix - x2/2! - ix3/3! + x4/4! + ix5/5! - …
If we separate the I terms, it gives
eix = (1 – x2/2! + x4/4! - …) + i(x –x3/3! + x5/5! - …)
From above we note that these terms are sin x and cos x, so
eix = cos x + i.sin x
Complex functions
If the angle θ is replaced with a varying angle, varying in time, such as wt, then we have:
ejwt = cos(wt) + jsin(wt)
As the angle θ is now a function of time, then the vector is also moving in relation to time, and is in
fact rotating at the rate w, which corresponds to w/2π revolutions per second. We can call this
vector a “phasor”.
Let us take a look at what this means with real signals.
In this TAB, the SCOPE and XY GRAPH will BOTH display the actual signal is as connected to by the
scope leads. The phasor plot will display signals derived from the amplitude and phase settings on the
tab itself and output to the ANALOG OUT terminal , DAC-1 & DAC-0. These will be the same signals
if you make connections as outlined in experimental procedure.
Figure 3: patching for DAC1 to CH1, DAC0 to CH0, and both to ADDER
11. Patch up a SIGEx model of the system in Figure.
Connect CH1 scope lead to DAC-1 output and CH0 lead to DAC-0 output.
Settings are as follows:
SCOPE: Timebase = 40ms, Trigger on CH1, Trigger level =0V
DAC1: Reference amplitude = 1; Phase = 0 degrees
DAC0: Reference amplitude = 1; Phase = -90 degrees
Question 3
Write the equation for signals at DAC-1 and DAC-0 as a function of time in the form: A.cos(wt + θ).
Think of the centre of the scope timeline as the instant t=0.
12. Observe phasor plot and XY graph and confirm they are as expected.
Question 4
Explain why the XY graph displays a circle ?
13. Vary the phase settings for DAC-1 and DAC-0 and observe the phasor plot and XY graph.
Confirm your understanding of what they display.
14. Disconnect the scope lead from DAC-0. The graphs will now only display signal from DAC-1.
Pay attention to the XY graph.
15. Reconnect DAC-0, and disconnect the scope lead from DAC-1. The graphs will now only display
signal from DAC-0. Again pay attention to the XY graph.
Question 5
Explain the signal as viewed on the XY graph ?
16. Vary the settings as follows :
Ref amplitude DAC1 = 1; Phase = -15 degrees
Ref amplitude DAC0 = 1.2; Phase = 75 degrees
Question 6
Write the equation for signals at DAC-1 and DAC-0 as a function of time in the form: A.cos(wt + θ).
17. Vary the settings back as follows :
Ref amplitude DAC1 = 1; Phase = 0 degrees
Ref amplitude DAC0 = 1; Phase = 90 degrees
18. Leave the CH1 scope lead connected to DAC1 output and move the CH0 scope lead to the
output of the adder “f+g”. You are now viewing the sum of the two sinusoids.
Question 7
Measure and document the equation for the sum of the two sinusoids. Compare this with the
expected resultant using the phasor method.
19. Leave the CH1 scope lead connected to DAC1 output and leave the CH0 scope lead to the
output of the adder “f+g”. You are still viewing the sum of the two sinusoids. Set up phases to be 0
and 180 degrees. Try also 0 and -180 degrees.
Question 8
What is the output sum signal for these settings ? Is this expected ? Explain.
Figure 4: SIGEx TAB 7 SFP detail displaying real signals via scope
On the phasor plot can be seen two phasors representing the outputs from DAC-1 and DAC-0, both
sinusoidal signals. The phasor plot shows the relative phase difference an amplitude of each signal
but not the rotation. Since are both rotating at the same frequency we do not need to display that
rotation. Consequently let us explore the addition of real signals and compare the results with those
expected from vector addition.
From above we have stated that
ejwt = coswt + j.sinwt
hence v(t) = Acos(wt + θ)
= Re { Aej(wt+θ) }
= Re { Ae(jθ).ej(wt) }
Ae(jθ) sets up the initial conditions at t=0, ie amplitude & angle
As well, it can be shown that
v(t) = Acos(wt + θ) = A/2.ejθ.ejwt + A/2.e-jθ.e-jwt
Each term is a rotating phasor, with A/2. ejθ.ejwt rotating in a positive direction (counter clockwise)
and A/2e-jθ.e-jwt rotating in the negative direction.
Negative direction meaning negative frequency, which can be thought of in the same way as a motor
spinning in the reverse direction.
These two terms show that sinusoid is the sum of two complex exponentials, which are the conjugate
of each other.
Let us display these conjugate signals with the SIGEx board.
20. Settings as follows :
Ref amplitude DAC1 = 1; Phase = 20 degrees
Ref amplitude DAC0 = 1;
Set “Phase follow DAC-1” mode switch to ON
Setting “Phase follow” mode ON will automatically set the relative phase of the DAC-0 signal to be
the negative of the phase for the DAC-1 signal. That is, it will become the “conjugate” signal. Both
phasors will be symmetrical about the real axis.
21. Vary the DAC-1 phase setting and observe the phasor plot showing the phasors moving
relative to each other. Bear in mind that the sum of these two vectors will fall on the real axis and
inscribe a real signal.
Next you will measure and plot the resultant real signal amplitude.
22. Connect the scope lead CH-1 to DAC-1 and CH-0 to the adder output “f+g”.
23. Vary the DAC-1 phase from 0-360 degrees in 15 degree steps and note these values in the
Table below. Take the peak amplitude value reading, not the peak to peak value. Watch the phasor
plot and document the amplitude as negative when the resultant signal is in the negative half-plane.
Phase
(degrees)
Resultant amplitude
(Vpk)
Phase
(degrees)
Resultant amplitude
(Vpk)
0 2 210 -1.75
30 1.75 240 -1
60 1 270 0
90 0 300 1
120 -1 330 1.75
150 -1.75 360 2
180 -2
Table 1: resultant amplitude readings
24. Plot these measured values on the graph below.
Graph 2:plot of resultant from measurements
Question 9
What is the equation for this resultant signal ?
Exponential functions
When a quantity increases or decreases at a rate which is proportional to its value at that instant
then that process is known as an exponential process. Expressed as an equation, exponential decay is:
dN/dt =-kN where k is the decay constant
Solving this equation for N gives us:
N(t) = N0e-kt; where N0 is the initial value at t=0.
However, the general form for this equation is
N(t) = N0.b-kt ; where 0 < 1/b < 1
For every time period where t = 1/k, then N(t) will reduce by the factor of 1/b.
In a case where b=2, the function will halve every time constant.
In the case where b=e, then the function will reduce by a factor of 1/e (0.36) every time constant.
In this section we will use a simple loop to cause a pulse of known amplitude to decay at a variable
rate. We can control the rate of decay by adjusting the gain controls of the feedback path.
25. Patch together the experiment as shown in figure .
Figure 5 : block diagram for exponentially decaying pulse generation
Figure 6: patching diagram for decaying pulse generator
Settings are as follows:
ADDER gains: a0 = 1; a1 = 0.8; b=1; b1=0.36
SEQUENCE GENERATOR: DIPS: UP:UP
SCOPE: Timebase: 40ms; Trigger on CH0; Trig level = 1.0V
PULSE GENERATOR: Frequency = 1000Hz, Duty cycle=0.5
(50%)
26. Confirm that the gain settings are as indicated and view the output of both
loops simultaneously with both scope leads.
27. Confirm for yourself that the signal decaying rapidly is decaying at the rate 1/e = 0.36.
You would expect this as each sample out of the loop will be approximately 0.36 times less than
the previous input. Once the initial pulse is input to the loop, the input settles to zero and only
feedback signals remain in the loop.
28. Try varying the gain a1 to various values between zero and one. In particular, set gain a1 to
0.5 and view this signal.
Question 10
What is the equation for this resultant signal for a1=0.5 ?
Question 11
What is another term for the time constant when a1=0.5 ?
What is most interesting of all these exponential waveforms is that when the decay rate equals
‘e’, then the rate of change equals the value of the function itself at that instant. This only
occurs when the decay rate equals e. This form is known as natural decay, and occurs in many
natural processes, and is the basis for natural logarithms. Whilst it is outside the scope of this
lab manual, it is very interesting to read about the number e, epsilon, and is well covered in one
of the references.