Using Opamp as rectifier
Look at what happens at the peaks and valleys.

When the inverting input of your opamp is high, it will try to sink current, but it cannot because of diode D2.  That voltage will go across R4 and make N_HALF high.

When the inverting input is low, the opamp will now source current through D2, also making N_HALF high.  The current through R4 will be reversed.