Amplitude models are constructed to describe the resonance structure of and decays using pp collision data collected at centre-of-mass energies of 7 and 8 TeV with the LHCb experiment, corresponding to an integrated luminosity of 3.0 . The largest contributions to both decay amplitudes are found to come from axial resonances, with decay modes and being prominent in and , respectively. Precise measurements of the lineshape parameters and couplings of the , and resonances are made, and a quasi model-independent study of the resonance is performed. The coherence factor of the decays is calculated from the amplitude models to be , which is consistent with direct measurements. These models will be useful in future measurements of the unitary-triangle angle and studies of charm mixing and violation.