-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFilter_LowPass.m
More file actions
28 lines (23 loc) · 834 Bytes
/
Filter_LowPass.m
File metadata and controls
28 lines (23 loc) · 834 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
function result = Filter_LowPass(x,low1,low2,fs)
%EMG_IIR_LP10_20 Returns a discrete-time filter object.
%
% MATLAB Code
% Generated by MATLAB(R) 8.0 and the Signal Processing Toolbox 6.18.
%
% Generated on: 06-Nov-2014 16:12:09
%
% Butterworth Lowpass filter designed using FDESIGN.LOWPASS.
% All frequency values are in Hz.
Fs = fs; % Sampling Frequency
Fpass = low1; % Passband Frequency
Fstop = low2; % Stopband Frequency
Apass = 1; % Passband Ripple (dB)
Astop = 60; % Stopband Attenuation (dB)
match = 'stopband'; % Band to match exactly
% Construct an FDESIGN object and call its BUTTER method.
h = fdesign.lowpass(Fpass, Fstop, Apass, Astop, Fs);
Hd = design(h, 'butter', 'MatchExactly', match);
SOS = Hd.sosMatrix;
G = Hd.ScaleValues;
result = filtfilt(SOS,G,x);
% [EOF]