

Print("Found an unusual pulse, storing for later")
Duplicate zapper windows code#
We then loop around and keep going to the next 'pillar'Ĭopy Code if 30*delta_high %0.2f" % (p, delta_high, delta_low, pulse_freq)) The list contains the average-frequency, the length that the pulses were active, and then that long- delta_low pulse converted to seconds. This did happen a few times, we just dropped these points.įinally, if all the frequency-pulses in a pillar are within our exactly standards, we simplify them all down to a 3-part list. If there is any such variation, we store for later and keep going. Then we check that all the pulses are within 10% (over 0.9x and under 1.1x the average). We calculate avg_freq which is just the plain 'mean' average. Otherwise, lets figure out what happened in this 'pillar' of pulses. (we picked 30 arbitrarily) Lets check if we have anything stored in pulse_points, if not it means we had a single blip of light, which is super weird (but did happen to us) So we store it in unusual_codes. If the low pulse is over 30 times longer than the high pulse, we're probably at the end of a pillar of modulated signal. Now we come back to the special cases at the top of the if statement. We'll do this 99% of the time, calculating the frequency of a pair of pulses, then appending until. That is, assuming nothing special, we'll append the frequency reading we just made to a list for later handling.

Check at the bottom of this block and we have this section after our special-case checks Hi2_p = dataset SAMPLERATE = 12000000 # 12 Mhz default # and the amount of time the signal is 0 into frequency_pairsįor p in range(0, len(dataset), 2): # take points two at a time # them into a triplet of the frequency, the amount of time that freq is emitted # checks that the pulses so far are all the same frequency, and compresses # until it gets to a long low pulse (e.g. # the frequency (usually 38KHz - 57KHz) and stores the freq in pulse_points # to calculate the high and low pulse lengths. # This function eats up two points at a time (but peeks at the third) Unusual_codes = # These are manchester coded or otherwise non-standard! Copy Code SAMPLERATE = 12000000 # 12 Mhz default
