[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 02/16: analog: Moved CTCSS squelch FFT para
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 02/16: analog: Moved CTCSS squelch FFT parameter calculations |
Date: |
Sun, 29 Mar 2015 02:27:25 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch master
in repository gnuradio.
commit 47320cf0dfdd6a4294d60ec3b704dd3a0f33023b
Author: Jon Szymaniak <address@hidden>
Date: Tue Feb 3 14:05:16 2015 -0500
analog: Moved CTCSS squelch FFT parameter calculations
This routine will be re-used in an upcoming commit, so it has been
moved to a private method.
---
gr-analog/lib/ctcss_squelch_ff_impl.cc | 33 ++++++++++++++++++++-------------
gr-analog/lib/ctcss_squelch_ff_impl.h | 1 +
2 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/gr-analog/lib/ctcss_squelch_ff_impl.cc
b/gr-analog/lib/ctcss_squelch_ff_impl.cc
index 7714da3..a82ca46 100644
--- a/gr-analog/lib/ctcss_squelch_ff_impl.cc
+++ b/gr-analog/lib/ctcss_squelch_ff_impl.cc
@@ -55,6 +55,25 @@ namespace gr {
return -1;
}
+ void
+ ctcss_squelch_ff_impl::compute_freqs(const float &freq,
+ float &f_l, float &f_r)
+ {
+ int i = find_tone(freq);
+
+ // Non-standard tones or edge tones get 2% guard band, otherwise
+ // guards are set at adjacent ctcss tone frequencies
+ if(i == -1 || i == 0)
+ f_l = freq*0.98;
+ else
+ f_l = ctcss_tones[i-1];
+
+ if(i == -1 || i == max_tone_index)
+ f_r = freq*1.02;
+ else
+ f_r = ctcss_tones[i+1];
+ }
+
ctcss_squelch_ff_impl::ctcss_squelch_ff_impl(int rate, float freq, float
level,
int len, int ramp, bool gate)
: block("ctcss_squelch_ff",
@@ -71,20 +90,8 @@ namespace gr {
else
d_len = len;
- int i = find_tone(freq);
-
- // Non-standard tones or edge tones get 2% guard band, otherwise
- // guards are set at adjacent ctcss tone frequencies
float f_l, f_r;
- if(i == -1 || i == 0)
- f_l = freq*0.98;
- else
- f_l = ctcss_tones[i-1];
-
- if(i == -1 || i == max_tone_index)
- f_r = freq*1.02;
- else
- f_r = ctcss_tones[i+1];
+ compute_freqs(d_freq, f_l, f_r);
d_goertzel_l = new fft::goertzel(rate, d_len, f_l);
d_goertzel_c = new fft::goertzel(rate, d_len, freq);
diff --git a/gr-analog/lib/ctcss_squelch_ff_impl.h
b/gr-analog/lib/ctcss_squelch_ff_impl.h
index ee0cfa7..6a137e0 100644
--- a/gr-analog/lib/ctcss_squelch_ff_impl.h
+++ b/gr-analog/lib/ctcss_squelch_ff_impl.h
@@ -43,6 +43,7 @@ namespace gr {
fft::goertzel *d_goertzel_r;
static int find_tone(float freq);
+ static void compute_freqs(const float &freq, float &f_l, float &f_r);
protected:
virtual void update_state(const float &in);
- [Commit-gnuradio] [gnuradio] 03/16: analog: Added frequency accessor and modifier to CTCSS squelch, (continued)
- [Commit-gnuradio] [gnuradio] 03/16: analog: Added frequency accessor and modifier to CTCSS squelch, git, 2015/03/28
- [Commit-gnuradio] [gnuradio] 06/16: filter: exporting IIR filter kernels from library., git, 2015/03/28
- [Commit-gnuradio] [gnuradio] 14/16: Merge remote-tracking branch 'drmpeg/dvb-s2', git, 2015/03/28
- [Commit-gnuradio] [gnuradio] 01/16: analog: Made CTCSS squelch find_tone() a static member function, git, 2015/03/28
- [Commit-gnuradio] [gnuradio] 13/16: Merge remote-tracking branch 'tom/iir_filter_stability', git, 2015/03/28
- [Commit-gnuradio] [gnuradio] 11/16: gr-dtv: Fix ATSC compile issue as reported on mailing list., git, 2015/03/28
- [Commit-gnuradio] [gnuradio] 12/16: Merge remote-tracking branch 'jynik/ctcss_squelch_add_freq_getset', git, 2015/03/28
- [Commit-gnuradio] [gnuradio] 16/16: Merge remote-tracking branch 'drmpeg/atsc-fix', git, 2015/03/28
- [Commit-gnuradio] [gnuradio] 05/16: docs: adding better docs for using IIR kernels., git, 2015/03/28
- [Commit-gnuradio] [gnuradio] 09/16: gr-dtv: Add DVB-S2 transmitter update., git, 2015/03/28
- [Commit-gnuradio] [gnuradio] 02/16: analog: Moved CTCSS squelch FFT parameter calculations,
git <=
- [Commit-gnuradio] [gnuradio] 04/16: filter: fixes stability issue with IIR filters., git, 2015/03/28
- [Commit-gnuradio] [gnuradio] 07/16: gr-dtv: Add DVB-S2 transmitter., git, 2015/03/28