The short period fluctuations of the geomagnetic field observed in the secular acceleration have a strong presence near the equatorial region of the Earth. Origin of such fluctuations is believed to be the equatorially confined waves below the core-mantle boundary in the fluid outer core. The state of the outer core, being in a balance between the magnetic, Coriolis and buoyancy forces, can lead to the generation of such waves if a stably stratified layer exists in the outermost regions of the core. In this study, a shallow water magnetohydrodynamical model is used to investigate the characteristics of such equatorially trapped waves with a multilayered stratification and background magnetic field. A two-layer model is implemented to study the effects of radially varying background magnetic fields on the equatorially confined waves. Analytical derivation of the dispersion relation and numerical solutions have been performed to characterise these waves.The role of change in buoyancy frequency across the two layers in modifying the equatorially trapped waves is investigated.