Hi, Yasir-
Thanks for both those explanations-- that states everything quite clearly.
I think you could equivalently compare the power spectral slopes of runs of different lengths. The potential difference from run length and TR of your rest and task dsets will be having different numbers of points in your frequency graph, as well as slightly different locations.
The Nyquist frequency (maximal frequency) will be: 1 / (2*TR).
The number of time points between [0, Nyquist] will be: ~N/2, with the approx coming in depending on whether N is even or odd.
The spacing along the frequency axis will be: ~ [1/(2*TR)] / [N/2] = 1/N*TR.
Effectively, you will have more points to fit in the longer run-- but that fact should appear in the plus/minus of the fitting to a linear slope.
Note that having 3 task runs, you have a choice: you could concatenate them and take the FT of the resulting longer run. Or, you could take the FT of each run separately, and average their spectra. Note that the upper frequency (Nyquist) in each case is the same-- you would either have fewer frequencies between [0, Nyquist] with smaller uncertainty or more frequencies of larger uncertainty. Since you are going to use a windowing function, the result should really be pretty similar, I would think.
Separate question: have any of these time series been censored? If so, you effectively have non-uniform sampling, and the classical FT assumptions no longer work. But you can use the Lomb-Scargle (yes, real name) transformation as a generalization, as long as the censoring is effectively random (that is, not every other time point, or something). They you could use 3dLombScargle to generate the power spectrum.
--pt