# How can I calculate the gain of this high pass active filter?

This is the circuit I'm trying to make:

This is the circuit I made for simulation in Proteus:

These are my measured values as a result of Proteus simulation.

This circuit is used to measure the voltage of 220V / 50Hz with 0V-5V at the output.

I cannot calculate the gain of this circuit.I know how to calculate the gain of the first op-amp at the junction of R1 and C1 that: We need to find the resistances of C2 and C1 at 50Hz and get their equivalents with R5 and R4, then we need to divide the results we find by each other and find the gain.

For example; 50Hz reactance for C1 is 3.183kOhm from 1/(2pif*C). Therefore, it makes 13.183k below. The 50Hz reactance for C2 is 31.831MOhm. Equivalent with R5 makes 99.686k. So I calculate the gain as 99.686k / 13.183k = 7.562. The same goes for the 2nd opamp, but somewhere I think I am thinking wrong.

According to the simulation result, the input voltage of the first opamp (U1.1) is 30mV and the output voltage is 550mV. Therefore, there is a gain of 18.3 times. Also, the second opamp (U1.2) has an input voltage of 550mV and an output voltage of 5V. Therefore, there is a gain of 9.09 times. I can't find how to calculate these gains and I can't understand why the gains are different even though the two opamp circuits are the same.

How can we calculate this? What am I doing wrong?

I can see two cascade-connected AC-coupled single-supply inverting amplifiers built with a single LM358 which contains two op amps.

An op amp with dual supply (e.g. ±5V) is expected to amplify negative signals because the output can swing towards the negative supply rail. When it's single supplied i.e. the negative supply rail is 0V (ground), the output cannot swing below 0V. The solution is to apply a positive voltage (ideally, half the supply) to the non-inverting input so the output can have an enough offset (i.e. room for negative swing). The crucial point is to make sure the output doesn't have too high offset so the output doesn't clip.

In your circuits each amplifier has a 2.5V offset applied to their non-inverting inputs through voltage dividers (R2-R3 and R10-R11, which are all 10k).

• At DC (capacitors open circuit) the amplifiers turn into buffers so the outputs are equal to the non-inverting input voltages (2.5V here).
• At AC the non-inverting inputs are connected to ground through the equivalent of divider resistors (parallel, therefore 5k) so they work as inverting amplifiers. The gain is frequency-dependent because of the presence of C1 and C4 (both 1μ). Basically, it's

$$A_V(f)=-\frac{100k}{10k+\frac{-j}{2\pi \ f \ C}}; \ C = 1\mu \$$

So the actual outputs will be the amplified signal with an offset of 2.5V. The series capacitors (C1 and C4) remove the DC offset before amplification so the DC offsets will not be amplified.

NOTE: I intentionally ignored 100p as it has negligibly high reactance at the frequency of interest.

but somewhere I think I am thinking wrong

When there is a resistor and a reactive component is connected in series, you cannot just sum the reactances to find the equivalent reactance. They form a complex number so you need to find the magnitude of the number. In your case, the capacitor's impedance points towards the negative imaginary axis whilst the resistor's points to positive real axis. These to form a right triangle so the magnitude becomes the hypotenuse:

$$Z = R + Z_C =R + \frac{1}{j\omega C}=R + \frac{-j}{\omega C} \\ |Z|=\sqrt{Z_C^2+R^2}$$

At 50 Hz, C1 and C4 show a reactance of 3.18 kΩ, so the effective reactance will be ~10.5 kΩ. So the gains of both amplifiers at 50 Hz will be

$$A_V(50) = -\frac{100k}{|Z(50)|}=-\frac{100k}{\sqrt{3.18k^2+10k^2}}=-\frac{100k}{10.5k}=-9.53$$