diff --git a/gr-jay/grc/jay_peak_detect.xml b/gr-jay/grc/jay_peak_detect.xml
index 38a5998..fee51d2 100644
--- a/gr-jay/grc/jay_peak_detect.xml
+++ b/gr-jay/grc/jay_peak_detect.xml
@@ -35,22 +35,22 @@
float
- Peak Height Minimum [dB]
+ Peak Threshold [dB]
peak_height_min
20
float
- Peak Width Minimum [samples]
+ Peak BW Minimum [Hz]
peak_width_min
- 5
- int
+ 2000
+ float
- Peak Width Maximum [samples]
+ Peak BW Maximum [Hz]
peak_width_max
- 55
- int
+ 3000
+ float
Alpha Short
diff --git a/gr-jay/include/jay/peak_detect.h b/gr-jay/include/jay/peak_detect.h
index 0c252c8..95bae1d 100644
--- a/gr-jay/include/jay/peak_detect.h
+++ b/gr-jay/include/jay/peak_detect.h
@@ -46,7 +46,7 @@ namespace gr {
* class. jay::peak_detect::make is the public interface for
* creating new instances.
*/
- static sptr make(int vlen, float framerate, float bandwidth, float fcenter, float peak_height_min, int peak_width_min, int peak_width_max, float alpha_s, float alpha_m);
+ static sptr make(int vlen, float framerate, float bandwidth, float fcenter, float peak_height_min, float peak_width_min, float peak_width_max, float alpha_s, float alpha_m);
};
} // namespace jay
diff --git a/gr-jay/lib/peak_detect_impl.cc b/gr-jay/lib/peak_detect_impl.cc
index 5a4ab3d..f68e630 100644
--- a/gr-jay/lib/peak_detect_impl.cc
+++ b/gr-jay/lib/peak_detect_impl.cc
@@ -29,7 +29,7 @@ namespace gr {
namespace jay {
peak_detect::sptr
- peak_detect::make(int vlen, float framerate, float bandwidth, float fcenter, float peak_height_min, int peak_width_min, int peak_width_max, float alpha_s, float alpha_m)
+ peak_detect::make(int vlen, float framerate, float bandwidth, float fcenter, float peak_height_min, float peak_width_min, float peak_width_max, float alpha_s, float alpha_m)
{
return gnuradio::get_initial_sptr
(new peak_detect_impl(vlen, framerate, bandwidth, fcenter, peak_height_min, peak_width_min, peak_width_max, alpha_s, alpha_m));
@@ -38,7 +38,7 @@ namespace gr {
/*
* The private constructor
*/
- peak_detect_impl::peak_detect_impl(int vlen, float framerate, float bandwidth, float fcenter, float peak_height_min, int peak_width_min, int peak_width_max, float alpha_s, float alpha_m)
+ peak_detect_impl::peak_detect_impl(int vlen, float framerate, float bandwidth, float fcenter, float peak_height_min, float peak_width_min, float peak_width_max, float alpha_s, float alpha_m)
: gr::block("peak_detect"
, gr::io_signature::make(1, 1, vlen*sizeof(float))
, gr::io_signature::make(0, 2, vlen*sizeof(float)))
@@ -47,8 +47,8 @@ namespace gr {
, m_bandwidth (bandwidth)
, m_fcenter (fcenter)
, m_peak_height_min (peak_height_min)
- , m_peak_width_min (peak_width_min)
- , m_peak_width_max (peak_width_max)
+ , m_peak_width_min (2*(int)((0.5f*m_vlen)/bandwidth*peak_width_min) + 1)
+ , m_peak_width_max (2*(int)((0.5f*m_vlen)/bandwidth*peak_width_max) + 1)
, m_alpha_s (alpha_s)
, m_alpha_m(alpha_m)
, m_frameCount(0)
diff --git a/gr-jay/lib/peak_detect_impl.h b/gr-jay/lib/peak_detect_impl.h
index 4f61d7b..dc21bc9 100644
--- a/gr-jay/lib/peak_detect_impl.h
+++ b/gr-jay/lib/peak_detect_impl.h
@@ -322,7 +322,7 @@ namespace jay {
pmt::pmt_t m_msg_port_out;
public:
- peak_detect_impl(int vlen, float framerate, float bandwidth, float fcenter, float peak_height_min, int peak_width_min, int peak_width_max, float alpha_s, float alpha_m);
+ peak_detect_impl(int vlen, float framerate, float bandwidth, float fcenter, float peak_height_min, float peak_width_min, float peak_width_max, float alpha_s, float alpha_m);
~peak_detect_impl();
// Where all the action really happens