MATLAB: Filtering problem, need help

MATLAB

Dear
I have a EMG signal of 30000×4. with sampling frequency of 10KHz.
I filter noise by below code
NotchFilter = bandstop(Data01Raw,[49.9 50.1],Fs);
sEmgFilter = bandpass(NotchFilter(:,1:2),[20 500],Fs);
iEmgFilter = bandpass(NotchFilter(:,3:4),[600 2000],Fs);
Data02Filtered = [sEmgFilter iEmgFilter];
Questions
in above code bandpass or bandstop occur by which filer like is it butterwork or cheby or ellip?
I need to fiter the signal using butterworth 2nd order. How can i do this?
Thank you

Best Answer

Request two outputs from the bandpass and bandstop functions. The second output is the digital filter object. Displaying the digital filter object in your Command Window will tell you everything you need to know about it.
For example —
Fs = 10E+3;
[NotchFilter, df] = bandstop(Data01Raw,[49.9 50.1],Fs);
then:
df
displays:
df =
digitalFilter with properties:
Coefficients: [8×6 double]
Specifications:
FrequencyResponse: 'bandstop'
ImpulseResponse: 'iir'
SampleRate: 10.0000e+003
StopbandAttenuation: 60.0000e+000
PassbandRipple2: 100.0000e-003
StopbandFrequency2: 50.0843e+000
PassbandRipple1: 100.0000e-003
PassbandFrequency2: 50.1000e+000
PassbandFrequency1: 49.9000e+000
StopbandFrequency1: 49.9157e+000
DesignMethod: 'ellip'
Use fvtool to visualize filter
Use designfilt to edit filter
Use filter to filter data
Related Question