Resolves 1122. Adds decimation to NBFMDecoder so that channel bandwidth is reduced to min sample rate needed. This reduces the impact on channel power measurement from adjacent channels. (#1129)

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
Denny Sheirer
2022-01-02 08:35:19 -05:00
committed by GitHub
parent 2a0427c559
commit 8413343e76
9 changed files with 234 additions and 58 deletions

View File

@@ -1,18 +1,21 @@
/*******************************************************************************
* sdr-trunk
* Copyright (C) 2014-2018 Dennis Sheirer
/*
* *****************************************************************************
* Copyright (C) 2014-2022 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 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.
* 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/>
*
******************************************************************************/
* 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.buffer;
import org.slf4j.Logger;
@@ -50,6 +53,14 @@ public abstract class AbstractReusableBufferQueue<T extends AbstractReusableBuff
{
}
/**
* Turns on/off logging of buffer creation
*/
public void setDebugLogging(boolean enabled)
{
mBufferCreationLoggingEnabled = enabled;
}
/**
* Disposes of any reclaimed buffers to prepare this queue for disposal.
*/

View File

@@ -1,18 +1,21 @@
/*******************************************************************************
* sdr-trunk
* Copyright (C) 2014-2018 Dennis Sheirer
/*
* *****************************************************************************
* Copyright (C) 2014-2022 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 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.
* 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/>
*
******************************************************************************/
* 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.buffer;
import org.slf4j.Logger;
@@ -61,4 +64,31 @@ public class ReusableComplexBufferQueue extends AbstractReusableBufferQueue<Reus
return buffer;
}
/**
* Returns a buffer loaded with the samples.
* @param samples to load
* @param timestamp to apply
* @return buffer
*/
public ReusableComplexBuffer getBuffer(float[] samples, long timestamp)
{
ReusableComplexBuffer buffer = getRecycledBuffer();
if(buffer == null)
{
buffer = new ReusableComplexBuffer(this, samples);
buffer.setTimestamp(timestamp);
buffer.setDebugName("Owner:" + getDebugName());
incrementBufferCount();
}
else
{
buffer.reloadFrom(samples, timestamp);
}
buffer.incrementUserCount();
return buffer;
}
}