python小波尺度图的LDA降维

2024-07-05 14:49:02 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图降低具有相同尺寸[5x3844]的多个比例图的维数。 我如何在python中使用LDA应用它

任何帮助都将不胜感激

代码

def wavelet(data):
    fs=256
    lowcut=117
    highcut=123
    y=butter_bandstop_filter(data, lowcut, highcut, fs, order=6)
    lowcut=57
    highcut=63
    y=butter_bandstop_filter(y, lowcut, highcut, fs, order=6)
    cutoff=1
    y=butter_highpass_filter(y, cutoff, fs, order=6)
    coeffs = wavedec(y, 'sym5', level=5)
    cA5,cD5,cD4,cD3,cD2,cD1=coeffs
    result = []
    common_x = np.linspace(0,3844, len(cD1))
    for c in [cD5,cD4,cD3,cD2,cD1]:
        x = np.linspace(0, 3844, len(c))
        f = interp1d(x, c)
        result.append(f(common_x)) 
    return result

Tags: dataorderresultfilterfscutoffcd1butter