-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdoFilter.m
More file actions
30 lines (18 loc) · 707 Bytes
/
doFilter.m
File metadata and controls
30 lines (18 loc) · 707 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
29
function y = doFilter(x)
%DOFILTER Filters input x and returns output y using a lowpass filter.
% MATLAB Code
% Generated by MATLAB(R) 9.3 and DSP System Toolbox 9.5.
% Generated on: 21-May-2018 11:12:40
persistent Hd;
if isempty(Hd)
Fpass = 0.0104; %Normalized(0-1) Passband Frequency
Fstop = 0.0167; %Noralized(0-1) Stopband Frequency
Apass = 1; % Passband Ripple (dB)
Astop = 60; % Stopband Attenuation (dB)
h = fdesign.lowpass('fp,fst,ap,ast', Fpass, Fstop, Apass, Astop);
Hd = design(h, 'equiripple', ...
'MinOrder', 'any', ...
'StopbandShape', 'flat');
set(Hd,'PersistentMemory',true);
end
y = filter(Hd,x);