mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-13 00:57:31 -05:00
Updates pull request from Roman Tsypuk to convert the build system from
ant to gradle. Removes linux and windows application launch scripts and produces an executable jar with all resources included.
This commit is contained in:
@@ -0,0 +1,124 @@
|
||||
/*******************************************************************************
|
||||
* SDR Trunk
|
||||
* Copyright (C) 2014,2015 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.module.demodulate.am;
|
||||
|
||||
import io.github.dsheirer.module.Module;
|
||||
import io.github.dsheirer.sample.Listener;
|
||||
import io.github.dsheirer.sample.complex.ComplexBuffer;
|
||||
import io.github.dsheirer.sample.complex.IComplexBufferListener;
|
||||
import io.github.dsheirer.sample.real.IFilteredRealBufferProvider;
|
||||
import io.github.dsheirer.sample.real.RealBuffer;
|
||||
import io.github.dsheirer.dsp.am.AMDemodulator_CB;
|
||||
import io.github.dsheirer.dsp.filter.FilterFactory;
|
||||
import io.github.dsheirer.dsp.filter.Window.WindowType;
|
||||
import io.github.dsheirer.dsp.filter.fir.complex.ComplexFIRFilter_CB_CB;
|
||||
import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB;
|
||||
import io.github.dsheirer.dsp.gain.AutomaticGainControl_RB;
|
||||
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
public class AMDemodulatorModule extends Module
|
||||
implements IComplexBufferListener, IFilteredRealBufferProvider
|
||||
{
|
||||
private static final int SAMPLE_RATE = 48000;
|
||||
|
||||
private ComplexFIRFilter_CB_CB mIQFilter;
|
||||
private AMDemodulator_CB mDemodulator;
|
||||
private RealFIRFilter_RB_RB mLowPassFilter;
|
||||
private AutomaticGainControl_RB mAGC;
|
||||
|
||||
/**
|
||||
* FM Demodulator with integrated DC removal and automatic frequency
|
||||
* correction control.
|
||||
*
|
||||
* @param pass - pass frequency for IQ filtering prior to demodulation. This
|
||||
* frequency should be half of the signal bandwidth since the filter will
|
||||
* be applied against each of the inphase and quadrature signals and the
|
||||
* combined pass bandwidth will be twice this value.
|
||||
*
|
||||
* @param stop - stop frequency for IQ filtering prior to demodulation.
|
||||
*
|
||||
* @param maxFrequencyCorrection - defines the maximum frequency +/- that
|
||||
* the correction controller can adjust from the center tuned frequency.
|
||||
* Set this value to 0 for no frequency correction control.
|
||||
*/
|
||||
public AMDemodulatorModule()
|
||||
{
|
||||
mIQFilter = new ComplexFIRFilter_CB_CB( FilterFactory.getLowPass(
|
||||
SAMPLE_RATE, 5000, 73, WindowType.HAMMING ), 1.0f );
|
||||
|
||||
mDemodulator = new AMDemodulator_CB( 500.0f );
|
||||
mIQFilter.setListener( mDemodulator );
|
||||
|
||||
mLowPassFilter = new RealFIRFilter_RB_RB(
|
||||
FilterFactory.getLowPass( 48000, 3000, 31, WindowType.COSINE ), 1.0f );
|
||||
mDemodulator.setListener( mLowPassFilter );
|
||||
|
||||
mAGC = new AutomaticGainControl_RB();
|
||||
mLowPassFilter.setListener( mAGC );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Listener<ComplexBuffer> getComplexBufferListener()
|
||||
{
|
||||
return mIQFilter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
mIQFilter.dispose();
|
||||
mIQFilter = null;
|
||||
|
||||
mDemodulator.dispose();
|
||||
mDemodulator = null;
|
||||
|
||||
mLowPassFilter.dispose();
|
||||
mLowPassFilter = null;
|
||||
|
||||
mAGC.dispose();
|
||||
mAGC = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFilteredRealBufferListener( Listener<RealBuffer> listener )
|
||||
{
|
||||
mAGC.setListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFilteredRealBufferListener()
|
||||
{
|
||||
mAGC.removeListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start( ScheduledExecutorService executor )
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop()
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,122 @@
|
||||
/*******************************************************************************
|
||||
* sdrtrunk
|
||||
* Copyright (C) 2014-2017 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.module.demodulate.audio;
|
||||
|
||||
import io.github.dsheirer.dsp.filter.FilterFactory;
|
||||
import io.github.dsheirer.dsp.filter.Window;
|
||||
import io.github.dsheirer.dsp.filter.Window.WindowType;
|
||||
import io.github.dsheirer.dsp.filter.dc.DCRemovalFilter_RealBuffer;
|
||||
import io.github.dsheirer.dsp.filter.fir.real.RealFIRFilter_RB_RB;
|
||||
import io.github.dsheirer.module.Module;
|
||||
import io.github.dsheirer.sample.Listener;
|
||||
import io.github.dsheirer.sample.real.IFilteredRealBufferProvider;
|
||||
import io.github.dsheirer.sample.real.IUnFilteredRealBufferListener;
|
||||
import io.github.dsheirer.sample.real.RealBuffer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
public class DemodulatedAudioFilterModule extends Module implements IUnFilteredRealBufferListener, IFilteredRealBufferProvider
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger(DemodulatedAudioFilterModule.class);
|
||||
|
||||
private DCRemovalFilter_RealBuffer mDCFilter;
|
||||
private RealFIRFilter_RB_RB mBandPassFilter;
|
||||
|
||||
/**
|
||||
* Filters demodulated audio and removes any DC component from the buffer
|
||||
*
|
||||
* @param pass - audio pass band pass frequency
|
||||
* @param stop - audio pass band stop frequency
|
||||
*/
|
||||
public DemodulatedAudioFilterModule(int pass, int stop)
|
||||
{
|
||||
assert (stop > pass);
|
||||
|
||||
mDCFilter = new DCRemovalFilter_RealBuffer();
|
||||
|
||||
//TODO: change this to a band pass filter
|
||||
mBandPassFilter = new RealFIRFilter_RB_RB(FilterFactory.getLowPass(48000, pass, stop, 60,
|
||||
WindowType.HANNING, true), 1.0f);
|
||||
|
||||
mDCFilter.setListener(mBandPassFilter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs a demodulated audio filter using the filter taps and gain provided
|
||||
*/
|
||||
public DemodulatedAudioFilterModule(float[] taps, float gain)
|
||||
{
|
||||
mBandPassFilter = new RealFIRFilter_RB_RB(taps, gain);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
mBandPassFilter.dispose();
|
||||
mBandPassFilter = null;
|
||||
|
||||
if(mDCFilter != null)
|
||||
{
|
||||
mDCFilter.dispose();
|
||||
mDCFilter = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFilteredRealBufferListener(Listener<RealBuffer> listener)
|
||||
{
|
||||
mBandPassFilter.setListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeFilteredRealBufferListener()
|
||||
{
|
||||
mBandPassFilter.removeListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(ScheduledExecutorService executor)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public Listener<RealBuffer> getUnFilteredRealBufferListener()
|
||||
{
|
||||
if(mDCFilter != null)
|
||||
{
|
||||
return mDCFilter;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mBandPassFilter;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
/*******************************************************************************
|
||||
* SDR Trunk
|
||||
* Copyright (C) 2014-2016 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.module.demodulate.fm;
|
||||
|
||||
import io.github.dsheirer.dsp.filter.FilterFactory;
|
||||
import io.github.dsheirer.dsp.filter.Window;
|
||||
import io.github.dsheirer.dsp.filter.fir.complex.ComplexFIRFilter_CB_CB;
|
||||
import io.github.dsheirer.dsp.fm.FMDemodulator_CB;
|
||||
import io.github.dsheirer.module.Module;
|
||||
import io.github.dsheirer.sample.Listener;
|
||||
import io.github.dsheirer.sample.complex.ComplexBuffer;
|
||||
import io.github.dsheirer.sample.complex.IComplexBufferListener;
|
||||
import io.github.dsheirer.sample.real.IUnFilteredRealBufferProvider;
|
||||
import io.github.dsheirer.sample.real.RealBuffer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
|
||||
public class FMDemodulatorModule extends Module implements IComplexBufferListener, IUnFilteredRealBufferProvider
|
||||
{
|
||||
private final static Logger mLog = LoggerFactory.getLogger(FMDemodulatorModule.class);
|
||||
|
||||
private static final int SAMPLE_RATE = 48000;
|
||||
|
||||
private ComplexFIRFilter_CB_CB mIQFilter;
|
||||
private FMDemodulator_CB mDemodulator;
|
||||
|
||||
/**
|
||||
* FM Demodulator with I/Q filter. Demodulated output is unfiltered and
|
||||
* may contain a DC component.
|
||||
*
|
||||
* @param pass - pass frequency for IQ filtering prior to demodulation. This
|
||||
* frequency should be half of the signal bandwidth since the filter will
|
||||
* be applied against each of the inphase and quadrature signals and the
|
||||
* combined pass bandwidth will be twice this value.
|
||||
* @param stop - stop frequency for IQ filtering prior to demodulation.
|
||||
*/
|
||||
public FMDemodulatorModule(int pass, int stop)
|
||||
{
|
||||
assert (stop > pass);
|
||||
|
||||
mIQFilter = new ComplexFIRFilter_CB_CB(FilterFactory.getLowPass(
|
||||
SAMPLE_RATE, pass, stop, 60, Window.WindowType.HAMMING, true), 1.0f);
|
||||
|
||||
mDemodulator = new FMDemodulator_CB(1.0f);
|
||||
mIQFilter.setListener(mDemodulator);
|
||||
}
|
||||
|
||||
public FMDemodulatorModule(float[] filter)
|
||||
{
|
||||
mIQFilter = new ComplexFIRFilter_CB_CB(filter, 1.0f);
|
||||
mDemodulator = new FMDemodulator_CB(1.0f);
|
||||
mIQFilter.setListener(mDemodulator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Listener<ComplexBuffer> getComplexBufferListener()
|
||||
{
|
||||
return mIQFilter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose()
|
||||
{
|
||||
mIQFilter.dispose();
|
||||
mIQFilter = null;
|
||||
|
||||
mDemodulator.dispose();
|
||||
mDemodulator = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset()
|
||||
{
|
||||
mDemodulator.reset();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUnFilteredRealBufferListener(Listener<RealBuffer> listener)
|
||||
{
|
||||
mDemodulator.setListener(listener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeUnFilteredRealBufferListener()
|
||||
{
|
||||
mDemodulator.removeListener();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void start(ScheduledExecutorService executor)
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stop()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user