How to denoise and get rid of 1/f trend of a PSD in an EEG synchronization experiment
Apparently the paper you mention is simply evaluating the median in the EEG spetrum. Say that for all your channels you get a 3D matrix PSD, with dimension 1 the number of channel, dimension 2 the time windows, and dimension 3 the frequencies. In pseudocode the article computes M = median(median(PSD,2),1), then removes the trend with CorrectedPSD = PSD - M. Which is actually fairly simple.