This commit is contained in:
Jamie Mac 2022-03-18 11:16:43 +00:00
commit eabc4bc3f0
3 changed files with 21 additions and 7 deletions

View File

@ -84,16 +84,19 @@ public class DelayGroup {
int iOut = 0;
//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];
for (int i = 0; i < nOutputs; i++) {
maxDelays[i]=specData[0].getFftLength();
}
}
//perform the time delay calculations
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++) {
TimeDelayData td = correlations.getDelay(specData[i].getFftData(), specData[j].getFftData(),
delayParams, sampleRate*delayParams.getUpSample(), specData[i].getFftLength(), maxDelays[iOut]);
td.scaleDelay(1./ delayParams.getUpSample());

View File

@ -125,8 +125,6 @@ public class ClickFFTPlotManager2 extends FFTPlotManager {
double[] minMax=PamUtils.getMinAndMax(spectrum);
double cutOff=clickPlotInfoFX.getClickDisplayParams().fftCutOf*minMax[1];
double binSize = maxFreq/(double) spectrum.length;
// System.out.println("cutOff: "+cutOff+ " fftCutOf: " + clickDisplayParams.fftCutOf);
int y1, y2;
@ -144,8 +142,6 @@ public class ClickFFTPlotManager2 extends FFTPlotManager {
y1=writableImage.getScrollingPLot2DSegmenter().getImageYPixels(0, writableImage);
y2=writableImage.getScrollingPLot2DSegmenter().getImageYPixels(maxFreq, writableImage);
strokeLine(writableImage, tc, y1, y2, ffColor);
}

View File

@ -348,6 +348,9 @@ public abstract class FFTPlotManager {
//how many lines in the image does the FFT take up?
Color prevCol;
Color col = null;
int argb;
for (int j=0; j<writableImage.getHeight(); j++) {
writableImage.getPixelWriter().setColor(0, j, Color.BLACK);
@ -360,7 +363,19 @@ public abstract class FFTPlotManager {
//find the correct colour for the spectrogram value and draw
for (int k=0; k<nslices; k++) {
if ((tc+k)>=writableImage.getWidth()) continue;
writableImage.getPixelWriter().setColor(tc+k, j, getSpectrumColour(spectrogram[i][spec], clipLevel, rawClipInfo.getDataBlock().getSampleRate(), fftLength));
//what do we do if a colour is already there? Take an avaerge with the other colours...
argb = writableImage.getPixelReader().getArgb(tc+k, j);
col = getSpectrumColour(spectrogram[i][spec],clipLevel, rawClipInfo.getDataBlock().getSampleRate(), fftLength);
if (argb>0) {
prevCol = Color.rgb((argb >> 16) & 0xFF, (argb >> 8) & 0xFF, (argb) & 0xFF);
col = Color.rgb((int) (col.getRed()+prevCol.getRed())/2, (int) (col.getGreen()+prevCol.getGreen())/2,
(int) (col.getBlue()+prevCol.getBlue())/2);
}
writableImage.getPixelWriter().setColor(tc+k, j, col);
}
}
// }