Don't do this:
abs_delta = sum(cut_frequencies(p,freqArray,1,4),1)
abs_theta = sum(cut_frequencies(p,freqArray,4,8),1)
abs_alpha1 = sum(cut_frequencies(p,freqArray,8,11),1)
abs_alpha2 = sum(cut_frequencies(p,freqArray,11,14),1)
abs_beta1 = sum(cut_frequencies(p,freqArray,14,20),1)
abs_beta2 = sum(cut_frequencies(p,freqArray,20,31),1)
abs_gamma = sum(cut_frequencies(p,freqArray,31,50),1)
total = sum(cut_frequencies(p,freqArray,1,50),1)
instead keep an array of frequency band cuts and iterate through it:
cuts = [
1 4;
4 8;
8 11;
11 14;
14 20;
20 31;
31 50]
This makes the band creation more programatic, and can be used to select band cuts by the scientist running the script.
Don't do this:
instead keep an array of frequency band cuts and iterate through it:
This makes the band creation more programatic, and can be used to select band cuts by the scientist running the script.