FilterBuilder is not more flexible than FDATool?

8 views (last 30 days)
Li Zhang
Li Zhang on 24 Mar 2016
Edited: Li Zhang on 24 Mar 2016
Dear MATLABer,
I recently design a FIR filter using FDATool. the filter's parameters are followed:
  • Fs: 50MHz
  • Fc(-6dB attenuation): 10MHz
  • Order: 108
  • Window: Kaiser window with beta = 2.5.
The settings of FDATool are followed
Then I get the right filter.
However, when I want to design the same filter by FilterBuilder , the GUI doesn't show the dialog box of Kaiser window's parameter: beta.
After finishing the design, I found that the coefficients of this method is different from which generated by FDATool.
Afterwards, I export the MATLAB code via FDATool and FilterBuilder , finding that the generated codes are very different. The FilterBuilder uses fdesign & design functions. But the FDATool uses fir1 function. The MATLAB codes generated by FilterBuilder are followed.
% code
N = 108; % Order
F6dB = 10000000; % 6-dB Frequency
Fs = 50000000; % Sampling Frequency
h = fdesign.lowpass('n,fc', N, F6dB, Fs);
Hd = design(h, 'window', ... %
'Window', 'kaiser');
The MATLAB codes generated by FDATool are followed
% code
Fs = 50; % Sampling Frequency
N = 108; % Order
Fc = 10; % Cutoff Frequency
flag = 'scale'; % Sampling Flag
Beta = 2.5; % Window Parameter
% Create the window vector for the design algorithm.
win = kaiser(N+1, Beta);
% Calculate the coefficients using the FIR1 function.
b = fir1(N, Fc/(Fs/2), 'low', win, flag);
Hd = dfilt.dffir(b);
Finally I found a similar question in website:
The MathWorks Support Team have answered this question as below: FDESIGN uses the FIRGR function while FDATool uses the FIRPM function.
FIRGR and FIRPM both design equiripple filters but they use different implementations of the Parks-McClellan algorithm. Thus, they may return different answers.
In order to design filters graphically and ensure that the results are consistent with FDESIGN, use the FilterBuilder GUI instead of FDATool.
However, the settings of FilterBuilder is not flexible to design filter such as the example above. Does this mean I can only use FDATool to design a filter with specified beta of kaiser window?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!