An extension of classical harmonic analysis is used to determine the Fourier coefficients with a constraint of forcing the function through a specified value for developing an extended stochastic harmonic analysis (ESHA). The methodology was applied to the diurnal variations of dissolved oxygen (DO) in streams within a semiempirical modeling scheme to demonstrate the formulation of an ESHA algorithm. Since DO values are often measured at different times during the day, the ESHA algorithm was used to convert data measured at any clock time to those at a standard or reference time. The model was evaluated for five different streams in Minnesota that capture the impact of different ecoregions and different sizes of watersheds. Data were normalized to increase the general applicability of the fitted parameters. The ESHA was successful in representing observed diurnal variations in DO. The root-mean-square error (RMSE) for predicting hourly DO and standard DO ranged respectively from 0.43 to 0.77 mg/L and 0.37 to 0.90 mg/L among the five streams. Estimated model parameters were robust in terms of both spatial and temporal variations. Parameter uncertainties and associated model sensitivity were demonstrated analytically. The developed algorithm can be used for similar applications in numerous science and engineering disciplines. In particular, it is a potentially useful tool for total maximum daily load (TMDL) assessment of aquatic ecosystem health across a range of spatial and temporal scales.