# How to generate a complex sinusoidal signal on a function generator?

I can't relate some of the equations or mathematical expressions commonly seen on circuit analysis textbooks to the real world.

For instance, if I'm given an input signal mathematically expressed as $$\ x(t) = 3 \cos(2 \pi 60 t) \$$, I can generate this signal on a function generator (mine is a Rigol 1022Z) by keying in a 3V sinusoid with a frequency of 60Hz. If I hook up the wave generator to an oscilloscope, I will indeed see $$\ x(t) = 3 \cos(2 \pi 60 t) \$$ on the oscilloscope display.

Problem appears when a signal is given in complex mathematical expression, such as $$\ x(t) = 3e^{j2\pi 60t} \$$. On paper, I can perform mathematical operation or calculate the response with some algebra and calculus and end up with another mathematical expression. But how should I generate this signal on a physical function generator or visualize my results on an oscilloscope?

In Euler's form, the complex signal can be written as

$$3e^{j2\pi60t} = 3\cos(2\pi60t) + j3\sin(2\pi60t)$$

That is a polar form of the signal with magnitude and phase equals to

$$|x(t)| = \sqrt{{3^2\cos^2(2\pi60t)} + {3^2\sin^2(2\pi60t)}}$$ $$\angle{x(t)} = \tan^{-1} ({{3\sin(2\pi60t)} \over {3\cos(2\pi60t)}})$$

How am I supposed to key in these mathematical expression of voltage and phase on a function generator?

Other than knowing there is a $$\ \cos \$$ wave running at 60Hz and a separate $$\ \sin \$$ wave running at the same 60Hz, I don't know where to start. Or do I need to buy two function generators (one generating the real $$\ \cos \$$ and the second generating an imaginary $$\ \sin \$$), superimpose the two input wave forms into the circuit under test and read the response on an oscilloscope?

Are these complex signals and mathematical expressions given in the textbooks just purposefully written in a way to hone our mathematics and problem solving skills, or do they represent physical parameters that we can generate and test out experimentally?

• KMC, There's something in your head that needs to be broken (demolished) and I'm not sure exactly how to achieve it. I think it has to come more from your own hard work, instead, struggling over your question. At some point, it will just hit you. By the way, it is a very good question in many ways -- +1 -- because I think most of us (those like me who are not von Neumann wunderkinder) go through this phase. In short, some choices were made with respect to using Euler's (which simplifies calculations) and there are both benefits and also some consequences of those choices, as well.
– jonk
Aug 30 at 0:09
• KMC, But a signal generator isn't mathematics. It depends on mathematics deduced into the specifics it cares about. But it isn't, at bottom, mathematics itself. A voltage as a function of time signal is not a complex number. It just can be modeled as one, so long as you know what you are doing.
– jonk
Aug 30 at 0:23
• KMC, I don't know if this page will help a little. It may. It, near the bottom, points out the handedness of the helix in complex space, as used in electronics. It may spur a thought or two.
– jonk
Aug 30 at 6:42
• @jonk so what exists is just a voltage that varies against time (the magnitude). Phase is just a measure of misalignment between two or more waves, which by itself has no meaning for one signal. So any exponential of e to the power of j something (i.e. $e^{jx}$) is just another mathematical form of telling you the phase. The $\cos$ or $j\sin$ in Euler's form points to the same signal (they don't share the signal, they ARE the same signal). If I'm not bother by the j symbol, I can as well choose $j\sin$ to visualize my signal as long as I'm consistent with my calculation.
– KMC
Aug 31 at 3:33

Complex signals don't exist in the real world. They are a mathematical tool. However, complex signals can be represented in quadrature--using two separate signals, one representing the real part, and one representing the imaginary. This can be used, for example, to heterodyne a signal in one direction (e.g., without also heterodyning the negative image of the signal).

