Can we restored back the data after we smoothing the data using wavelet transform?

27 Views Asked by At

Here I want to smoothed data using wavelet transform,then I already done with it. but after I smoothed the data I want to restored back the smoothed data to original form. is it possible or not?

here my code for smoothed data using wavelet:

import pywt
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.pyplot as plt
import pywt
import numpy as np


# Load data
df = pd.read_csv('0311LalaStand5Min1.csv', low_memory=False)
columns = ['Fx','Fy','Fz','Mx','My','Mz']
selected_df = df[columns]
FPDatas = selected_df[:6000]
FPData = np.array(FPDatas).astype('float64')

# Apply wavelet decomposition
wavelet = 'db4'
SIDWTcoeffs = []
for i in range(6):
    coeffs = pywt.wavedec(FPData[:, i], wavelet)
    coeffs[-1] = np.zeros_like(coeffs[-1])
    coeffs[-2] = np.zeros_like(coeffs[-2])
    coeffs[-3] = np.zeros_like(coeffs[-3])
    coeffs[-4] = np.zeros_like(coeffs[-4])
    coeffs[-5] = np.zeros_like(coeffs[-5])
    SIDWTcoeffs.append(coeffs)

# Apply wavelet reconstruction to get filtered signal
SIData_filtered = np.zeros(FPData.shape)
for i in range(6):
    SIData_filtered[:, i] = pywt.waverec(SIDWTcoeffs[i], wavelet, mode='symmetric', axis=0)

# Apply inverse wavelet transform to get restored signal
restored = np.zeros(SIData_filtered.shape)
for i in range(6):
    restored[:, i] = pywt.waverec(SIDWTcoeffs[i], wavelet, mode='symmetric', axis=0)

I've try to restored back the data but its not working, the restored data will be math with smoothed data

the results of original data and smoothed data: enter image description here

the result of restored back smoothed data to original data enter image description here

you can downlod the 0311LalaStand5Min1.csv here : https://drive.google.com/file/d/1hV0kWe_C0XUZWY-M6hh8UC8RtO9Q521b/view?usp=sharing

0

There are 0 best solutions below