-
Notifications
You must be signed in to change notification settings - Fork 102
/
hp_gyro.m
60 lines (50 loc) · 2.47 KB
/
hp_gyro.m
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
function y = hp_gyro(x)
%HP_GYRO Filters input x and returns output y.
% MATLAB Code
% Generated by MATLAB(R) 8.1 and the DSP System Toolbox 8.4.
% Generated on: 15-Sep-2013 15:50:01
%#codegen
% To generate C/C++ code from this function use the codegen command. Type
% 'help codegen' for more information.
%persistent Hd;
i%f isempty(Hd)
% The following code was used to design the filter coefficients:
% % Equiripple Highpass filter designed using the FIRPM function.
%
% % All frequency values are in Hz.
% Fs = 200; % Sampling Frequency
%
% Fstop = 10; % Stopband Frequency
% Fpass = 20; % Passband Frequency
% Dstop = 0.0001; % Stopband Attenuation
% Dpass = 0.057501127785; % Passband Ripple
% dens = 20; % Density Factor
%
% % Calculate the order from the parameters using FIRPMORD.
% [N, Fo, Ao, W] = firpmord([Fstop, Fpass]/(Fs/2), [0 1], [Dstop, Dpass]);
%
% % Calculate the coefficients using the FIRPM function.
% b = firpm(N, Fo, Ao, W, {dens});
Hd = dsp.FIRFilter( ...
'Numerator', [0.00802538563756069 -0.00700504260247068 ...
-0.00500693042307002 -0.00322326010827604 -0.00103661761898599 ...
0.00163230476609599 0.00436470799007312 0.00638710847820604 ...
0.00678743014795974 0.00499312745824607 0.000971027349416568 ...
-0.00451599141745037 -0.0100253547964877 -0.0137167772460604 ...
-0.0138645474835538 -0.00945106379660054 -0.000635879572660821 ...
0.0109841782522203 0.0225254139639384 0.0303134349860317 ...
0.0307020740160157 0.0209981218277677 0.000270584563376905 ...
-0.0301651952484101 -0.0667705530893517 -0.104316724965379 ...
-0.136865475306441 -0.15896380814867 0.833212732832953 -0.15896380814867 ...
-0.136865475306441 -0.104316724965379 -0.0667705530893517 ...
-0.0301651952484101 0.000270584563376905 0.0209981218277677 ...
0.0307020740160157 0.0303134349860317 0.0225254139639384 ...
0.0109841782522203 -0.000635879572660821 -0.00945106379660054 ...
-0.0138645474835538 -0.0137167772460604 -0.0100253547964877 ...
-0.00451599141745037 0.000971027349416568 0.00499312745824607 ...
0.00678743014795974 0.00638710847820604 0.00436470799007312 ...
0.00163230476609599 -0.00103661761898599 -0.00322326010827604 ...
-0.00500693042307002 -0.00700504260247068 0.00802538563756069]);
%end
y = step(Hd,x);
% [EOF]