You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
from modulators.OOKModulator import OOKModulator
|
|
|
|
import numpy as np
|
|
|
|
"""
|
|
|
|
Nemaxx WL10 Smokedetectors
|
|
|
|
"""
|
|
|
|
class Nemaxx_WL10_SmokeDetector:
|
|
|
|
def __init__(self, baseband_samplerate=2e6):
|
|
|
|
self.modulator = OOKModulator(baseband_samplerate=baseband_samplerate, am_frequency=22.471e3)
|
|
|
|
def test(self):
|
|
|
|
print("Nemaxx WL10 Smokedetector (433MHz)")
|
|
|
|
def generateSamples(self, repeatNum=20, alarmID24Bit, numpyType=np.complex64):
|
|
|
|
for i in range(repeatNum):
|
|
|
|
bits = alarmID24Bit
|
|
|
|
print(bits)
|
|
|
|
self.modulator.addModulation(8120)
|
|
|
|
self.modulator.addPadding(912)
|
|
|
|
for j in bits:
|
|
|
|
self.modulator.addModulation(795)
|
|
|
|
self.modulator.addPadding(1400 if int(j) == 0 else 2750)
|
|
|
|
self.modulator.addModulation(795)
|
|
|
|
self.modulator.addPadding(1337) # Packet Sync
|
|
|
|
self.modulator.addPadding(20000)
|
|
|
|
|
|
|
|
return self.modulator.getSamplesAndReset(numpyType)
|