- increased rho_thr
- add argument to switch printing of packets git-svn-id: http://moon:8086/svn/software/trunk/projects/GnuRadio@418 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<key>jay_bit_slicer</key>
|
||||
<category>[JAY]</category>
|
||||
<import>import jay</import>
|
||||
<make>jay.bit_slicer($sampleRate, $samplesPerSym, $kLoopFilter, $kThreshold)</make>
|
||||
<make>jay.bit_slicer($sampleRate, $samplesPerSym, $kLoopFilter, $kThreshold, $doPrintPackets)</make>
|
||||
<param>
|
||||
<name>Samplerate</name>
|
||||
<key>sampleRate</key>
|
||||
@@ -26,6 +26,11 @@
|
||||
<value>0.1</value>
|
||||
<type>float</type>
|
||||
</param>
|
||||
<param>
|
||||
<name>Print packets</name>
|
||||
<key>doPrintPackets</key>
|
||||
<type>int</type>
|
||||
</param>
|
||||
<sink>
|
||||
<name>in</name>
|
||||
<type>float</type>
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace gr {
|
||||
* class. jay::bit_slicer::make is the public interface for
|
||||
* creating new instances.
|
||||
*/
|
||||
static sptr make(int sampleRate, int samplesPerSym, float kLoopfilter, float kThreshold);
|
||||
static sptr make(int sampleRate, int samplesPerSym, float kLoopfilter, float kThreshold, int doPrintPackets);
|
||||
};
|
||||
|
||||
} // namespace jay
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include "bit_slicer_impl.h"
|
||||
|
||||
#define WITH_PRINT_PACKETS 0
|
||||
#define WITH_DEBUG_MESSAGES 0
|
||||
#define WITH_DEBUG_FILE 0
|
||||
|
||||
@@ -34,15 +33,15 @@ namespace gr
|
||||
namespace jay
|
||||
{
|
||||
|
||||
bit_slicer::sptr bit_slicer::make(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold)
|
||||
bit_slicer::sptr bit_slicer::make(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold, int doPrintPackets)
|
||||
{
|
||||
return gnuradio::get_initial_sptr(new bit_slicer_impl(sampleRate, samplesPerSym, kLoopFilter, kThreshold));
|
||||
return gnuradio::get_initial_sptr(new bit_slicer_impl(sampleRate, samplesPerSym, kLoopFilter, kThreshold, doPrintPackets));
|
||||
}
|
||||
|
||||
/*
|
||||
* The private constructor
|
||||
*/
|
||||
bit_slicer_impl::bit_slicer_impl(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold)
|
||||
bit_slicer_impl::bit_slicer_impl(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold, int doPrintPackets)
|
||||
: gr::block("bit_slicer", gr::io_signature::make(1, 1, sizeof(float)),
|
||||
gr::io_signature::make(1, 1, sizeof(float)))
|
||||
, m_sampleRate(sampleRate)
|
||||
@@ -52,6 +51,7 @@ bit_slicer_impl::bit_slicer_impl(int sampleRate, int samplesPerSym, float kLoopF
|
||||
, m_baudRate((float)m_sampleRate/m_samplesPerSym)
|
||||
, m_kLoopFilter(kLoopFilter)
|
||||
, m_kThreshold(kThreshold)
|
||||
, m_doPrintPackets(doPrintPackets)
|
||||
, m_vmin(0)
|
||||
, m_vmax(0)
|
||||
, m_v_sig(0)
|
||||
@@ -121,7 +121,7 @@ int bit_slicer_impl::general_work (int noutput_items, gr_vector_int &ninput_item
|
||||
const float alpha_thr = 0.01f;
|
||||
const float alpha_dc = 0.002f;
|
||||
const float hyst_thr = 0.1f;
|
||||
const float rho_thr = 0.999f;
|
||||
const float rho_thr = 0.9999f;
|
||||
const float agc_mu = 0.01f;
|
||||
const float agc_target = 0.5f;
|
||||
const float agc_gain_max = 10.0f;
|
||||
@@ -190,9 +190,10 @@ int bit_slicer_impl::general_work (int noutput_items, gr_vector_int &ninput_item
|
||||
int bit_id = (int)(accu >= 0.0);
|
||||
if (m_isSignal)
|
||||
{
|
||||
#if WITH_PRINT_PACKETS
|
||||
bitRecord(bit_id);
|
||||
#endif
|
||||
if (m_doPrintPackets)
|
||||
{
|
||||
bitRecord(bit_id);
|
||||
}
|
||||
out[outCount++] = (float)bit_id;
|
||||
}
|
||||
else
|
||||
@@ -223,9 +224,11 @@ int bit_slicer_impl::general_work (int noutput_items, gr_vector_int &ninput_item
|
||||
}
|
||||
}
|
||||
|
||||
#if WITH_PRINT_PACKETS
|
||||
bitProcessGap(bitChg);
|
||||
#endif
|
||||
if (m_doPrintPackets)
|
||||
{
|
||||
bitProcessGap(bitChg);
|
||||
}
|
||||
|
||||
// Calc error
|
||||
err = 0;
|
||||
if (bitChg)
|
||||
|
||||
@@ -38,6 +38,7 @@ class bit_slicer_impl : public bit_slicer
|
||||
float m_baudRate;
|
||||
float m_kLoopFilter;
|
||||
float m_kThreshold;
|
||||
int m_doPrintPackets;
|
||||
float m_vmin;
|
||||
float m_vmax;
|
||||
float m_v_sig;
|
||||
@@ -66,7 +67,7 @@ class bit_slicer_impl : public bit_slicer
|
||||
bool stop() override;
|
||||
|
||||
public:
|
||||
bit_slicer_impl(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold);
|
||||
bit_slicer_impl(int sampleRate, int samplesPerSym, float kLoopFilter, float kThreshold, int doPrintPackets);
|
||||
~bit_slicer_impl();
|
||||
|
||||
// Where all the action really happens
|
||||
|
||||
Reference in New Issue
Block a user