Beispiel #1
0
from SignalModel import Signal
import matplotlib.pyplot as plt
from WtProcess import SWTP
from SpatialCorrelationThresholdALG import SpCoThALG
from ThSearchAlgorithm import ThSearchAlgorithm
from ThresholdSelect import ThSelect

if __name__ == '__main__':
    s = Signal(1024)
    od1 = s.createSin(50, 60, 4)
    od2 = s.createPulse(50, 60, 4)
    od3 = s.createSpikes(4)
    ods = [od1, od2, od3]
    dnames = ['Sine', 'Pulse', 'Spike']
    sfp1pds = []
    sfp2pds = []
    for od in ods:
        swt = SWTP(od)
        coeffs = swt.swtdec(delevel=4)
        spta2 = SpCoThALG(coeffs)
        sfp1gcvs = []
        sfp2gcvs = []
        P = spta2.spcoCors()
        spta2.BTHassitIndex(1, pk=0.1, pa=4, mode='srmse')
        for k in range(1, 100):
            sfp2gcv = spta2.BTHspcothfwp2(k/10)
            sfp2gcvs.append(sfp2gcv)
        x=[x/10 for x in range(1, 100)]
        plt.figure()
        plt.plot(x, sfp2gcvs)
    plt.show()
Beispiel #2
0
from SignalModel import Signal
from LayerSelect import LayerSelect
import matplotlib.pyplot as plt
import numpy as np
import math as mt
from BlockThMethod import BlockThMethod
from ThresholdSelect import ThSelect
from BestThEstimation import BestThEstimate
from ThSearchAlgorithm import ThSearchAlgorithm
from WtProcess import DWTP
from DenoiseResult import DenoiseRsult

if __name__ == '__main__':
    s = Signal(4000)
    od1 = s.createSin(200, 60, 10)
    od2 = s.createPulse(200, 60, 10)
    od3 = s.createSpikes(10)
    ods = [od1, od2, od3]
    dnames = ['Sine', 'Pulse', 'Spike']
    gthss = []
    srmthss = []
    srmthss2 = []
    thsmatrix = [gthss, gthss, srmthss, srmthss2]
    thmname = ['sth', 'hth', 'srm', 'srm']
    thfname = ['soft', 'hard', 'thf3', 'thf3wp']
    spds = []
    hpds = []
    thf3pds = []
    thf3wppds = []
    pdsmatrix = [spds, hpds, thf3pds, thf3wppds]
    dl = 5
Beispiel #3
0
from SignalModel import Signal
import matplotlib.pyplot as plt
from WtProcess import SWTP
from SpatialCorrelationThresholdALG import SpCoThALG
from ThSearchAlgorithm import ThSearchAlgorithm
from ThresholdSelect import ThSelect
from DenoiseResult import DenoiseRsult

if __name__ == '__main__':
    s = Signal(1024)
    od1 = s.createSin(50, 60, 4)
    od2 = s.createPulse(50, 60, 4)
    od3 = s.createSpikes(4)
    ods = [od1, od2, od3]
    dnames = ['Sine', 'Pulse', 'Spike']
    sf1pds = []
    sf2pds = []
    sfp1pds = []
    sfp2pds = []

    for od in ods:
        swt = SWTP(od)
        coeffs = swt.swtdec(wtname='sym6', delevel=4)
        spta = SpCoThALG(coeffs)
        nce1s = spta.spcoThf1()
        nce2s = spta.spcoThf2()
        sf1pd = swt.swtrec(nce1s, wtname='sym6')
        sf2pd = swt.swtrec(nce2s, wtname='sym6')
        sf1pds.append(sf1pd)
        sf2pds.append(sf2pd)
Beispiel #4
0
from SignalModel import Signal
import matplotlib.pyplot as plt
from DenoiseResult import DenoiseRsult

s = Signal(1000)
td1 = s.createSin(50, 60, 0)
od1 = s.createSin(50, 60, 4)
td2 = s.createPulse(50, 60, 0)
od2 = s.createPulse(50, 60, 4)
td3 = s.createSpikes(0)
od3 = s.createSpikes(4)

x = [x for x in range(1000)]
plt.figure()
plt.subplot(3, 2, 1)
plt.plot(x, td1)
plt.title("True sine signal")
plt.subplot(3, 2, 2)
plt.plot(x, od1)
plt.title("Noisy sine signal")
plt.subplot(3, 2, 3)
plt.plot(x, td2)
plt.title("True pulse signal")
plt.subplot(3, 2, 4)
plt.plot(x, od2)
plt.title("Noisy pulse signal")
plt.subplot(3, 2, 5)
plt.plot(x, td3)
plt.title("True spike signal")
plt.subplot(3, 2, 6)
plt.plot(x, od3)