Beispiel #1
0
    def init(self, context):
        RawEKG = context.get_channel('Channel 1', color='red', label='Raw with 50/60 Hz Noise')

        RawEKG = DCBlock(RawEKG).ac

        RAWOSC1 = Oscilloscope('Raw Signal', channels=[RawEKG])
        RAWOSC1.autoscale = True

        gridFilter = BandPass(1.0, 35.0, input=RawEKG)
        EKG = gridFilter.output
        EKG.color = 'green'

        RAWOSC1.channels.append(EKG)

        fftFilt = Spectrograph('Spectrogram', mode='waterfall')
        fftFilt.freq_range = gridFilter.range
        fftFilt.label = 'Frequency Spectrum'

        heart = HeartAnalyzer(input=EKG)

        BPM = TextBox('BPM', label='Heartbeats per minute')
        BPM.input = heart.bpm

        drum = MIDIDrum(port=0)
        drum.trigger = heart.beat


        self.RAWOSC1 = RAWOSC1
        self.fftFilt = fftFilt
Beispiel #2
0
    def init(self, context):
        Cz = context.get_channel('Channel 1', color='red', label='Raw with 50/60 Hz Noise')

        Cz = DCBlock(Cz).ac
        Cz = BandPass(0.0, 35.0, input=Cz)

        self.OSC1 = Oscilloscope('Raw Signal', channels=[BandPass(0.0, 30.0, input=Cz)])
        
        SMR = BandPass(12, 15, input=Cz, order=6)
        self.OSC2 = Oscilloscope('SMR Signal', channels=[SMR])

        SMR_amplitude = RMS(SMR)
        theta_ampl = RMS(BandPass(4, 8, input=Cz))
        theta_ampl.output.color='red'
        total_power = RMS(Cz)

        self.OSC3 = Oscilloscope('SMR Amplitude', channels=[SMR_amplitude, theta_ampl])

        SMR_trend = Trendline(SMR_amplitude)
        total_trend = Trendline(total_power)

        total_trend.output.color = 'red'

        self.OSC4 = Oscilloscope('SMR Trendline', channels=[SMR_trend, total_trend])

        self.bb = BinauralBeat(volume=SMR_amplitude)

        self.Spec = BarSpectrogram('Cz Spectrogram', input=BandPass(0.1, 30.0, input=Cz, order=6))
Beispiel #3
0
    def init(self, context):
        Fz = context.get_channel('Channel 1', color='red', label='Raw with 50/60 Hz Noise')

        Fz = DCBlock(Fz).ac
        Fz = BandPass(1.0, 25.0, input=Fz)

        Osci1 = Oscilloscope('Raw Signal', channels=[Fz])

        Alpha = RMS(BandPass(9.0, 11.0, input=Fz))
        Alpha = Normalizer(Alpha)

        self.midi = MidiControl(cc={23: Alpha})
        self.midi.cc[1] = Normalizer(RMS(BandPass(4, 8, input=Fz)))
        #self.midi.cc[2] = Normalizer(Intensity(BandPass(15, 18, input=Fz)))
        #self.midi.cc[3] = Normalizer(Intensity(BandPass(18, 21, input=Fz)))

        #dom_freq = DominantFrequency(Fz).freq
        #dom_freq.color = 'green'
        #self.midi.cc[4] = dom_freq

        Osci2 = Oscilloscope('Intensity', channels=[Alpha])
        Osci2.autoscale = False

        self.midi.cc[1].color = 'red'
        Osci2.channels.append(self.midi.cc[1])

        #fftFilt = Spectrograph('Spectrogram', mode='waterfall')
        #fftFilt.freq_range = gridFilter.range
        #fftFilt.label = 'Frequency Spectrum'

        self.RAWOSC1 = Osci1
        self.OSC2 = Osci2
        #self.fftFilt = fftFilt
        self.bars = BarSpectrogram('Spectrogram', input=Fz)
