How can I measure the charge of a pulse imposed on a signal?
Charge, Q, coulombs, is current x time.

$$ Q = I \cdot t $$.

For varying current, to measure charge passing through a point you integrate the current with respect to time.

$$ Q = \int I dt  $$

Your problem will be extracting this from the 60 Hz but you have given no information on the setup.


  Basically, if I have a pulsating current, how can I find how many charges are pulsating, causing this AC current? I want to know how many coulombs are going back and forth. – Sam


To measure the charge going back and forth you need to measure the 40 kHz component of the current. Since it's a square-wave then the charge per half-cycle is given by \$ Q = I_{PEAK} dt = \frac {1}{2}\frac {i_{PEAK}}{40,000} \$.