Electrochemical Impedance Spectroscopy (EIS) is a key technique for taking a snapshot of an electrochemical system near equilibrium conditions. Due to the richness of the complex-valued dataset and its simple experimental operation, it is currently being investigated as a test to diagnosis battery health and degradation details. Nevertheless, challenges with use of EIS is in interpreting the measured impedance. Current methods for analysis involving either fitting simplified equivalent circuit models or inverting distribution of relaxation times with a singular basis function. Because of these methods' simplifications, their results sometime fail to capture both the complex and heterogeneous underlying physics.Here, we present a novel algorithm for the inversion of EIS data for battery systems, which generalizes the inversion problem to any given linear equivalent circuit model, allowing for the analysis of complicated electrochemical systems. Importantly, this algorithm provides two clear benefits. First, it allows for the analysis of both bounded and unbounded processes, something quite common to battery systems and is vital in understanding non-obvious relationships in degraded batteries. Second, the distribution of independent processes, which can correspond to different physical phenomena, are also inverted by this algorithm. These distributions contain vital features in the identification and prediction of battery state-of-health. Overall, this tool will be indispensable in the analysis of degradation extent over battery aging, and provide an algorithmic framework for interpreting EIS measurements of complicated electrochemical systems.