So I have the following code:
noise_power = min(power); signal_power = max(power); %energy threshold = max(.01, min(0.009, noise power*1000) energy threshold =