#39 WIP - adds support for timestamped complex buffers so that decoded

messages and events can be accurately timestamped, and more importantly,
allocated traffic channels can request to be pre-loaded with buffered
samples to ensure that traffic channels don't miss any samples that
are currently missed due processing latency inherent in current buffer
sizing.  This should reduce the clipping of starting messages or voice
on the traffic channels.

Restructures processing path for tuner frequency and sample rate change
events.  The tuner now embeds these events in the sequence of buffers
that are generated immediately after the event occurs since those are
the buffers that will be impacted by the change.  Previously, the change
event would be broadcast throughout the system and would impact any
buffered/cached buffers.  This also reduces the number of source event
change listeners that have to be managed.  Note: this change is not yet
implemented in all tuners ... only in the TestTuner implementation.

Updates the polyphase channelizer to now buffer channel results and then
dispatch the buffer to the channel output processors to improve efficiency
of using float arrays versus single value complex float processing.
This commit is contained in:
Denny
2018-01-13 09:10:57 -05:00
parent d2e7f008c8
commit 05fa5c25fd
25 changed files with 962 additions and 277 deletions

View File

@@ -1,26 +1,51 @@
/*******************************************************************************
* sdr-trunk
* Copyright (C) 2014-2018 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <http://www.gnu.org/licenses/>
*
******************************************************************************/
package io.github.dsheirer.sample.real;
import io.github.dsheirer.sample.Buffer;
import io.github.dsheirer.source.SourceEvent;
import java.util.Arrays;
public class RealBuffer extends Buffer
{
/**
* Wrapper around float array containing real float samples
*/
public RealBuffer( float[] samples )
{
super( samples );
}
/**
* Wrapper around float array containing real float samples and an optional source event that should be processed
* prior to processing the sample array data.
*/
public RealBuffer(float[] samples, SourceEvent sourceEvent)
{
super(samples, sourceEvent);
}
/**
* Creates a deep copy of the buffer
*/
public RealBuffer copyOf()
{
float[] copy = Arrays.copyOf( mSamples, mSamples.length );
return new RealBuffer( copy );
}
/**
* Wrapper around float array containing real float samples
*/
public RealBuffer(float[] samples)
{
super(samples);
}
/**
* Creates a deep copy of the buffer and a shallow (reference) copy of the source event
*/
public RealBuffer copyOf()
{
float[] copy = Arrays.copyOf(getSamples(), getSamples().length);
return new RealBuffer(copy, getSourceEvent());
}
}