def median(timeseries, segmentlength, **kwargs):
if scipy_version <= '<STR_LIT>':<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>",<EOL>)<EOL><DEDENT>kwargs.setdefault('<STR_LIT>', '<STR_LIT>')<EOL>return welch(timeseries, segmentlength, **kwargs)<EOL>
Calculate a PSD using Welch's method with a median average