-
Notifications
You must be signed in to change notification settings - Fork 1
/
leastSquare_6.m
30 lines (24 loc) · 871 Bytes
/
leastSquare_6.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
function Hd = leastSquare_6(input)
%LEASTSQUARE_6 Returns a discrete-time filter object.
%
% MATLAB Code
% Generated by MATLAB(R) 7.12 and the Signal Processing Toolbox 6.15.
%
% Generated on: 26-Jan-2016 07:40:09
%
% FIR least-squares Bandpass filter designed using the FIRLS function.
% All frequency values are in Hz.
Fs = input; % Sampling Frequency
N = 50; % Order
Fstop1 = 2980; % First Stopband Frequency
Fpass1 = 3000; % First Passband Frequency
Fpass2 = 6000; % Second Passband Frequency
Fstop2 = 6020; % Second Stopband Frequency
Wstop1 = 1; % First Stopband Weight
Wpass = 1; % Passband Weight
Wstop2 = 1; % Second Stopband Weight
% Calculate the coefficients using the FIRLS function.
b = firls(N, [0 Fstop1 Fpass1 Fpass2 Fstop2 Fs/2]/(Fs/2), [0 0 1 1 0 ...
0], [Wstop1 Wpass Wstop2]);
Hd = dfilt.dffir(b);
% [EOF]