|
rtl433
UNKNOWN
RTL-433 utility
|
Pulse detection functions. More...
Go to the source code of this file.
Data Structures | |
| struct | pulse_data |
| Data for a compact representation of generic pulse train. More... | |
Typedefs | |
| typedef struct pulse_data | pulse_data_t |
| Data for a compact representation of generic pulse train. More... | |
| typedef struct pulse_detect | pulse_detect_t |
Enumerations | |
| enum | package_types { PULSE_DATA_OOK = 1, PULSE_DATA_FSK = 2 } |
Functions | |
| void | pulse_data_clear (pulse_data_t *data) |
| Clear the content of a pulse_data_t structure. More... | |
| void | pulse_data_print (pulse_data_t const *data) |
| Print the content of a pulse_data_t structure (for debug). More... | |
| void | pulse_data_dump_raw (uint8_t *buf, unsigned len, uint64_t buf_offset, pulse_data_t const *data, uint8_t bits) |
| Dump the content of a pulse_data_t structure as raw binary. More... | |
| void | pulse_data_print_vcd_header (FILE *file, uint32_t sample_rate) |
| Print a header for the VCD format. More... | |
| void | pulse_data_print_vcd (FILE *file, pulse_data_t const *data, int ch_id) |
| Print the content of a pulse_data_t structure in VCD format. More... | |
| void | pulse_data_load (FILE *file, pulse_data_t *data) |
| Read the next pulse_data_t structure from OOK text. More... | |
| void | pulse_data_print_pulse_header (FILE *file) |
| Print a header for the OOK text format. More... | |
| void | pulse_data_dump (FILE *file, pulse_data_t *data) |
| Print the content of a pulse_data_t structure as OOK text. More... | |
| pulse_detect_t * | pulse_detect_create (void) |
| void | pulse_detect_free (pulse_detect_t *pulse_detect) |
| int | pulse_detect_package (pulse_detect_t *pulse_detect, int16_t const *envelope_data, int16_t const *fm_data, int len, int16_t level_limit, uint32_t samp_rate, uint64_t sample_offset, pulse_data_t *pulses, pulse_data_t *fsk_pulses) |
| Demodulate On/Off Keying (OOK) and Frequency Shift Keying (FSK) from an envelope signal. More... | |
| void | pulse_analyzer (pulse_data_t *data, int package_type) |
| Analyze and print result. More... | |
Pulse detection functions.
Copyright (C) 2015 Tommy Vestermark
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
| typedef struct pulse_data pulse_data_t |
Data for a compact representation of generic pulse train.
| typedef struct pulse_detect pulse_detect_t |
| enum package_types |
| void pulse_analyzer | ( | pulse_data_t * | data, |
| int | package_type | ||
| ) |
Analyze and print result.
Analyze and print result.
References histogram_t::bins, histogram_t::bins_count, pulse_data::fsk_f1_est, pulse_data::fsk_f2_est, FSK_PULSE_PCM, FSK_PULSE_PWM, pulse_data::gap, histogram_delete_bin(), histogram_fuse_bins(), histogram_print(), histogram_sort_count(), histogram_sort_mean(), histogram_sum(), hist_bin_t::max, hist_bin_t::mean, r_device::modulation, r_device::name, pulse_data::noise_db, pulse_data::num_pulses, pulse_data::ook_high_estimate, pulse_data::ook_low_estimate, OOK_PULSE_MANCHESTER_ZEROBIT, OOK_PULSE_PPM, OOK_PULSE_PWM, pulse_data::pulse, PULSE_DATA_FSK, pulse_demod_manchester_zerobit(), pulse_demod_pcm(), pulse_demod_ppm(), pulse_demod_pwm(), pulse_data::rssi_db, r_device::s_gap_limit, r_device::s_long_width, r_device::s_reset_limit, r_device::s_short_width, r_device::s_sync_width, r_device::s_tolerance, pulse_data::sample_rate, and pulse_data::snr_db.
Referenced by sdr_callback().
| void pulse_data_clear | ( | pulse_data_t * | data | ) |
Clear the content of a pulse_data_t structure.
Referenced by pulse_data_load(), and pulse_detect_package().
| void pulse_data_dump | ( | FILE * | file, |
| pulse_data_t * | data | ||
| ) |
Print the content of a pulse_data_t structure as OOK text.
References pulse_data::freq1_hz, pulse_data::freq2_hz, pulse_data::fsk_f2_est, pulse_data::gap, pulse_data::num_pulses, pulse_data::pulse, and pulse_data::sample_rate.
Referenced by sdr_callback().
| void pulse_data_dump_raw | ( | uint8_t * | buf, |
| unsigned | len, | ||
| uint64_t | buf_offset, | ||
| pulse_data_t const * | data, | ||
| uint8_t | bits | ||
| ) |
Dump the content of a pulse_data_t structure as raw binary.
References bounded_memset(), pulse_data::gap, pulse_data::num_pulses, pulse_data::offset, and pulse_data::pulse.
Referenced by sdr_callback().
| void pulse_data_load | ( | FILE * | file, |
| pulse_data_t * | data | ||
| ) |
Read the next pulse_data_t structure from OOK text.
References pulse_data::freq1_hz, pulse_data::freq2_hz, pulse_data::gap, pulse_data::num_pulses, pulse_data::pulse, pulse_data_clear(), and pulse_data::sample_rate.
Referenced by main().
| void pulse_data_print | ( | pulse_data_t const * | data | ) |
Print the content of a pulse_data_t structure (for debug).
References pulse_data::gap, pulse_data::num_pulses, and pulse_data::pulse.
Referenced by sdr_callback().
| void pulse_data_print_pulse_header | ( | FILE * | file | ) |
| void pulse_data_print_vcd | ( | FILE * | file, |
| pulse_data_t const * | data, | ||
| int | ch_id | ||
| ) |
Print the content of a pulse_data_t structure in VCD format.
References pulse_data::gap, pulse_data::num_pulses, pulse_data::offset, pulse_data::pulse, and pulse_data::sample_rate.
Referenced by sdr_callback().
| void pulse_data_print_vcd_header | ( | FILE * | file, |
| uint32_t | sample_rate | ||
| ) |
Print a header for the VCD format.
References format_time_str(), and nice_freq().
Referenced by add_dumper().
| pulse_detect_t* pulse_detect_create | ( | void | ) |
Referenced by main().
| void pulse_detect_free | ( | pulse_detect_t * | pulse_detect | ) |
Referenced by r_free_cfg().
| int pulse_detect_package | ( | pulse_detect_t * | pulse_detect, |
| int16_t const * | envelope_data, | ||
| int16_t const * | fm_data, | ||
| int | len, | ||
| int16_t | level_limit, | ||
| uint32_t | samp_rate, | ||
| uint64_t | sample_offset, | ||
| pulse_data_t * | pulses, | ||
| pulse_data_t * | fsk_pulses | ||
| ) |
Demodulate On/Off Keying (OOK) and Frequency Shift Keying (FSK) from an envelope signal.
Function is stateful and can be called with chunks of input data.
| envelope_data | Samples with amplitude envelope of carrier | |
| fm_data | Samples with frequency offset from center frequency | |
| len | Number of samples in input buffers | |
| samp_rate | Sample rate in samples per second | |
| [in,out] | pulses | Will return a pulse_data_t structure |
| [in,out] | fsk_pulses | Will return a pulse_data_t structure for FSK demodulated data |
References pulse_detect::data_counter, pulse_data::end_ago, pulse_FSK_state_t::fm_f1_est, pulse_FSK_state_t::fm_f2_est, pulse_data::fsk_f1_est, pulse_data::fsk_f2_est, pulse_detect::FSK_state, pulse_data::gap, pulse_detect::lead_in_counter, pulse_detect::max_pulse, pulse_data::num_pulses, pulse_data::offset, pulse_data::ook_high_estimate, pulse_detect::ook_high_estimate, pulse_data::ook_low_estimate, pulse_detect::ook_low_estimate, pulse_detect::ook_state, pulse_data::pulse, pulse_data_clear(), PULSE_DATA_FSK, PULSE_DATA_OOK, pulse_FSK_detect(), pulse_FSK_wrap_up(), pulse_detect::pulse_length, pulse_data::sample_rate, and pulse_data::start_ago.
Referenced by sdr_callback().