In the expanding universe, relativistic scalar fields are thought to be attenuated by "Hubble friction," which results from the dilation of the underlying spacetime metric. By contrast, in a contracting universe this pseudofriction would lead to amplification. Here, we experimentally measure, with fivefold better accuracy, both Hubble attenuation and amplification in expanding and contracting toroidally shaped Bose-Einstein condensates, in which phonons are analogous to cosmological scalar fields. We find that the observed attenuation or amplification depends on the temporal phase of the phonon field, which is only possible for nonadiabatic dynamics. The measured strength of the Hubble friction disagrees with recent theory [Gomez Llorente et al., Phys. Rev. A 100, 043613 (2019) and Eckel et al., SciPost Phys. 10, 64 (2021)].