Beispiel #4
0
    def init(self, context):
        RawEKG = context.get_channel('Channel 1',
                                     color='red',
                                     label='Raw with 50/60 Hz Noise')

        RawEKG = DCBlock(RawEKG).ac

        RAWOSC1 = Oscilloscope('Raw Signal', channels=[RawEKG])
        RAWOSC1.autoscale = True

        gridFilter = BandPass(1.0, 35.0, input=RawEKG)
        EKG = gridFilter.output
        EKG.color = 'green'

        RAWOSC1.channels.append(EKG)

        fftFilt = Spectrograph('Spectrogram', mode='waterfall')
        fftFilt.freq_range = gridFilter.range
        fftFilt.label = 'Frequency Spectrum'

        heart = HeartAnalyzer(input=EKG)

        BPM = TextBox('BPM', label='Heartbeats per minute')
        BPM.input = heart.bpm

        drum = MIDIDrum(port=0)
        drum.trigger = heart.beat

        self.RAWOSC1 = RAWOSC1
        self.fftFilt = fftFilt
Beispiel #5
0
class MultibandFlow(object):
    
    def init(self, context):
        channel1 = context.get_channel('Channel 1', color='red', label='Raw with 50/60 Hz Noise')

        dcblock = DCBlock(channel1)
        channel1 = BandPass(0.0, 30.0, input=dcblock.ac, order=6)

        self.OSC1 = Oscilloscope('Raw Signal', channels=[channel1])

        alpha = BandPass(9, 11, input=channel1)
        theta = BandPass(5, 7, input=channel1)
        delta = BandPass(1.5, 3, input=channel1)
        lobeta = BandPass(13, 15, input=channel1)
        hibeta = BandPass(15, 20, input=channel1)

        alpha.output.color = 'green'
        theta.output.color = 'orange'
        delta.output.color = 'red'
        lobeta.output.color = 'blue'
        hibeta.output.color = 'cyan'

        chanlist = [alpha, 
            theta,
            delta,
            lobeta, hibeta]

        self.OSC2 = Oscilloscope('Band Signal', channels=chanlist)

        amplitudes = [RMS(channel) for channel in chanlist]

        self.OSC3 = Oscilloscope('Amplitude', channels=amplitudes)

        trends = [Trendline(channel) for channel in amplitudes]
        self.OSC4 = Oscilloscope('SMR Trendline', channels=trends)

        self.Spec = BarSpectrogram('Spectrogram', input=channel1)

        dctrend = Trendline(dcblock.dc)
        self.DCOSC = Oscilloscope('DC Trend', channels=[dctrend])

    def widget(self):
        w = QtGui.QWidget()
        layout = QtGui.QGridLayout()
        w.setLayout(layout)

        layout.addWidget(self.OSC1.widget(), 0, 0)
        layout.addWidget(self.OSC2.widget(), 1, 0)
        layout.addWidget(self.OSC3.widget(), 2, 0)
        layout.addWidget(self.OSC4.widget(), 3, 0)

        layout.addWidget(self.Spec.widget(), 0, 1, 3, 1)
        layout.addWidget(self.DCOSC.widget(), 3, 1)

        return w
Beispiel #6
0
class MultibandFlow(object):
    def init(self, context):
        channel1 = context.get_channel('Channel 1',
                                       color='red',
                                       label='Raw with 50/60 Hz Noise')

        dcblock = DCBlock(channel1)
        channel1 = BandPass(0.0, 30.0, input=dcblock.ac, order=6)

        self.OSC1 = Oscilloscope('Raw Signal', channels=[channel1])

        alpha = BandPass(9, 11, input=channel1)
        theta = BandPass(5, 7, input=channel1)
        delta = BandPass(1.5, 3, input=channel1)
        lobeta = BandPass(13, 15, input=channel1)
        hibeta = BandPass(15, 20, input=channel1)

        alpha.output.color = 'green'
        theta.output.color = 'orange'
        delta.output.color = 'red'
        lobeta.output.color = 'blue'
        hibeta.output.color = 'cyan'

        chanlist = [alpha, theta, delta, lobeta, hibeta]

        self.OSC2 = Oscilloscope('Band Signal', channels=chanlist)

        amplitudes = [RMS(channel) for channel in chanlist]

        self.OSC3 = Oscilloscope('Amplitude', channels=amplitudes)

        trends = [Trendline(channel) for channel in amplitudes]
        self.OSC4 = Oscilloscope('SMR Trendline', channels=trends)

        self.Spec = BarSpectrogram('Spectrogram', input=channel1)

        dctrend = Trendline(dcblock.dc)
        self.DCOSC = Oscilloscope('DC Trend', channels=[dctrend])

    def widget(self):
        w = QtGui.QWidget()
        layout = QtGui.QGridLayout()
        w.setLayout(layout)

        layout.addWidget(self.OSC1.widget(), 0, 0)
        layout.addWidget(self.OSC2.widget(), 1, 0)
        layout.addWidget(self.OSC3.widget(), 2, 0)
        layout.addWidget(self.OSC4.widget(), 3, 0)

        layout.addWidget(self.Spec.widget(), 0, 1, 3, 1)
        layout.addWidget(self.DCOSC.widget(), 3, 1)

        return w
