lab/03-Package-Deploy/greengrass-v2/artifacts/aws.samples.windturbine.detector/1.0.0/inference/util.py [35:49]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    '''
    Filter accelerometer data using wavelet denoising
    Modification of F. Blanco-Silva's code at: https://goo.gl/gOQwy5
    '''

    wavelet = pywt.Wavelet(wavelet)
    levels  = min(5, (np.floor(np.log2(data.shape[0]))).astype(int))

    # Francisco's code used wavedec2 for image data
    wavelet_coeffs = pywt.wavedec(data, wavelet, level=levels)
    threshold = noise_sigma*np.sqrt(2*np.log2(data.size))

    new_wavelet_coeffs = map(lambda x: pywt.threshold(x, threshold, mode='soft'), wavelet_coeffs)

    return pywt.waverec(list(new_wavelet_coeffs), wavelet)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



lab/03-Package-Deploy/iot-jobs/app/windfarm.py [97:111]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        '''
        Filter accelerometer data using wavelet denoising
        Modification of F. Blanco-Silva's code at: https://goo.gl/gOQwy5
        '''

        wavelet = pywt.Wavelet(wavelet)
        levels  = min(5, (np.floor(np.log2(data.shape[0]))).astype(int))

        # Francisco's code used wavedec2 for image data
        wavelet_coeffs = pywt.wavedec(data, wavelet, level=levels)
        threshold = noise_sigma*np.sqrt(2*np.log2(data.size))

        new_wavelet_coeffs = map(lambda x: pywt.threshold(x, threshold, mode='soft'), wavelet_coeffs)

        return pywt.waverec(list(new_wavelet_coeffs), wavelet)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



