modified code to handle None value of spectra

in cases where NaNs invalidate whole trials, return value of _per_event
time_frequency is None; functions now updated to handle this
appropriately by returning early