thsa = ThSearchAlgorithm()
            gth = ThSelect(coeffs[i]).DonohoThEx()
            bsth = thsa.FibonacciSearch(bthe.msesurefuction, [0, 1.5 * gth],
                                        0.001)
            gths.append(gth)
            bsths.append(bsth)
        gthss.append(gths)
        bsthss.append(bsths)

    for i in range(len(ods)):
        dwd = DWTP(ods[i])
        coeffs = dwd.dwtdec(wtname='db4', delevel=dl)
        gths = gthss[i]
        bsths = gthss[i]
        ncoeffs1 = dwd.thprocess2(coeffs,
                                  ths=gths,
                                  thf='thf3',
                                  thps=[2 + 2 * k for k in range(dl)])
        ncoeffs2 = dwd.thprocess2(coeffs,
                                  ths=bsths,
                                  thf='thf3',
                                  thps=[2 + 2 * k for k in range(dl)])
        gthpd = dwd.dwtrec(ncoeffs1, wtname='db4')
        bsthpd = dwd.dwtrec(ncoeffs2, wtname='db4')
        gthpds.append(gthpd)
        bsthpds.append(bsthpd)

    gthsnrs = []
    bsthsnrs = []
    gthmses = []
    bsthmses = []
    tds = [s.createSin(50, 60, 0), s.createPulse(50, 60, 0), s.createSpikes(0)]
Exemplo n.º 2
0
                                          0.01)
            gths.append(gth)
            srmths.append(srmth)
            srmths2.append(srmth2)
        gthss.append(gths)
        srmthss.append(srmths)
        srmthss2.append(srmths2)

    for i in range(len(thsmatrix)):
        for j in range(len(ods)):
            dwd = DWTP(ods[j])
            coeffs = dwd.dwtdec(wtname='sym6', delevel=dl)
            ths = thsmatrix[i]
            if i == 3:
                ncoeffs = dwd.thprocess2(coeffs,
                                         ths=thsmatrix[i][j],
                                         thf='thf3',
                                         thps=[2 + 2 * k for k in range(dl)])
            else:
                ncoeffs = dwd.thprocess(coeffs,
                                        ths=thsmatrix[i][j],
                                        thf=thfname[i],
                                        thp=4)
            pd = dwd.dwtrec(ncoeffs, wtname='sym6')
            pdsmatrix[i].append(pd)

    ssnrs = []
    hsnrs = []
    thf3snrs = []
    thf3wpsnrs = []

    smses = []