2.3. Spectral Filtering

Spectral filtering is an approach to select some frequency band and remove other frequency bands.

2.3.1. Lowpass filtering

2.3.2. Highpass filtering

2.3.3. Bandpass filtering

2.3.4. Bandreject/bandstop filtering

2.3.5. Custom filtering

import numpy as np
import matplotlib.pyplot as plt

import spkit as sp

#highpass
Xf = sp.filter_X(X,band =[0.5],btype='highpass',order=5,fs=128.0,ftype='filtfilt')

#bandpass
Xf = sp.filter_X(X,band =[1, 4],btype='bandpass',order=5,fs=128.0,ftype='filtfilt')

#lowpass
Xf = sp.filter_X(X,band =[40],btype='lowpass',order=5,fs=128.0,ftype='filtfilt')