A method and system for determining a respiratory rate of a user using an electrocardiogram (ECG) segment of the user are disclosed. The method comprises decomposing the ECG segment into a plurality of functions and evaluating the plurality of functions to choose one of the plurality of functions based on a respiratory band power. The method includes determining the respiratory rate using the one of the plurality of functions and a domain detection.