Beispiel #7
0
    def init(self, context):
        Cz = context.get_channel('Channel 1',
                                 color='red',
                                 label='Raw with 50/60 Hz Noise')

        Cz = DCBlock(Cz).ac
        Cz = BandPass(0.0, 35.0, input=Cz)

        self.OSC1 = Oscilloscope('Raw Signal',
                                 channels=[BandPass(0.0, 30.0, input=Cz)])

        SMR = BandPass(12, 15, input=Cz, order=6)
        self.OSC2 = Oscilloscope('SMR Signal', channels=[SMR])

        SMR_amplitude = RMS(SMR)
        theta_ampl = RMS(BandPass(4, 8, input=Cz))
        theta_ampl.output.color = 'red'
        total_power = RMS(Cz)

        self.OSC3 = Oscilloscope('SMR Amplitude',
                                 channels=[SMR_amplitude, theta_ampl])

        SMR_trend = Trendline(SMR_amplitude)
        total_trend = Trendline(total_power)

        total_trend.output.color = 'red'

        self.OSC4 = Oscilloscope('SMR Trendline',
                                 channels=[SMR_trend, total_trend])

        self.bb = BinauralBeat(volume=SMR_amplitude)

        self.Spec = BarSpectrogram('Cz Spectrogram',
                                   input=BandPass(0.1, 30.0, input=Cz,
                                                  order=6))
Beispiel #8
0
class SMRFlow(object):
    def init(self, context):
        Cz = context.get_channel('Channel 1',
                                 color='red',
                                 label='Raw with 50/60 Hz Noise')

        Cz = DCBlock(Cz).ac
        Cz = BandPass(0.0, 35.0, input=Cz)

        self.OSC1 = Oscilloscope('Raw Signal',
                                 channels=[BandPass(0.0, 30.0, input=Cz)])

        SMR = BandPass(12, 15, input=Cz, order=6)
        self.OSC2 = Oscilloscope('SMR Signal', channels=[SMR])

        SMR_amplitude = RMS(SMR)
        theta_ampl = RMS(BandPass(4, 8, input=Cz))
        theta_ampl.output.color = 'red'
        total_power = RMS(Cz)

        self.OSC3 = Oscilloscope('SMR Amplitude',
                                 channels=[SMR_amplitude, theta_ampl])

        SMR_trend = Trendline(SMR_amplitude)
        total_trend = Trendline(total_power)

        total_trend.output.color = 'red'

        self.OSC4 = Oscilloscope('SMR Trendline',
                                 channels=[SMR_trend, total_trend])

        self.bb = BinauralBeat(volume=SMR_amplitude)

        self.Spec = BarSpectrogram('Cz Spectrogram',
                                   input=BandPass(0.1, 30.0, input=Cz,
                                                  order=6))

    def widget(self):
        w = QtGui.QWidget()
        layout = QtGui.QGridLayout()
        w.setLayout(layout)

        layout.addWidget(self.OSC1.widget(), 0, 0)
        layout.addWidget(self.OSC2.widget(), 1, 0)
        layout.addWidget(self.OSC3.widget(), 2, 0)
        layout.addWidget(self.OSC4.widget(), 3, 0)

        layout.addWidget(self.Spec.widget(), 0, 1, 4, 1)

        return w
