1. Let us denote the input data series as $x(i)$ for $i = 1,2,\ldots,N$, with $N$ number of points. The mean values of this series is calculated as $\bar{x} = \frac{1}{N}\sum_{i=1}^{N} x(i)$. Then accumulated deviation series for $x(i)$ is calculated as per the below equation.
\begin{eqnarray}
X(i) \equiv \sum_{k=1}^{i} [x(k)-\bar{x}], i = 1,2,\ldots,N \nonumber
\end{eqnarray}
This subtraction of the mean($\bar{x}$) from the data series, is a standard way of removing noisy data from the input data series. The effect of this subtraction would be eliminated by the detrending in the fourth step.

2. $X(i)$ is divided into $N_s$ non-overlapping segments, where $N_s \equiv int(N/s)$, $s$ is the length of the segment. In our experiment $s$ varies from $16$ as minimum to $1024$ as maximum value in log-scale.

3. For each $s$, we denote a particular segment by $v$($v = 1,2,\ldots,N_s$). For each segment least-square fit is performed to obtain the local trend of the particular segment~.
Here $x_v(i)$ denotes the least square fitted polynomials for the segment $v$ in $X(i)$. $x_v(i)$ is calculated as per the equations $x_v(i) = \sum_{k=0}^{m} {C_{k}}{(i)^{m-k}}$, where $C_{k}$ is the $k$th coefficients of the fit polynomials with degree $m$. For fitting linear, quadratic, cubic or higher $m$-order polynomials may be used~. For this experiment $m$ is taken as $1$ for linear fitting.

4. To detrend the data series, we have to subtract the polynomial fit from the data series. There is presence of slow varying trends in natural data series. Hence to quantify the scale invariant structure of the variation around the trends, detrending is required.
Here for each $s$ and segment $v \in 1,2,\ldots,N_s$, detrending is done by subtracting the least-square fit $x_v(i)$ from the part of the data series $X(i)$, for the segment $v$ to determine the variance, denoted by $F^2(s,v)$ calculated as per the following equation.
\begin{eqnarray}
F^2(s,v) \equiv \frac{1}{s}\sum_{i=1}^{s} \{X[(v-1)s+i]-x_v(i)\}^2, \nonumber
\end{eqnarray}
where $s \in 16,32,\ldots,1024$ and $v \in 1,2,\ldots,N_s$.

5. Then the $q$th-order fluctuation function, denoted by $F_q(s)$, is calculated by averaging over all the segments($v$) generated for each of the $s \in 16,32,\ldots,1024$ and for a particular $q$, as per the equation below.
\begin{eqnarray}
F_q(s) \equiv \left\{\frac{1}{N_s}\sum_{v=1}^{N_s} [F^2(s,v)]^{\frac{q}{2}}\right\}^{\frac{1}{q}}, \nonumber
\end{eqnarray}
for $q \neq 0$ because in that case $\frac{1}{q}$ would blow up. In our experiment $q$ varies from $(-5)$ to $(+5)$. For $q = 2$, calculation of $F_q(s)$ boils down to standard method of Detrended Fluctuation Analysis(DFA)~.

6. The above process is repeated for different values of $s \in 16,32,\ldots,1024$ and it can be seen that for a specific $q$, $F_q(s)$ increases with increasing $s$. If the series is long range power correlated, the $F_q(s)$ versus $s$ for a particular $q$, will show power-law behavior as below.
\begin{eqnarray}
F_q(s) \propto s^{h(q)} \nonumber
\end{eqnarray}
If this kind of scaling exists, $\log_{2} [F_q(s)]$ would depend linearly on $\log_{2} s$, where $h(q)$ is the slope which depends on $q$. $h(2)$ is similar to the well-known \textbf{Hurst exponent}~. So, in general, $h(q)$ is the generalized Hurst exponent.

7. For monofractal series, the scaling behavior of the variance $F^2(s,v)$ is exactly same for all segments. So, the averaging process would yield identical scaling behavior for different values of $q$ and so $h(q)$ becomes independent of $q$.

But, if small and large fluctuations have different scaling behavior, then $h(q)$ becomes largely dependent on $q$. $h(q)$ describes scaling pattern of the segments with large fluctuations for positive values of $q$ and similarly, $h(q)$ describes scaling pattern of the segments with small fluctuations for negative values of $q$. So, the generalized Hurst exponent $h(q)$ for a multifractal series is related to the classical multifractal scaling exponent $\tau_(q)$ as per the equation below.
\begin{eqnarray}
\tau_(q) = qh(q)-1 \nonumber
\end{eqnarray}

8. Multifractal series have multiple Hurst exponents, and so $\tau_(q)$ depends nonlinearly on $q$~. The singularity spectrum-$f(\alpha)$ is related to $h(q)$ as per the below equation.
\begin{eqnarray}
\alpha = h(q)+qh'(q)\text{ and } f(\alpha) = q[\alpha-h(q)]+1 \nonumber
\end{eqnarray}
Here $\alpha$ is singularity strength and $f(\alpha)$ describes the dimension of the subset series indicated by $\alpha$. The resultant multifractal spectrum $f(\alpha)$ is an arc where the difference between the maximum and minimum value of $\alpha$, is the \textbf{width of the multifractal spectrum} which is the amount of the multifractality of the input data series.

References
1. J. , S. , E.-B. , S. , A. and H. , "Multifractal detrended fluctuation analysis of nonstationary time series", "Physica A: Statistical Mechanics and its Applications" "316"(0000), no. "1", 87---114.
2. Y. Ashkenazy, S. Havlin, P. Ivanov, C.-K. Peng, V. Schulte-Frohlinde and H. Stanley, Magnitude and sign scaling in power-law correlated time series, Physica A: Statistical Mechanics and its Applications 323(2003), 19---41.
3. C.-K. Peng, S. Buldyrev, S. Havlin, M. Simons, H. Stanley and A. Goldberger, Mosaic organization of DNA nucleotides, Physical Review E 49(1994), no. 2, 1685---1689.