In high-critical temperature superconductors, such as cuprates and pnictides, magnetic interactions are believed to play a crucial role in the microscopic mechanism leading to pairing. Despite extensive experimental and theoretical efforts, understanding the relation between the superconducting mechanism and the magnetic excitation spectrum unveiled by neutron scattering and resonant inelastic x-ray scattering spectroscopy remains elusive. In particular, model Hamiltonian studies of these systems are challenging because of the absence of reliable many-body tools in layered geometries, particularly in the presence of many active orbitals. However, at least in the context of the cuprates, the investigation of crystal structures simpler than layers, e.g. two-leg ladders, has proved to be a very fruitful path for progress in the field. The reason is two-fold: cuprates ladders compounds show intriguing quantum mechanical properties, such as superconductivity under pressure, a spin gap in the undoped regime, while pairing instability upon hole doping; theorists can perform model Hamiltonian calculations with much more accuracy in quasi one-dimensional systems than in two dimensions. It is therefore of paramount importance to study the magnetic excitation spectrum of model Hamiltonians showing unconventional superconducting tendencies in quasi-one dimensional geometries. Using the density matrix renormalization group method, I calculate the dynamical spin structure factor of a generalized t−U−J Hubbard model in a two-leg ladder geometry. The generalized t−U−J model allows for an exchange correlation strength J independent of U, enhancing pairing tendencies that would otherwise be weak. At half-filling, we compare the spin spectra, obtained directly in frequency space [Phys. Rev. E 94, 053308 (2016)], with those obtained with the Heisenberg model [Phys. Rev. B 94, 205145 (2016)]. Moreover, motivated by the recent neutron scattering study of the spin gap evolution upon doping in the spin-ladder compound Sr_(14−x) Ca_x Cu_24 O_4 [Phys. Rev. B 88, 014504 (2013)], I then study systematically the magnetic spectral weight distribution and the dispersion of the magnetic excitations as a function of hole doping, Coulomb repulsion, and magnetic exchange interactions. I finally discuss the implications of the results for RIXS and neutron scattering experiments.