diff --git a/src/applications/gqrx/dcontrols.cpp b/src/applications/gqrx/dcontrols.cpp index 6d4a47f8d..00779f4f5 100644 --- a/src/applications/gqrx/dcontrols.cpp +++ b/src/applications/gqrx/dcontrols.cpp @@ -3289,7 +3289,7 @@ c_def() .idx(C_WFM_DEEMPH) .name("Deemphasis") .title("Deemphasis") - .title_placement(c_def::grid_placement(PLACE_NEXT,0)) + .title_placement(c_def::grid_placement(PLACE_SAME,0)) .placement(c_def::grid_placement(PLACE_SAME,PLACE_NEXT)) .hint("WFM Deemphasis") .g_type(G_COMBO) @@ -3317,6 +3317,25 @@ c_def() {"7","1 ms",1000.0}, }) , +c_def() + .idx(C_WFM_RAW) + .name("RAW output") + .title("RAW output") + .title_placement(c_def::grid_placement(PLACE_NEXT,0)) + .placement(c_def::grid_placement(PLACE_SAME,PLACE_NEXT)) + .hint("Bypass lowpass filter") + .g_type(G_CHECKBOX) + .dock(D_RXOPT) + .window(W_DEMOD_OPT) + .scope(S_VFO) + .v_type(V_BOOLEAN) + .demod_specific(true) + .demodgroup(Modulations::GRP_WFM_MONO) + .def(0) + .min(0) + .max(1) + .step(1) + , c_def() .idx(C_WFM_STEREO_DEEMPH) .name("Deemphasis") diff --git a/src/applications/gqrx/dcontrols.h b/src/applications/gqrx/dcontrols.h index 3d09c0058..ec33c4c9e 100644 --- a/src/applications/gqrx/dcontrols.h +++ b/src/applications/gqrx/dcontrols.h @@ -199,6 +199,7 @@ enum c_id C_RAWIQ_RATE, C_SSB_DUMMY, C_WFM_DEEMPH, + C_WFM_RAW, C_WFM_STEREO_DEEMPH, C_WFM_OIRT_DEEMPH, C_RDS_ON, diff --git a/src/dsp/stereo_demod.cpp b/src/dsp/stereo_demod.cpp index cc72d003b..d26994a0e 100644 --- a/src/dsp/stereo_demod.cpp +++ b/src/dsp/stereo_demod.cpp @@ -52,7 +52,8 @@ stereo_demod::stereo_demod(float input_rate, float audio_rate, bool stereo, bool d_input_rate(input_rate), d_audio_rate(audio_rate), d_stereo(stereo), - d_oirt(oirt) + d_oirt(oirt), + d_raw(false) { double cutof_freq = d_oirt ? 15e3 : 17e3; lpf0 = make_lpf_ff((double)d_input_rate, cutof_freq, 2e3); // FIXME @@ -170,3 +171,34 @@ void stereo_demod::set_audio_rate(float audio_rate) deemph1->set_rate((double)d_audio_rate); } } + +void stereo_demod::set_raw(bool on) +{ + if(d_raw == on) + return; + if(d_raw) + { + disconnect(self(), 0, audio_rr0, 0); + disconnect(audio_rr0, 0, self(), 0); + disconnect(audio_rr0, 0, self(), 1); + }else{ + disconnect(self(), 0, lpf0, 0); + disconnect(lpf0, 0, audio_rr0, 0); + disconnect(audio_rr0, 0, deemph0, 0); + disconnect(deemph0, 0, self(), 0); + disconnect(deemph0, 0, self(), 1); + } + d_raw=on; + if(d_raw) + { + connect(self(), 0, audio_rr0, 0); + connect(audio_rr0, 0, self(), 0); + connect(audio_rr0, 0, self(), 1); + }else{ + connect(self(), 0, lpf0, 0); + connect(lpf0, 0, audio_rr0, 0); + connect(audio_rr0, 0, deemph0, 0); + connect(deemph0, 0, self(), 0); + connect(deemph0, 0, self(), 1); + } +} diff --git a/src/dsp/stereo_demod.h b/src/dsp/stereo_demod.h index f4c4396f5..e595043a5 100644 --- a/src/dsp/stereo_demod.h +++ b/src/dsp/stereo_demod.h @@ -95,6 +95,7 @@ class stereo_demod : public gr::hier_block2 ~stereo_demod(); void set_tau(double tau); void set_audio_rate(float audio_rate); + void set_raw(bool); private: /* GR blocks */ @@ -118,6 +119,7 @@ class stereo_demod : public gr::hier_block2 float d_audio_rate; /*! Audio rate. */ bool d_stereo; /*! On/off stereo mode. */ bool d_oirt; + bool d_raw; std::vector d_tone_taps; /*! Tone BPF taps. */ std::vector d_pll_taps; /*! Subtone BPF taps. */ }; diff --git a/src/receivers/vfo.cpp b/src/receivers/vfo.cpp index 06123ac3b..cf7aee40e 100644 --- a/src/receivers/vfo.cpp +++ b/src/receivers/vfo.cpp @@ -309,6 +309,12 @@ bool vfo_s::set_wfm_deemph(const c_def::v_union & v) return true; } +bool vfo_s::set_wfm_raw(const c_def::v_union & v) +{ + d_wfm_raw = v; + return true; +} + bool vfo_s::set_nb1_on(const c_def::v_union & v) { d_nb_on[0] = v; @@ -507,6 +513,7 @@ void vfo_s::restore_settings(vfo_s& from, bool force) from.get_am_dcr(v);set_am_dcr(v); from.get_cw_offset(v);set_cw_offset(v); from.get_wfm_deemph(v);set_wfm_deemph(v); + from.get_wfm_raw(v);set_wfm_raw(v); from.get_rds_on(v);set_rds_on(v); from.get_fft_center(v);set_fft_center(v); @@ -671,6 +678,8 @@ int vfo_s::conf_initializer() getters[C_WFM_STEREO_DEEMPH]=&vfo_s::get_wfm_deemph; setters[C_WFM_OIRT_DEEMPH]=&vfo_s::set_wfm_deemph; getters[C_WFM_OIRT_DEEMPH]=&vfo_s::get_wfm_deemph; + setters[C_WFM_RAW]=&vfo_s::set_wfm_raw; + getters[C_WFM_RAW]=&vfo_s::get_wfm_raw; getters[C_RDS_ON]=&vfo_s::get_rds_on; setters[C_RDS_ON]=&vfo_s::set_rds_on; diff --git a/src/receivers/vfo.h b/src/receivers/vfo.h index 751750e3f..a01619697 100644 --- a/src/receivers/vfo.h +++ b/src/receivers/vfo.h @@ -81,6 +81,7 @@ typedef class vfo_s: public conf_dispatchers d_amsync_dcr(true), d_pll_bw(0.01), d_wfm_deemph(50.0), + d_wfm_raw(false), d_rec_dir(""), d_rec_sql_triggered(false), d_rec_min_time(0), @@ -166,6 +167,7 @@ typedef class vfo_s: public conf_dispatchers bool get_fmpll_damping_factor(c_def::v_union & v) const { v=d_fmpll_damping_factor; return true; } /* WFM parameters */ bool get_wfm_deemph(c_def::v_union & v) const { v=d_wfm_deemph; return true; } + bool get_wfm_raw(c_def::v_union & v) const { v=d_wfm_raw; return true; } /* Noise blanker */ bool get_nb1_on(c_def::v_union & v) const { v=d_nb_on[0]; return true; } bool get_nb2_on(c_def::v_union & v) const { v=d_nb_on[1]; return true; } @@ -238,6 +240,7 @@ typedef class vfo_s: public conf_dispatchers virtual bool set_amsync_pll_bw(const c_def::v_union &); /* WFM parameters */ virtual bool set_wfm_deemph(const c_def::v_union &); + virtual bool set_wfm_raw(const c_def::v_union &); /* Noise blanker */ virtual bool set_nb1_on(const c_def::v_union &); virtual bool set_nb2_on(const c_def::v_union &); @@ -331,6 +334,7 @@ typedef class vfo_s: public conf_dispatchers bool d_amsync_dcr; float d_pll_bw; float d_wfm_deemph; + bool d_wfm_raw; bool d_nb_on[RECEIVER_NB_COUNT]; float d_nb_threshold[RECEIVER_NB_COUNT]; diff --git a/src/receivers/wfmrx.cpp b/src/receivers/wfmrx.cpp index 6f0e1cfa3..bbec03548 100644 --- a/src/receivers/wfmrx.cpp +++ b/src/receivers/wfmrx.cpp @@ -212,6 +212,17 @@ void wfmrx::stop_rds_decoder() unlock(); } +bool wfmrx::set_wfm_raw(const c_def::v_union & v) +{ + receiver_base_cf::set_wfm_raw(v); + if(d_demod == Modulations::MODE_WFM_MONO) + lock(); + mono->set_raw(d_wfm_raw); + if(d_demod == Modulations::MODE_WFM_MONO) + unlock(); + return true; +} + bool wfmrx::set_rds_on(const c_def::v_union & v) { if(d_rds_on == bool(v)) diff --git a/src/receivers/wfmrx.h b/src/receivers/wfmrx.h index 78c2d0201..cdec7a53f 100644 --- a/src/receivers/wfmrx.h +++ b/src/receivers/wfmrx.h @@ -72,6 +72,7 @@ class wfmrx : public receiver_base_cf void set_index(int index) override; bool set_wfm_deemph(const c_def::v_union & v) override; + bool set_wfm_raw(const c_def::v_union &) override; bool set_rds_on(const c_def::v_union &) override; bool get_rds_pi(c_def::v_union &) const override;