# Phase shifting DC+AC audio signal without affecting its DC content

I have a strongly and asymmetrically clipped audio signal (green signal on attached picture), with DC bias content (blue signal).

In order to obtain the exact DC bias level of this composite signal later, first I would like to phase shift the signal with 180 degrees, without affecting its DC content (red signal on the following picture).

The inverting op-amp configuration change the polarity of the DC content too, it can not be used in this case. Is there any possible solution in the analog signal domain? For the time being I don't want to switch to digital domain.

• Will the signal always be derived from a fixed frequency pure sine wave? And is it always clipped? Nov 18, 2016 at 17:52
• No, this is not the case, the AC signal has wide frequency range. This is a simple test circuit, incorporating a N-JFET, a current sense resistor connected to the source of the N-JFET, and appropriate bias and signal sources. Like a primitive source follower. Without signal transmission, the quiescent voltages and currents well defined DC values. In the presence of varying signal on the gate, the AC signal superimposed on this quiescent values. All of this can be measured on the sense resistor. The figures basically illustrate a Class-AB case (on one fixed frequency). Nov 18, 2016 at 19:02
• So the 0.2V bias is what, output voltage with no signal? Can you show us the circuit? Nov 18, 2016 at 20:45

Your method of extracting the bias voltage will only work if you know the nature of the original AC signal and can infer the zero crossing point from its shape. It will not work for an arbitrary waveform which has been distorted by your circuit.

For example, imagine the output is a square wave going from 0 to 1V. How much (if any) of the bottom half of the original wave has been cut off? You don't know! What shape was the cut off part? You don't know! Since that information has been lost there is no way to reconstruct the original AC waveform, and no way to determine its average value (DC bias point).

to obtain the exact DC bias level of this composite signal

Use a low pass filter - it will average the signal and give you the DC level. Of course, you will need to take into account that a low pass filter will take time to settle to the average value and that there will still be some rippley artefacts left from the AC content of your signal but by choosing the correct number of stages you will get a small ripple that will likely be acceptable to use.

Following a discussion it appears that the op wants the dc level representative of the on-off periods being equal so: -

The comparator turns the analogue signal into a square wave. If the duty cycle isn't 50:50, the integrator raises or lowers the comparator threshold until it is. Bingo, there's the output.

• Averaging the signal is right method until the asymmetric clipping does not occur. In this particular case, the average value of the clipped signal is higher, than the quiescent DC bias level. Nov 18, 2016 at 15:54
• So, what you appear to be saying is that you want to measure the voltage level of the signal where 50% of the time it is above and 50% of the time it is below, yes? Nov 18, 2016 at 15:58
• If this is true then you need to use a comparator. Feed the signal into a comparator where the comparator reference voltage is set so that the duty cycle on the output is 50%. Now, the tricky bit.... the reference level is derived from a low pass filter (an integrator) that looks at the comparator output. If the comparator output switches between -V and +V, you want the average to be 0V (represents 50:50 duty cycle). So, the integrator integrates the switching and if the comparator output has an "oofset" then the integrator drives the reference voltage to kill the offset and make 50:50 duty. Nov 18, 2016 at 16:04
• Could you attach a simple schematic of this idea? Nov 18, 2016 at 19:07
• Done hopefully. Nov 18, 2016 at 20:10

What you need is an all pass filter. It will delay the signal without changing the frequency content. They are described here; All pass filters

No, the all pass filter will not average the signal. That is what all pass means. Here is a simple second order all pass;

Here is the output at 100Hz;

The loss in gain can be made up in a following gain stage.

Here is the output at 1kHz;

This is starting to show errors at 3kHz;

So, it can be done. Now you need to generate the specitication for the all pass you need and design that.

• I guess the averaging problem may appear again, which was mentioned earlier. In that case, the DC content of delayed signal is affected. Nov 18, 2016 at 19:14