From 1a296ceebcf4df1cbe836d3602f4654498d1eac5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Fillod=2C=20F8CFE?= Date: Sun, 8 Feb 2004 20:27:58 +0000 Subject: [PATCH] WIP git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1679 7ae35d74-ebe9-4afe-98af-79ac388436b8 --- gnuradio/HrAGC.h | 93 ++++++++++++++++++++++++++++++++++++++++++ gnuradio/am.h | 6 +-- gnuradio/demod.h | 12 +++--- gnuradio/gnuradio.cc | 96 +++++++++++++++++++++++--------------------- gnuradio/gr_priv.h | 6 +-- gnuradio/graudio.c | 6 +-- gnuradio/nfm.h | 8 +--- gnuradio/ssb.h | 21 +++++----- gnuradio/testgr.cc | 6 +-- gnuradio/wfm.h | 10 ++--- 10 files changed, 175 insertions(+), 89 deletions(-) create mode 100644 gnuradio/HrAGC.h diff --git a/gnuradio/HrAGC.h b/gnuradio/HrAGC.h new file mode 100644 index 000000000..6c0184c95 --- /dev/null +++ b/gnuradio/HrAGC.h @@ -0,0 +1,93 @@ +/* -*- c++ -*- */ +/* + * Copyright 2002 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio 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. + * + * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#ifndef _HRAGC_H_ +#define _HRAGC_H_ + +#include + +template +class HrAGC : public VrSigProc { +protected: + oType k; + oType reference; + oType gain; + virtual void initialize(); +public: + virtual const char *name() { return "HrAGC"; } + virtual int work(VrSampleRange output, void *ao[], + VrSampleRange inputs[], void *ai[]); + HrAGC(double k):VrSigProc(1,sizeof(iType),sizeof(oType)),k(k) { } +}; + +template int +HrAGC::work(VrSampleRange output, void *ao[], + VrSampleRange inputs[], void *ai[]) +{ + iType **i = (iType **)ai; + oType **o = (oType **)ao; + int size = output.size; + + // for normalize + iType max = 0; +#if 1 + { int sz; + for (sz = 0; sz < size; sz++) + if (fabs(*(i[0]+sz)) > max) + max = fabs(*(i[0]+sz)); + } +#endif + + while(size -- > 0) { +#if 0 + power = power + ((*i[0] * *i[0]) - power)/k; + inv_gain = sqrt(power); + *o[0]++ = (*i[0]++ / inv_gain); +#elif 0 + /* AGC with malus on saturation */ + + oType output = (*i[0]++ * gain); + if (output < reference) { + *o[0]++ = output; + gain += (reference - fabsf(output)) * k; + } else { + *o[0]++ = reference; + gain *= reference/fabsf(output); + } +#else + /* AGC with normalization */ + + gain = 0.8 / max; + *o[0]++ = (*i[0]++ * gain); +#endif + } + return output.size; +} + +template void +HrAGC::initialize() +{ + reference = 1; + gain = 1; +} +#endif diff --git a/gnuradio/am.h b/gnuradio/am.h index 61fe0abb6..402e5a83b 100644 --- a/gnuradio/am.h +++ b/gnuradio/am.h @@ -2,7 +2,7 @@ * Hamlib GNUradio backend - AM class * Copyright (c) 2003 by Stephane Fillod * - * $Id: am.h,v 1.1 2003-09-28 20:51:05 fillods Exp $ + * $Id: am.h,v 1.2 2004-02-08 20:27:58 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -39,10 +39,6 @@ class AMDemodChainCF : public DemodChainCF { demod_in = demod_out = a_demod = new GrMagnitude(); } ~AMDemodChainCF() { delete a_demod; } - - //void setWidth(pbwidth_t width) { } - //void setFreq(freq_t centerfreq) { } - void setRFgain(float gain) { /* a_demod->setGain(gain); */ } }; #endif /* _AM_H */ diff --git a/gnuradio/demod.h b/gnuradio/demod.h index 01b685c29..a80844ab1 100644 --- a/gnuradio/demod.h +++ b/gnuradio/demod.h @@ -2,7 +2,7 @@ * Hamlib GNUradio backend - Demodulator chain class * Copyright (c) 2003 by Stephane Fillod * - * $Id: demod.h,v 1.1 2003-10-20 22:34:56 fillods Exp $ + * $Id: demod.h,v 1.2 2004-02-08 20:27:58 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -29,8 +29,8 @@ #include #include -#include -//#include +//#include +#include #include #include @@ -45,7 +45,7 @@ class DemodChainCF { public: DemodChainCF (VrSource *d_source, VrSink *d_sink, rmode_t mode, pbwidth_t width, int input_rate, freq_t centerfreq = 0) : - d_source(d_source), d_sink(d_sink), mode(mode), width(width), input_rate(input_rate), centerfreq(centerfreq), rf_gain(1.0), if_width_of_transition_band(500), CFIRdecimate(1), RFIRdecimate(1) {} + d_source(d_source), d_sink(d_sink), mode(mode), width(width), input_rate(input_rate), centerfreq(centerfreq), rf_gain(1.0), if_width_of_transition_band(1000), CFIRdecimate(1), RFIRdecimate(1) {} virtual ~DemodChainCF () { delete agc; delete mixer; delete gainstage; delete audio_filter; } virtual const char *name() { return strrmode(mode); } @@ -64,7 +64,7 @@ class DemodChainCF { VrSigProc *demod_in; VrSigProc *demod_out; - GrAGC *agc; + HrAGC *agc; GrFreqXlatingFIRfilterCCF *mixer; VrAmp *gainstage; GrFIRfilterFFF *audio_filter; @@ -103,7 +103,7 @@ void DemodChainCF::connect() mixer = new GrFreqXlatingFIRfilterCCF (CFIRdecimate, channel_coeffs, centerfreq); - agc = new GrAGC(1e-2); + agc = new HrAGC(1e-2); gainstage = new VrAmp(1); /* AF */ audio_filter = new GrFIRfilterFFF (RFIRdecimate, audio_coeffs); diff --git a/gnuradio/gnuradio.cc b/gnuradio/gnuradio.cc index b5a2dde32..d3aae7128 100644 --- a/gnuradio/gnuradio.cc +++ b/gnuradio/gnuradio.cc @@ -3,7 +3,7 @@ * Hamlib GNUradio backend - main file * Copyright (c) 2001-2003 by Stephane Fillod * - * $Id: gnuradio.cc,v 1.7 2003-09-28 20:51:05 fillods Exp $ + * $Id: gnuradio.cc,v 1.8 2004-02-08 20:27:58 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -42,20 +42,13 @@ #include #include -#include -#include -#include -#include -#include /* FM */ -#include /* AM */ -#include /* SSB */ -#include -#include /* Demodulator chains */ #include #include +#include +#include @@ -63,8 +56,8 @@ #define CARRIER_FREQ 1.070e6 // AM 1070 #define AMPLITUDE 3000 -#define AUDIO_IN "/dev/dsp" -#define AUDIO_OUT "/dev/dsp1" +#define AUDIO_SINK "/dev/dsp" +#define AUDIO_SRC "/dev/dsp1" #include #include /* Standard input/output definitions */ @@ -271,6 +264,13 @@ int gr_open(RIG *rig) * and override available modes with gnuradio's */ + rig->state.has_set_func |= priv->tuner->state.has_set_func; + rig->state.has_get_func |= priv->tuner->state.has_get_func; + rig->state.has_set_level |= priv->tuner->state.has_set_level; + rig->state.has_get_level |= priv->tuner->state.has_get_level; + rig->state.has_set_parm |= priv->tuner->state.has_set_parm; + rig->state.has_get_parm |= priv->tuner->state.has_get_parm; + /* ** Source ** */ @@ -288,7 +288,7 @@ int gr_open(RIG *rig) /* VrFileSource (double sampling_freq, const char *file, bool repeat = false) */ //priv->source = new VrFileSource(priv->input_rate, "microtune_source.sw", true); - priv->sink = new GrAudioSink(1,AUDIO_IN); + priv->sink = new GrAudioSink(1,AUDIO_SINK); /* ** Sink ** */ if (!priv->sink) @@ -299,8 +299,6 @@ int gr_open(RIG *rig) priv->m->start(); - /* or set it to MODE_NONE? */ - //gr_set_mode(rig, RIG_VFO_CURR, RIG_MODE_WFM, RIG_PASSBAND_NORMAL); if (priv->tuner_model == RIG_MODEL_DUMMY) { gr_set_freq(rig, RIG_VFO_CURR, priv->IF_center_freq); } @@ -358,7 +356,7 @@ int graudio_open(RIG *rig) * assumes sound card is full duplex! * mono source */ - priv->source = new GrAudioSource(priv->input_rate, 1,1,AUDIO_OUT); + priv->source = new GrAudioSource(priv->input_rate, 1,1,AUDIO_SRC); return gr_open(rig); } @@ -376,7 +374,7 @@ int graudioiq_open(RIG *rig) * assumes sound card is full duplex! * I&Q source */ - priv->source = new GrAudioSource(priv->input_rate, 2,1, AUDIO_OUT); + priv->source = new GrAudioSource(priv->input_rate, 2,1, AUDIO_SRC); return gr_open(rig); } @@ -459,8 +457,10 @@ static int update_freq(RIG *rig, unsigned chan_num, freq_t tuner_freq, freq_t fr DemodChainCF *mod = priv->mods[chan_num]; double freq_offset; - if (chan->mode == RIG_MODE_NONE) - return RIG_OK; + if (chan->mode == RIG_MODE_NONE || !mod) { + rig_debug(RIG_DEBUG_TRACE,"No (de)modulator for chan %d\n",chan_num); + return RIG_OK; + } /* * In case the tuner is not a real tuner @@ -469,17 +469,12 @@ static int update_freq(RIG *rig, unsigned chan_num, freq_t tuner_freq, freq_t fr tuner_freq = priv->IF_center_freq; freq_offset = (double) (freq - tuner_freq); - rig_debug(RIG_DEBUG_VERBOSE, "%s: %lld %lld freq_offset=%g\n", + rig_debug(RIG_DEBUG_VERBOSE, "%s: tuner:%lld gr:%lld freq_offset=%g\n", __FUNCTION__, tuner_freq, freq, freq_offset); if (freq_offset == 0) return RIG_OK; /* nothing to do */ - /* mode=RIG_MODE_NONE? */ - if (!mod) { - return RIG_OK; - } - pthread_mutex_lock(&priv->mutex_process); /* @@ -520,12 +515,18 @@ int gr_set_freq(RIG *rig, vfo_t vfo, freq_t freq) /* * do not set tuner to freq, but center it */ - ret = rig_set_freq(priv->tuner, RIG_VFO_CURR, freq + GR_MAX_FREQUENCY(priv)/2); +#if 0 + if (GR_MAX_FREQUENCY(priv)/2 < mode_offset) + tuner_freq = freq - mode_offset - resolution; + else +#endif + tuner_freq = freq - GR_MAX_FREQUENCY(priv)/2; + ret = rig_set_freq(priv->tuner, RIG_VFO_CURR, tuner_freq); if (ret != RIG_OK) return ret; /* - * query freq right back, because wanted freq may not be real freq, - * because of resolution of tuner + * query freq right back, because wanted freq may be rounded + * because of the resolution of the tuner */ ret = rig_get_freq(priv->tuner, RIG_VFO_CURR, &tuner_freq); if (ret != RIG_OK) @@ -595,9 +596,9 @@ int gr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) if (priv->tuner_model == RIG_MODEL_DUMMY) tuner_freq = 0; - freq_offset = (double) (chan->freq - tuner_freq); - rig_debug(RIG_DEBUG_VERBOSE, "%s: freq_offset=%g\n", - __FUNCTION__, freq_offset); + freq_offset = (double) (chan->freq - tuner_freq + priv->IF_center_freq); + rig_debug(RIG_DEBUG_VERBOSE, "%s: freq_offset=%g tuner_freq=%lld, IFcenter=%ld\n", + __FUNCTION__, freq_offset, tuner_freq, priv->IF_center_freq); @@ -619,6 +620,9 @@ int gr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) delete mod; priv->mods[chan_num] = NULL; + + delete priv->m; + priv->m = new VrMultiTask (); } if (mode == RIG_MODE_NONE) { @@ -629,25 +633,23 @@ int gr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) return RIG_OK; } + float rf_gain = chan->levels[rig_setting2idx(RIG_LEVEL_RF)].f; switch(mode) { -#if 0 - case RIG_MODE_USB: - //float rf_gain = chan->levels[rig_setting2idx(RIG_LEVEL_RF)].f; - float low_cutoff = 300; - float high_cutoff = low_cutoff+width; - centerfreq = (freq_t)(priv->IF_center_freq + low_cutoff + width/2); - - mod = new USBDemodChain(priv->source, priv->sink, priv->input_rate, centerfreq); + case RIG_MODE_LSB: + mod = new LSBDemodChainCF(priv->source, priv->sink, mode, width, priv->input_rate, (freq_t)freq_offset); + break; + case RIG_MODE_USB: + mod = new USBDemodChainCF(priv->source, priv->sink, mode, width, priv->input_rate, (freq_t)freq_offset); break; -#endif case RIG_MODE_AM: - //centerfreq = priv->IF_center_freq; - mod = new AMDemodChainCF(priv->source, priv->sink, mode, width, priv->input_rate, kHz(10)); + mod = new AMDemodChainCF(priv->source, priv->sink, mode, width, priv->input_rate, (freq_t)freq_offset); break; case RIG_MODE_FM: - //centerfreq = priv->IF_center_freq; - mod = new FMDemodChainCF(priv->source, priv->sink, mode, width, priv->input_rate, kHz(10)); + mod = new FMDemodChainCF(priv->source, priv->sink, mode, width, priv->input_rate, (freq_t)freq_offset); + break; + case RIG_MODE_WFM: + mod = new WFMDemodChainCF(priv->source, priv->sink, mode, width, priv->input_rate, (freq_t)freq_offset); break; default: ret = -RIG_EINVAL; @@ -655,6 +657,7 @@ int gr_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width) priv->mods[chan_num] = mod; + /* wire up the chain */ mod->connect(); priv->m->add (priv->sink); @@ -742,11 +745,12 @@ int gnuradio_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val) switch (level) { case RIG_LEVEL_RF: - mod->setRFgain(val.f); + /* line-in level of sound card, etc. */ break; default: - rig_debug(RIG_DEBUG_WARN, "%s: level %s unimplemented!\n", + rig_debug(RIG_DEBUG_TRACE, "%s: level %s, try tuner\n", __FUNCTION__, strlevel(level)); + ret = rig_set_level(priv->tuner, vfo, level, val); break; } diff --git a/gnuradio/gr_priv.h b/gnuradio/gr_priv.h index da29c6087..4de270937 100644 --- a/gnuradio/gr_priv.h +++ b/gnuradio/gr_priv.h @@ -2,7 +2,7 @@ * Hamlib GNUradio backend - gnuradio priv structure * Copyright (c) 2001-2003 by Stephane Fillod * - * $Id: gr_priv.h,v 1.6 2003-09-28 20:51:05 fillods Exp $ + * $Id: gr_priv.h,v 1.7 2004-02-08 20:27:58 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -71,7 +71,7 @@ struct gnuradio_priv_data { }; -//#define GR_MAX_FREQUENCY(priv) ((priv)->input_rate/2) -#define GR_MAX_FREQUENCY(priv) ((priv)->input_rate) +#define GR_MAX_FREQUENCY(priv) ((priv)->input_rate/2) +//#define GR_MAX_FREQUENCY(priv) ((priv)->input_rate) #endif /* _GR_PRIV_H */ diff --git a/gnuradio/graudio.c b/gnuradio/graudio.c index bc9b83642..f0d382f0a 100644 --- a/gnuradio/graudio.c +++ b/gnuradio/graudio.c @@ -2,7 +2,7 @@ * Hamlib GNUradio backend - graudio/any rig * Copyright (c) 2001-2003 by Stephane Fillod * - * $Id: graudio.c,v 1.5 2003-10-01 19:31:55 fillods Exp $ + * $Id: graudio.c,v 1.6 2004-02-08 20:27:58 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -50,8 +50,8 @@ static const struct gnuradio_priv_caps graudio_priv_caps = { .tuner_model = RIG_MODEL_DUMMY, - .input_rate = 48000, /* To be fixed. how? */ - .IF_center_freq = -kHz(10), + .input_rate = 48000, /* To be fixed, later */ + .IF_center_freq = 0 /* -kHz(10) */, }; diff --git a/gnuradio/nfm.h b/gnuradio/nfm.h index 2dffc2557..b4b11f0fa 100644 --- a/gnuradio/nfm.h +++ b/gnuradio/nfm.h @@ -2,7 +2,7 @@ * Hamlib GNUradio backend - Narrow FM class * Copyright (c) 2003 by Stephane Fillod * - * $Id: nfm.h,v 1.1 2003-09-28 20:51:05 fillods Exp $ + * $Id: nfm.h,v 1.2 2004-02-08 20:27:58 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -36,13 +36,9 @@ class FMDemodChainCF : public DemodChainCF { FMDemodChainCF (VrSource *src, VrSink *snk, rmode_t mode, pbwidth_t width, int input_rate, freq_t centerfreq = 0) : DemodChainCF(src, snk, mode, width, input_rate, centerfreq) { - demod_in = demod_out = q_demod = new VrQuadratureDemod(1); + demod_in = demod_out = q_demod = new VrQuadratureDemod(1.0); } ~FMDemodChainCF() { delete q_demod; } - - //void setWidth(pbwidth_t width) { } - //void setFreq(freq_t centerfreq) { } - void setRFgain(float gain) { q_demod->setGain(gain); } }; #endif /* _NFM_H */ diff --git a/gnuradio/ssb.h b/gnuradio/ssb.h index 79bd9e914..d3e217802 100644 --- a/gnuradio/ssb.h +++ b/gnuradio/ssb.h @@ -2,7 +2,7 @@ * Hamlib GNUradio backend - SSB class * Copyright (c) 2003 by Stephane Fillod * - * $Id: ssb.h,v 1.1 2003-10-01 19:38:34 fillods Exp $ + * $Id: ssb.h,v 1.2 2004-02-08 20:27:58 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -34,21 +34,20 @@ class USBDemodChainCF : public DemodChainCF { float low_cutoff; public: - // float rf_gain = chan->levels[rig_setting2idx(RIG_LEVEL_RF)].f; - USBDemodChainCF (VrSource *src, VrSink *snk, rmode_t mode, pbwidth_t width, int input_rate, freq_t centerfreq = 0, float rf_gain = 1.0) : - DemodChainCF(src, snk, mode, width, input_rate, centerfreq, rf_gain) { + USBDemodChainCF (VrSource *src, VrSink *snk, rmode_t mode, pbwidth_t width, int input_rate, freq_t centerfreq = 0) : + DemodChainCF(src, snk, mode, width, input_rate, centerfreq) { low_cutoff = 300; // centerfreq, relative to IF_center_freq centerfreq += (freq_t)(low_cutoff + width/2); - s_demod = new GrSSBMod(2*M_PI*(low_cutoff+width/2)/(double)input_rate,rf_gain); + s_demod = new GrSSBMod(2*M_PI*(low_cutoff+width/2)/(double)input_rate,1.0); demod_in = demod_out = s_demod; } ~USBDemodChainCF() { delete s_demod; } - //void setWidth(pbwidth_t width) { } /* TODO */ + //void setWidth(pbwidth_t width) { } void setFreq(freq_t centerfreq) { s_demod->set_freq(centerfreq); } void setRFgain(float gain) { s_demod->set_gain(gain); } }; @@ -59,25 +58,23 @@ class LSBDemodChainCF : public DemodChainCF { float low_cutoff; public: - // float rf_gain = chan->levels[rig_setting2idx(RIG_LEVEL_RF)].f; - LSBDemodChainCF (VrSource *src, VrSink *snk, rmode_t mode, pbwidth_t width, int input_rate, freq_t centerfreq = 0, float rf_gain = 1.0) : - DemodChainCF(src, snk, mode, width, input_rate, centerfreq, rf_gain) { + LSBDemodChainCF (VrSource *src, VrSink *snk, rmode_t mode, pbwidth_t width, int input_rate, freq_t centerfreq = 0) : + DemodChainCF(src, snk, mode, width, input_rate, centerfreq) { float low_cutoff = 300; // centerfreq, relative to IF_center_freq centerfreq += (freq_t)(-low_cutoff - width/2); - s_demod = new GrSSBMod(-2*M_PI*(low_cutoff+width/2)/(double)input_rate,rf_gain); + s_demod = new GrSSBMod(-2*M_PI*(low_cutoff+width/2)/(double)input_rate,1.0); demod_in = demod_out = s_demod; } ~LSBDemodChainCF() { delete s_demod; } - //void setWidth(pbwidth_t width) { } /* TODO */ + //void setWidth(pbwidth_t width) { } void setFreq(freq_t centerfreq) { s_demod->set_freq(centerfreq); } void setRFgain(float gain) { s_demod->set_gain(gain); } }; #endif /* _SSB_H */ - diff --git a/gnuradio/testgr.cc b/gnuradio/testgr.cc index dba6f76fe..971a9f51d 100644 --- a/gnuradio/testgr.cc +++ b/gnuradio/testgr.cc @@ -33,7 +33,7 @@ int main(int argc, char *argv[]) int retcode; /* generic return code from functions */ struct gnuradio_priv_data *priv; - GrFFTSink *fftsink; + GrFFTSink *fftsink; VrGUI *guimain = new VrGUI(argc, argv); VrGUILayout *horiz = guimain->top->horizontal(); @@ -64,14 +64,14 @@ int main(int argc, char *argv[]) exit(2); } - fftsink = new GrFFTSink(vert, 300, 450, 1024); + fftsink = new GrFFTSink(vert, 300, 450, 1024); pthread_mutex_lock(&priv->mutex_process); priv->m->add (fftsink); // now wire it all together from the sink, back to the sources - NWO_CONNECT (GR_SOURCE(priv), fftsink); + NWO_CONNECT (priv->source, fftsink); pthread_mutex_unlock(&priv->mutex_process); rig_set_freq(my_rig, RIG_VFO_CURR, (freq_t)CARRIER_FREQ-kHz(10)); diff --git a/gnuradio/wfm.h b/gnuradio/wfm.h index 7bb956433..0c22761da 100644 --- a/gnuradio/wfm.h +++ b/gnuradio/wfm.h @@ -2,7 +2,7 @@ * Hamlib GNUradio backend - Wide FM class * Copyright (c) 2003 by Stephane Fillod * - * $Id: wfm.h,v 1.1 2003-10-01 19:38:34 fillods Exp $ + * $Id: wfm.h,v 1.2 2004-02-08 20:27:58 fillods Exp $ * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as @@ -36,8 +36,8 @@ class WFMDemodChainCF : public DemodChainCF { GrFIRfilterFFF *audio_filter; public: - WFMDemodChainCF (VrSource *src, VrSink *snk, rmode_t mode, pbwidth_t width, int input_rate, freq_t centerfreq = 0, float rf_gain = 1.0) : - DemodChainCF(src, snk, mode, width, input_rate, centerfreq, rf_gain) { + WFMDemodChainCF (VrSource *src, VrSink *snk, rmode_t mode, pbwidth_t width, int input_rate, freq_t centerfreq = 0) : + DemodChainCF(src, snk, mode, width, input_rate, centerfreq) { CFIRdecimate = 125; RFIRdecimate = 5; @@ -64,7 +64,7 @@ class WFMDemodChainCF : public DemodChainCF { // float --> float double width_of_transition_band = audioRate / 32; vector audio_coeffs = - gr_firdes::low_pass (rf_gain, // gain + gr_firdes::low_pass (1.0, // gain quadRate, // sampling rate audioRate/2 - width_of_transition_band, // low-pass cutoff freq width_of_transition_band, @@ -75,7 +75,7 @@ class WFMDemodChainCF : public DemodChainCF { audio_filter = new GrFIRfilterFFF(RFIRdecimate, audio_coeffs); - q_demod = new VrQuadratureDemod(rf_gain); + q_demod = new VrQuadratureDemod(1.0); demod_in = q_demod; demod_out = audio_filter;