-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhd2.m
More file actions
30 lines (23 loc) · 1.03 KB
/
hd2.m
File metadata and controls
30 lines (23 loc) · 1.03 KB
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
function Hd = hd2
%HD2 Returns a discrete-time filter object.
% MATLAB Code
% Generated by MATLAB(R) 8.3 and the DSP System Toolbox 8.6.
% Generated on: 25-May-2016 01:41:35
% Equiripple Bandpass filter designed using the FIRPM function.
% All frequency values are in Hz.
Fs = 1000; % Sampling Frequency
Fstop1 = 7.5; % First Stopband Frequency
Fpass1 = 8; % First Passband Frequency
Fpass2 = 12.5; % Second Passband Frequency
Fstop2 = 13; % Second Stopband Frequency
Dstop1 = 0.001; % First Stopband Attenuation
Dpass = 0.057501127785; % Passband Ripple
Dstop2 = 0.0001; % Second Stopband Attenuation
dens = 20; % Density Factor
% Calculate the order from the parameters using FIRPMORD.
[N, Fo, Ao, W] = firpmord([Fstop1 Fpass1 Fpass2 Fstop2]/(Fs/2), [0 1 ...
0], [Dstop1 Dpass Dstop2]);
% Calculate the coefficients using the FIRPM function.
b = firpm(N, Fo, Ao, W, {dens});
Hd = dsp.FIRFilter('Numerator', b);
% [EOF]