Added missing files, ENUMed modulation modes

This commit is contained in:
furrtek
2016-01-05 11:47:46 +01:00
parent 9b8b8cc83f
commit 3477a2691a
34 changed files with 583 additions and 98 deletions

View File

@@ -41,6 +41,8 @@
#include "touch_dma.hpp"
#include "modules.h"
#include "dsp_decimate.hpp"
#include "dsp_demodulate.hpp"
#include "dsp_fft.hpp"
@@ -57,9 +59,9 @@
#include "proc_am_audio.hpp"
#include "proc_nfm_audio.hpp"
#include "proc_wfm_audio.hpp"
//#include "proc_ais.hpp"
#include "proc_ais.hpp"
#include "proc_wideband_spectrum.hpp"
//#include "proc_tpms.hpp"
#include "proc_tpms.hpp"
#include "proc_afskrx.hpp"
#include "proc_sigfrx.hpp"
@@ -390,46 +392,46 @@ int main(void) {
delete old_p;
switch(message->configuration.mode) {
case 0:
case RX_NBAM_AUDIO:
direction = baseband::Direction::Receive;
baseband_thread.baseband_processor = new NarrowbandAMAudio();
break;
case 1:
case RX_NBFM_AUDIO:
direction = baseband::Direction::Receive;
baseband_thread.baseband_processor = new NarrowbandFMAudio();
break;
case 2:
case RX_WBFM_AUDIO:
baseband_thread.baseband_processor = new WidebandFMAudio();
break;
/*case 3:
case RX_AIS:
direction = baseband::Direction::Receive;
baseband_thread.baseband_processor = new AISProcessor();
break;*/
break;
case 4:
case RX_WBSPECTRUM:
direction = baseband::Direction::Receive;
baseband_thread.baseband_processor = new WidebandSpectrum();
break;
/*case 5:
case RX_TPMS:
direction = baseband::Direction::Receive;
baseband_thread.baseband_processor = new TPMSProcessor();
break;*/
break;
case 6:
case RX_AFSK:
direction = baseband::Direction::Receive;
baseband_thread.baseband_processor = new AFSKRXProcessor();
break;
case 7:
case RX_SIGFOX:
direction = baseband::Direction::Receive;
baseband_thread.baseband_processor = new SIGFRXProcessor();
break;
case 0xFF:
case SWITCH:
wait_for_switch();
default:

View File

@@ -0,0 +1,69 @@
/*
* Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
*
* This file is part of PortaPack.
*
* 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 2, 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; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#include "proc_sigfrx.hpp"
#include <cstdint>
#include <cstddef>
void SIGFRXProcessor::execute(buffer_c8_t buffer) {
/* Called every 2048/3072000 second -- 1500Hz. */
auto decimator_out = decimator.execute(buffer);
const buffer_c16_t work_baseband_buffer {
(complex16_t*)decimator_out.p,
sizeof(*decimator_out.p) * decimator_out.count
};
/* 192kHz complex<int16_t>[64]
* -> 96kHz int16_t[32] */
//auto channel = channel_filter.execute(decimator_out, work_baseband_buffer);
// TODO: Feed channel_stats post-decimation data?
feed_channel_spectrum(
decimator_out,
41000, //decimator_out.sampling_rate * channel_filter_taps.pass_frequency_normalized,
70000 //decimator_out.sampling_rate * channel_filter_taps.stop_frequency_normalized
);
/*const buffer_s16_t work_audio_buffer {
(int16_t*)decimator_out.p,
sizeof(*decimator_out.p) * decimator_out.count
};
*
auto audio = demod.execute(channel, work_audio_buffer);
static uint64_t audio_present_history = 0;
const auto audio_present_now = squelch.execute(audio);
audio_present_history = (audio_present_history << 1) | (audio_present_now ? 1 : 0);
const bool audio_present = (audio_present_history != 0);
if( !audio_present ) {
// Zero audio buffer.
for(size_t i=0; i<audio.count; i++) {
audio.p[i] = 0;
}
}
audio_hpf.execute_in_place(audio);
fill_audio_buffer(audio);*/
}

View File

@@ -0,0 +1,54 @@
/*
* Copyright (C) 2014 Jared Boone, ShareBrained Technology, Inc.
*
* This file is part of PortaPack.
*
* 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 2, 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; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef __PROC_SIGFRX_H__
#define __PROC_SIGFRX_H__
#include "baseband_processor.hpp"
#include "channel_decimator.hpp"
#include "dsp_decimate.hpp"
#include "dsp_demodulate.hpp"
#include "dsp_fir_taps.hpp"
#include "dsp_iir.hpp"
#include "dsp_iir_config.hpp"
#include "dsp_squelch.hpp"
class SIGFRXProcessor : public BasebandProcessor {
public:
SIGFRXProcessor() {
decimator.set_decimation_factor(ChannelDecimator::DecimationFactor::By16);
//channel_filter.configure(channel_filter_taps.taps, 1);
}
void execute(buffer_c8_t buffer) override;
private:
ChannelDecimator decimator;
//const fir_taps_real<64>& channel_filter_taps = taps_64_lp_410_700_tfilter; //taps_64_lp_104_140_tfilter
//dsp::decimate::FIRAndDecimateComplex channel_filter;
dsp::demodulate::FM demod { 48000, 7500 };
IIRBiquadFilter audio_hpf { audio_hpf_config };
FMSquelch squelch;
};
#endif