Imagine that bob is on the surface of the sea when water waves move towards him from the left to right as the crest of the wave approaches bob is he moving up or down?

As the wave moves towards the right Bob will be moving up and down but not sideways.

after passing of each peak and as the bottom of the wave approaches bob is he moving up or down

As the wave propagates we track Bob’s vertical displacement at a fixed horizontal position. this allows us to describe how the wave’s displacement varies with time.

from the moment bob first met the water wave until passing of 2 complete waves his displacement time graph is shown.

Displacement time graph describes the displacement of Bob relative to his rest position over a time interval. from his displacement time graph we can able to deduce the period, and hence the frequency.