Bug fix for rainbow click bearings

Bug fix when rainbow clicks are imported mean bearings cannot be calculated - was an array size issue in DelayGroup
This commit is contained in:
Jamie Mac 2022-03-18 11:14:00 +00:00
parent d3fa533122
commit 7e90b4019d

View File

@ -84,13 +84,16 @@ public class DelayGroup {
int iOut = 0; int iOut = 0;
//if max delays is null then it's just the spectrum length //if max delays is null then it's just the spectrum length
if (maxDelays==null) { //added maxDelays.length!=nOutputs because imported clicks (e.g. from Rainbow clicks) can have
//a maxDelays length of 0.
if (maxDelays==null || maxDelays.length!=nOutputs) {
maxDelays = new double[waveformInput.length]; maxDelays = new double[waveformInput.length];
for (int i = 0; i < nOutputs; i++) { for (int i = 0; i < nOutputs; i++) {
maxDelays[i]=specData[0].getFftLength(); maxDelays[i]=specData[0].getFftLength();
} }
} }
//perform the time delay calculations //perform the time delay calculations
for (int i = 0; i < nChan; i++) { for (int i = 0; i < nChan; i++) {
for (int j = i+1; j < nChan; j++, iOut++) { for (int j = i+1; j < nChan; j++, iOut++) {