mirror of
https://github.com/xdsopl/robot36.git
synced 2026-01-24 16:40:17 +01:00
removed lowpass from leader tone detection
This commit is contained in:
parent
ba71a59f60
commit
e2c25d83ce
|
|
@ -20,7 +20,7 @@ limitations under the License.
|
|||
#include "constants.rsh"
|
||||
#include "state.rsh"
|
||||
|
||||
static int calibration_detected(float dat_value, int cnt_quantized)
|
||||
static int calibration_detected(float dat_quantized, int cnt_quantized)
|
||||
{
|
||||
static int progress, countdown;
|
||||
static int leader_counter, break_counter;
|
||||
|
|
@ -28,8 +28,7 @@ static int calibration_detected(float dat_value, int cnt_quantized)
|
|||
progress = countdown ? progress : 0;
|
||||
countdown -= !!countdown;
|
||||
|
||||
int leader_quantized = round(filter(&leader_lowpass, dat_value));
|
||||
int leader_level = leader_quantized == 0;
|
||||
int leader_level = dat_quantized == 0;
|
||||
int leader_pulse = !leader_level && leader_counter >= leader_length;
|
||||
leader_counter = leader_level ? leader_counter + 1 : 0;
|
||||
if (leader_pulse) {
|
||||
|
|
@ -93,9 +92,9 @@ static int calibration_detected(float dat_value, int cnt_quantized)
|
|||
return -1;
|
||||
}
|
||||
|
||||
static int calibration_detector(float dat_value, int cnt_quantized)
|
||||
static int calibration_detector(int dat_quantized, int cnt_quantized)
|
||||
{
|
||||
switch (calibration_detected(dat_value, cnt_quantized)) {
|
||||
switch (calibration_detected(dat_quantized, cnt_quantized)) {
|
||||
case 0x88:
|
||||
return mode_robot36;
|
||||
case 0x0c:
|
||||
|
|
|
|||
|
|
@ -283,7 +283,7 @@ void decode(int samples) {
|
|||
|
||||
static int reset_on_first_sync;
|
||||
if (automatic_mode_detection) {
|
||||
int detected_mode = calibration_detector(dat_value, cnt_quantized);
|
||||
int detected_mode = calibration_detector(dat_quantized, cnt_quantized);
|
||||
if (detected_mode >= 0) {
|
||||
//RS_DEBUG(detected_mode);
|
||||
reset_on_first_sync = 1;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,6 @@ void initialize(float rate, int length, int iw, int ih, int sw, int sh, int sgw,
|
|||
const float cnt_bandwidth = 200.0f;
|
||||
|
||||
avg_power = ema_cutoff(10.0f, sample_rate);
|
||||
leader_lowpass = ema_cutoff(100.0f, sample_rate);
|
||||
|
||||
cnt_ddc = ddc(cnt_carrier, cnt_bandwidth, sample_rate);
|
||||
dat_ddc = ddc(dat_carrier, dat_bandwidth, sample_rate);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||
#ifndef STATE_RSH
|
||||
#define STATE_RSH
|
||||
|
||||
static ema_t avg_power, leader_lowpass;
|
||||
static ema_t avg_power;
|
||||
static ddc_t cnt_ddc, dat_ddc;
|
||||
static fmd_t cnt_fmd, dat_fmd;
|
||||
static int disable_analyzer;
|
||||
|
|
|
|||
Loading…
Reference in a new issue