An exponential representation with an imaginary exponent is a helix in complex space. The sine and cosine signals are the projections of that helix onto the j-T and 1-T planes. Note that, unlike the purely mathematical approach, the "sine" and "cosine" labels that might be associated with quadrature waveforms are arbitrary (since there's no objective time "0" unless you go back to the Big Bang). Rather, the critical thing is they're highly orthogonal (as close to 90 degrees apart as the application requires).

• So when the textbook states an input signal to be complex or $3e^{j2\pi60t}$ - this signal actually doesn't exist and only vaguely associate with any physical parameters? So if someone ask me to generate this signal on a function generator, they must specify the voltage, frequency, and phase value instead of giving me a complex mathematical expression?
– KMC
Aug 26 at 15:49
• @DKNguyen yes the Euler form does give me the voltage magnitude, which is $|x(t)| = \sqrt{{3^2\cos^2(2\pi60t)} + {3^2\sin^2(2\pi60t)}}$ .... I can key in 3V in a function generator if the signal is just $3 \cos (2\pi60t)$, but how do I key in $|x(t)| = \sqrt{{3^2\cos^2(2\pi60t)} + {3^2\sin^2(2\pi60t)}}$ for $3e^{j2\pi60t}$ into the machine?
– KMC
Aug 26 at 16:16
• @KMC but those are the same thing. You only have a vector, with some length and speed it rotates. And since you don't have a reference vector for comparison, the absolute starting phase does not matter. All those mathematical notations mean the same vector. 3 is amplitude, 2*pi*60*t is speed. Cos function has initial phase of 0. Aug 26 at 16:46
• @Justme what is a "reference vector"? If the amplitude is just 3 and speed is $2*\pi*60$ and I key those parameters in the function generator, in my oscilloscope I'm really just seeing $3*\cos(2 \pi 60 t$ and not $3e^{j 2 \pi 60t}$. Why do I ignore the voltage signal of $j \sin(2\pi 60t)$?
– KMC
Aug 26 at 17:09
• Because you are just looking at a sinusoidal wave, you would not know if you are generating or looking at a sine wave or a cosine wave on an oscilloscope, so you have no reference. And you have two different mathematical notations for the two identical rotating vectors (rotating vectors are called phasors) - A cos(omega t+theta) equals A e^j(omega t+theta) Aug 26 at 17:26

Let's say you have the following circuit: simulate this circuit – Schematic created using CircuitLab

and without knowing anything about the angle or imaginary/real parts involved, let's put V0 as our reference, thus meaning it's related angle would be at 0.

Then,

$$V(L)/V0 = jωL/Z$$

You can see that this voltage will have a real part and an imaginary part and you can measure this on an oscilloscope. When you do, you will see a sine wave (assuming that V0 is also a pure sine wave) whose value is the coefficient of the exponential complex representation (r), but looking at the resultant sine wave on it's own will only yield you 2 pieces of info, it's amplitude and it's frequency.

From my understanding, you are wanting to generate a voltage straight from your device to, say have a X amplitude at angle θ. you will have the ability to dictate the amplitude. but if that sine wave is on it's own, there could be no means of measuring anything relative.

As a numerical example, in the circuit let's assume:

L = 100 mH

R = 100 Ohm

f = 50Hz

V0(peak) = 10

so V(L) has a peak of about 3 V with a frequency of 50Hz, having been shown that it can be expressed in polar form, but you can also generate the exact signal, this goes to show that showing it in polar form requires some sort of reference.

Now one might ask why would we need it? as shown in the simple calculations, it works and it makes maths easier when dealing with components like capacitors or inductors. The other is when dealing with comparing values within those systems. hope this helps.

EDIT: there also a more comprehensive and fundamental approach to your query here.

• The link you provided does explain the fundamentals that help correct my wrong mental picture that I was struggling to visualize, specifically the answer given by YoTengoUnLCD
– KMC
Sep 5 at 13:55

How am I supposed to key in these mathematical expression of voltage and phase on a function generator?

Surprised no one answered this, but this is actually really easy to do. Your function generator has a phase setting: Calculate the phase angle (as you have done in your question) and plug in the phase angle there. If you do this with a cable running from CH1 to your oscilloscope, you will see ... absolutely nothing happen.

Phase is the time delay of a waveform. With an angle of zero degrees, your waveform is not delayed. With an angle of 180 degrees it is delayed 1/2 of a cycle. Your scope will not show you that half cycle of delay since it just shows you the most recent trace at each instant, so you won't record that the waveform originally (seconds, minutes ago) started some milliseconds later than it otherwise would have.

If you want to see what that phase setting does on your scope, plug in a second cable into the trigger out on the function generator. Then plug it into the trigger in on the oscilloscope. You'll now see that your waveform is delayed. Put in 90 degrees and you can shift a sin into a cos or back again.

Are these complex signals and mathematical expressions given in the textbooks just purposefully written in a way to hone our mathematics and problem solving skills, or do they represent physical parameters that we can generate and test out experimentally?

A complex signal is the sum of two real signals, one cos and the other sin. Provided you have two cables (in this case CH1 and the trigger out) to carry those two signals, you can in fact measure them. With just one cable then no you cannot since a delay is relative, it is the difference between the timing of two signals. If you only measure one of the two times you cannot calculate the difference.

They have FUNCTION {SQRT SIN SQ COS} and dozens more options, but no examples how to concatenate functions, which seem to be limited to two channels. But this is simply a 60 Hz sin shifted by 45 deg phases relative to some reference not generated.

It's a script language you have to learn how to program with the right syntax with the programming manual.

You can also use GUI functions in MATLAB and connect the functions with boxes or Visual Basic. But it's a learning curve worth doing if you like to do complex generators.

I suppose you could do this easily in a spreadsheet and discretize the time function into a file and loop it.

This is what your signal looks like with the Sin reference Image source: SE Community Promotion Ads 2020 - Answer by Marcus Müller

pretty complex eh ;) 😄 🧐

• This is the real world using script language or GUI. You decide which syntax you prefer for defining the "procedure" or "process" and ask supplier for customer support. I gave 3 choices. Any questions? But your question is a trivial phase shifted 60 Hz signal , so why all the complicated formula? Sep 3 at 13:20