# How to make this arbitrary waveform?

Im trying to generate a custom waveform based on the instrumentation amplifier. The concept is that using two signals* , square 2Vpp and triangular 1Vp, get the next output:

Under the next considerations:

• The signal must be reflected along the y axis, expecting something like
• The voltage peak to peak must be the same (from 8V to |-4|V=12V)
• The new max level must be anchored at +6V and the new min level must be -6V (i.e.: the 12V of vpp).

First the circuit simulated is(using the model of an instrumentation amplifier):
The circuit is available here

The output is the next waveform:
that indeed fits the first desired output.

The question is how can be reflected/mirrored and how to fix the levels?

For the mirror efect, I was thinking connect an inversor at the output, thus adding other opamp, but I dont know if there is another way to do so. If the phase is changed the only thing done is displace the signal to the left/right, if change the terminals of the square and triangle, perhaps gets reflected but over the x axis. And to set the levels to be +6 and -6 if dc voltage sources are added it will displace the max/min output levels.

So, what suggestions can be used to get the signal abd clamp the levels? Thanks in advance.

**I was told this signal can be done using only one source and making some kind of configuration,i.e.: generating both input signals from a single source. But I dont know if the square must be derived or a sin. signal filtered; is this viable to do?

• The signal must be reflected along the y axis Your Y-axis is time, you want to change / influence time? Good luck with that. For the mirror efect, I was thinking connect an inversor at the output You mean an inverting amplifier. Realize that an inverting amplifier multiplies the signal by -x where x is a positive number, so -1, -5 , -2.58 are possibilities. In the case of -1 then you will mirror the signal across the X-axis, not the Y-axis. Commented Oct 13, 2021 at 8:08
• Also the title of your question is misleading, you already have the signals (your circuit isn't making the signals) and are just combining them by adding, subtracting and multiplying. Realize that a constant - the triangular signal you already have could give part of the 2nd signal. Commented Oct 13, 2021 at 8:12
• @Bimpelrekkie,humm, Im a little confused, the y axis is the voltage amplitude, the x axis is the time. Commented Oct 13, 2021 at 18:00

The reflection about the Y axis can be obtained by inverting one of the input signals but not the other. Look carefully at the summing junctions in the following circuit, noting how the first (top) one simply sums the two inputs, but the second subtracts them:

simulate this circuit – Schematic created using CircuitLab

The signals SQR and TRI look like this:

OUT1 is the result of simply adding these two signals SQR and TRI together:

OUT2, the result of subtracting those two signals, looks like this:

You can offset the output by adding a DC voltage at any point, either to one of the inputs, or the the output. If you wanted to lower the overall output signal average by 500mV, any one of these following topologies will work:

simulate this circuit

All three produce the same outputs. OUT3 = OUT4 = OUT5:

I'll implement something along these lines in a real circuit, with real opamps. Let's say you want both non-Y-reflected and Y-reflected signals, and your source triangular wave has an undesired offset of 2V:

The first thing to do is remove the offset from SQR, which you can do with a summing amplifier, the blue stage shown below (note: it also inverts, but that's not a problem, as you'll see).

Lastly you need a summing amplifier to add the square to this corrected triangle, and a differential amplifier (like the one you showed us) to subtract instead of add. Those are shown in orange and green respectively.

simulate this circuit

OUT6 and OUT7 are your two desired, offset-free, reflected and non-reflected signals:

• Whoa!! Great answer, very detailed, instructive and interesant!! Thanks, I have had more or less the idea, but failed in some details. And the real application is superb. Thanks a lot again!!. Commented Oct 13, 2021 at 18:04
• @Simon, And by the way, If you dont mind, Im going to roam your answers too, As some folk tell you in another questions, its very clear, very well written and it helps lots. I hope you are a teacher lecturing students. Commented Oct 13, 2021 at 18:24

Example:

note that the slopes are not linear, they're exponential. You'd have to replace one resistor with a constant current source to make them linear.

Am I cheating?

BTW, the simulator at falstad.com in its current version seems to be choking on my example... after a few seconds, the timebase grinds to a screeching halt :-)

• I like this answer too, you aren't cheating, its valuable info, since it allows implement another way to solve it, thanks a lot!! (falstad was working well, Ill try to do this circuit in multi=) Commented Oct 13, 2021 at 18:06