Vibration of the basilar membrane

(a) Sound entering the external ear canal vibrates the tympanic membrane, and this vibration is mechanically transmitted by ossicles to the cochlea (red arrow).  Vibration of the stapes generates a fluid pressure fluctuation in the cochlea.  This phenomenon produces traveling waves on the basilar membrane, which are similar to waves beating upon a seashore.
(b) The position where the amplitude of this traveling wave has a peak depends on the frequency of sound.  The amplitude of the traveling wave has a peak near the base of the cochlea when high frequency sound enters the cochlea, while low frequency sound develops a peak near its apex.  Thus, frequency selectivity of the cochlea is realized.