Beispiel #9
0
class SMRFlow(object):
    
    def init(self, context):
        Cz = context.get_channel('Channel 1', color='red', label='Raw with 50/60 Hz Noise')

        Cz = DCBlock(Cz).ac
        Cz = BandPass(0.0, 35.0, input=Cz)

        self.OSC1 = Oscilloscope('Raw Signal', channels=[BandPass(0.0, 30.0, input=Cz)])
        
        SMR = BandPass(12, 15, input=Cz, order=6)
        self.OSC2 = Oscilloscope('SMR Signal', channels=[SMR])

        SMR_amplitude = RMS(SMR)
        theta_ampl = RMS(BandPass(4, 8, input=Cz))
        theta_ampl.output.color='red'
        total_power = RMS(Cz)

        self.OSC3 = Oscilloscope('SMR Amplitude', channels=[SMR_amplitude, theta_ampl])

        SMR_trend = Trendline(SMR_amplitude)
        total_trend = Trendline(total_power)

        total_trend.output.color = 'red'

        self.OSC4 = Oscilloscope('SMR Trendline', channels=[SMR_trend, total_trend])

        self.bb = BinauralBeat(volume=SMR_amplitude)

        self.Spec = BarSpectrogram('Cz Spectrogram', input=BandPass(0.1, 30.0, input=Cz, order=6))

    def widget(self):
        w = QtGui.QWidget()
        layout = QtGui.QGridLayout()
        w.setLayout(layout)

        layout.addWidget(self.OSC1.widget(), 0, 0)
        layout.addWidget(self.OSC2.widget(), 1, 0)
        layout.addWidget(self.OSC3.widget(), 2, 0)
        layout.addWidget(self.OSC4.widget(), 3, 0)

        layout.addWidget(self.Spec.widget(), 0, 1, 4, 1)

        return w
Beispiel #10
0
    def init(self, context):
        channel1 = context.get_channel('Channel 1', color='red', label='Raw with 50/60 Hz Noise')

        dcblock = DCBlock(channel1)
        channel1 = BandPass(0.0, 30.0, input=dcblock.ac, order=6)

        self.OSC1 = Oscilloscope('Raw Signal', channels=[channel1])

        alpha = BandPass(9, 11, input=channel1)
        theta = BandPass(5, 7, input=channel1)
        delta = BandPass(1.5, 3, input=channel1)
        lobeta = BandPass(13, 15, input=channel1)
        hibeta = BandPass(15, 20, input=channel1)

        alpha.output.color = 'green'
        theta.output.color = 'orange'
        delta.output.color = 'red'
        lobeta.output.color = 'blue'
        hibeta.output.color = 'cyan'

        chanlist = [alpha, 
            theta,
            delta,
            lobeta, hibeta]

        self.OSC2 = Oscilloscope('Band Signal', channels=chanlist)

        amplitudes = [RMS(channel) for channel in chanlist]

        self.OSC3 = Oscilloscope('Amplitude', channels=amplitudes)

        trends = [Trendline(channel) for channel in amplitudes]
        self.OSC4 = Oscilloscope('SMR Trendline', channels=trends)

        self.Spec = BarSpectrogram('Spectrogram', input=channel1)

        dctrend = Trendline(dcblock.dc)
        self.DCOSC = Oscilloscope('DC Trend', channels=[dctrend])
Beispiel #11
0
    def init(self, context):
        channel1 = context.get_channel('Channel 1',
                                       color='red',
                                       label='Raw with 50/60 Hz Noise')

        dcblock = DCBlock(channel1)
        channel1 = BandPass(0.0, 30.0, input=dcblock.ac, order=6)

        self.OSC1 = Oscilloscope('Raw Signal', channels=[channel1])

        alpha = BandPass(9, 11, input=channel1)
        theta = BandPass(5, 7, input=channel1)
        delta = BandPass(1.5, 3, input=channel1)
        lobeta = BandPass(13, 15, input=channel1)
        hibeta = BandPass(15, 20, input=channel1)

        alpha.output.color = 'green'
        theta.output.color = 'orange'
        delta.output.color = 'red'
        lobeta.output.color = 'blue'
        hibeta.output.color = 'cyan'

        chanlist = [alpha, theta, delta, lobeta, hibeta]

        self.OSC2 = Oscilloscope('Band Signal', channels=chanlist)

        amplitudes = [RMS(channel) for channel in chanlist]

        self.OSC3 = Oscilloscope('Amplitude', channels=amplitudes)

        trends = [Trendline(channel) for channel in amplitudes]
        self.OSC4 = Oscilloscope('SMR Trendline', channels=trends)

        self.Spec = BarSpectrogram('Spectrogram', input=channel1)

        dctrend = Trendline(dcblock.dc)
        self.DCOSC = Oscilloscope('DC Trend', channels=[dctrend])