For resonance to occur, the driving frequency (frequency you push it at) has to equal the natural frequency with the natural frequency being the frequency something vibrates if you just pulled it and let it go.
For a pendulum, T = 2π√(L/G) with f = 1/T. Therefore, f = 1/2π x √(G/L). L = length of the pendulum while G is gravity at 9.8.
For a mass on a spring, T = 2π√(m/k) with f =1/T. Therefore, f = 1/2π x √(k/m). k is the spring constant of that spring with m being the mass of the spring.
Why Do Things Resonate?
As a summary:
- Simple harmonic motions resonate when the driving frequency reaches the natural frequency.
- The time period of one oscillation for a pendulum is 2π√(L/G).
- The time period of one oscillation for a spring is 2π√(m/k).