Fixing bug in multi-channel normalization for time domain and improving...

Fixing bug in multi-channel normalization for time domain and improving spektrum gain setting to individual channels
parent c8a36159
......@@ -74,7 +74,7 @@ if sArgs.allchannels
gainApplied = nan(1, result.nChannels);
for ch_idx = 1:result.nChannels
gainApplied(1, ch_idx) = max(abs(result.dat(ch_idx,:)));
result.dat(ch_idx,:) = result.dat(ch_idx,:) ./ gainApplied;
result.dat(ch_idx,:) = result.dat(ch_idx,:) ./ gainApplied(1, ch_idx);
end
else
gainApplied = max(max(abs(result.timeData)));
......
......@@ -66,9 +66,10 @@ end
%% Normalize
if sArgs.allchannels
gainApplied = nan(1, result.nChannels);
for ch_idx = 1:result.nChannels
gainApplied = max(abs(result.freqData(:,ch_idx)));
result.freqData(:,ch_idx) = result.freqData(:,ch_idx) ./ gainApplied;
gainApplied(1, ch_idx) = max(abs(result.freqData(:,ch_idx)));
result.freqData(:,ch_idx) = result.freqData(:,ch_idx) ./ gainApplied(1, ch_idx);
end
else
gainApplied = max(max(abs(result.freqData)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment