A project to log to standard console the BPM of a Chick Timer (CT) for Kiwi.
Suggested buffering chunk size -c 16384
or -c 65536
(to test)
Suggested sample rate -s 2.048e6
(allows covering from channel 00 (160.120Mhz), 01 (160.130).....99 (161.110Mhz) ) (Total Spectrum 0.990Mhz)
(Not configurable but FYI processing 2.56e5 samples at a time)
- 80 BPM - Mortality mode
- 46-48 BPM - Not incubating
- 30 BPM - Incubating
Every 10 minutes the transmitter pauses for 3 seconds then emits 8 groups of two digit numbers. Each pair of two digit numbers is seperated by a 3 second pause.
- Days since change of state
- Days since hatch
- Days since desertion alert
- Time of emergence
- Weeks of batt life for Tx
- Activity yesterday
- Activity 2 days ago
- True mean of last 4 days (activity)
Full manual http://wildtech.co.nz/downloads/NiB%20CT%20V3.4.pdf
- Add samples for testing purposes (weak signals, signals on ch00 and ch99, multiple signals, signals at 30, 48, 80 bpm, CT signals)
- In sample_processor handle edge case where chunk edge goes through middle of a beep (falling edge array is empty). Add Boolean 'no_falling_edge' and track number of high samples for calculation of
BEEP_DURATION
on next set of chunks. - Lower threshold to more suitable value - from 0.9 to ?
- Test performance on Rpi4
- Add sample signal on Ch00 and Ch99 for Nyquist edge test
- Add sample signal for 30BPM (incubation mode)
- Add validation (1) background BPM output with tolerance +/- 1?
[expected for expected in [80, 46, 47, 48, 30] if abs(actual - expected) < 1]
and (2) BEEP_DURATION must be 0.017 sec - Processing of CT signals - start with a data class for CT and then CT detection (3 second pause in gap between beeps, i.e. rising_edges)
- Add SNR output for each beep
- How often to do a channel scan? Hourly?
- Add option to log signals to MySQL
- Change Fc default to closer to being between middle freqs (i.e. 160.625Mhz) if bandwidth is 1.5Mhz. Else if bandwidth is 2.048Mhz then Fc can be out of band for freqs of interest - performance question on Rpi4 / No need to deal with DC spike at Fc.
- Scan and Log CT signals daily.
Installation within a virtual environment is highly recommended
pip install 'kiwitracker@git+https://github.com/bigalnz/test_fft.git'
git clone git@github.com:bigalnz/test_fft.git
pip install -e .
Once installed, the project can be invoked on the command line:
kiwitracker --help
Which should display the following:
usage: kiwitracker [-h] [-f INFILE] [-o OUTFILE] [-m MAX_SAMPLES] [-c CHUNK_SIZE] [-s SAMPLE_RATE] [--center-freq CENTER_FREQ] [-g GAIN] [--carrier CARRIER]
options:
-h, --help show this help message and exit
-f INFILE, --from-file INFILE
Read samples from the given filename and process them
-o OUTFILE, --outfile OUTFILE
Read samples from the device and save to the given filename
-m MAX_SAMPLES, --max-samples MAX_SAMPLES
Number of samples to read when "-o/--outfile" is specified
Sampling:
-c CHUNK_SIZE, --chunk-size CHUNK_SIZE
Chunk size for sdr.read_samples (default: 65536)
-s SAMPLE_RATE, --sample-rate SAMPLE_RATE
SDR sample rate (default: 1024000.0)
--center-freq CENTER_FREQ
SDR center frequency (default: 160270968)
-g GAIN, --gain GAIN SDR gain (default: 7.7)
Processing:
--carrier CARRIER Carrier frequency to process (default: 160707760)