The capacitor discharges in around 5RC, when we have an ac signal of 40Hz, and we want to match the frequency, we can calculate the following: $$ \begin{flalign} &\tau = RC &\\\ &f = 40Hz = \frac{1}{40}ds \\ &\textit{Lets put the resistor to 1k}\ohm\\ &\frac{1}{80} = 1000*C & | \div 1000 \\ &\frac{1}{80000} = C\\ &C = 12.5 \micro F\\ \end{flalign} $$ ```circuitjs $ 1 0.000005 9.78399845368213 50 5 43 5e-11 R 80 224 0 224 0 2 40 5 0 0 0.5 c 80 224 192 224 0 0.00001 -1.936025478465976 0.001 r 192 224 192 304 0 1000 g 192 304 192 336 0 0 O 192 224 304 224 0 0 o 4 64 0 151554 10 0.1 0 1 o 0 64 0 151554 10 0.1 0 2 0 3 ``` ![[spike-circuit-rc-relation.png]]