feat: add func for filtering wavelet soft using pywt
This commit is contained in:
parent
360a0a28a3
commit
6a490cad6c
@ -4,7 +4,7 @@ from pandas.core.frame import DataFrame
|
|||||||
from scipy.fft import fft, fftfreq
|
from scipy.fft import fft, fftfreq
|
||||||
import pywt
|
import pywt
|
||||||
from scipy.signal import wavelets
|
from scipy.signal import wavelets
|
||||||
from pyyawt import theselect
|
import pyyawt
|
||||||
|
|
||||||
import Handle_emg_data as Handler
|
import Handle_emg_data as Handler
|
||||||
|
|
||||||
@ -129,9 +129,13 @@ def denoise_signal_pywt(df:DataFrame):
|
|||||||
print(x)
|
print(x)
|
||||||
return x, cA, cD
|
return x, cA, cD
|
||||||
|
|
||||||
#
|
# Filters signal accordning to Stein's Unbiased Risk Estimate(SURE)
|
||||||
def threshold_filter(cA, cD):
|
def sure_threshold_filter(cA, cD):
|
||||||
cA_filtered = theselect(cA, 'rigrsure')
|
cA_filtered = pyyawt.theselect(cA, 'rigrsure')
|
||||||
|
return cA_filtered, cD
|
||||||
|
|
||||||
|
def soft_threshold_filter(cA, cD):
|
||||||
|
cA_filtered = pywt.threshold(cA, 0.9)
|
||||||
return cA_filtered, cD
|
return cA_filtered, cD
|
||||||
|
|
||||||
# Plots DataFrame objects
|
# Plots DataFrame objects
|
||||||
|
Loading…
Reference in New Issue
Block a user