This function returns a fir filter with an order and cut-off specified.
Also can be configured the types of filter as: low pass, high pass, band pass
and band stop. The filter also can be weighted by a window. Finally exist
a parameter that indicates if should be plotted the time and frequency
impulse response.
After starting the main routine just type the following command at the
prompt:
% By default it is low-pass, hamming window and not display the impulse response.
h=get_fir_filter(ORDER,Wn);
[h FTYPE]=get_fir_filter(ORDER,Wn);
% By default it uses hamming window and not display the impulse response.
h=get_fir_filter(ORDER,Wn,CTYPE);
[h FTYPE]=get_fir_filter(ORDER,Wn,CTYPE);
% By default it don't display the impulse response.
h=get_fir_filter(ORDER,Wn,CTYPE,WINDOW);
[h FTYPE]=get_fir_filter(ORDER,Wn,CTYPE,WINDOW);
% All parameters are configured.
h=get_fir_filter(ORDER,Wn,CTYPE,WINDOW,GRAPHON);
[h FTYPE]=get_fir_filter(ORDER,Wn,CTYPE,WINDOW,GRAPHON);
%% Low pass filter of order ORDER=20, cut-off at frequency to a*Fs/2, Hanning
%% windows
h=get_fir_filter(20,a,'low');
%% High pass filter of order ORDER=20, cut-off at frequency a*Fs/2, Hanning
%% windows
h=get_fir_filter(20,a,'high');
%% Band pass filter of order ORDER=40, cut-off at frequencies at
%% [a1*Fs/2 a2*Fs/2], Hanning windows
h=get_fir_filter(40,[a1 a2],'bandpass');
%% Reject pass filter of order ORDER=40, cut-off at frequencies at [a1*Fs/2 a2*Fs/2],
%% Hanning windows
h=get_fir_filter(40,[a1 a2],'stop');
Input:
ORDER is the a variable that content the order of filter, the length of
filter will be equal to ORDER+1.
Wn is a scalar variable or vector(1x2) that content the cut-off
frequencies.
CTYPE [optional] it is the cut-off type of the fir filter, it can be ser
'low', 'high', 'bandpass' or 'stop'. By default this value is 'low'.
WINDOW [optional] it is a vector that represent the weighted values of the
the filter.
GRAPHON [optional] enable or disable the display of the frequency
impulse response.
Output:
h it is a vector of length ORDER+1 that represent a fir filter of
order ORDER.
FTYPE [optional] returns the type of the fir filter.
http://www.mathworks.com/help/signal/ug/fir-filter-design.html
For help, bug reports and feature suggestions, please visit:
http://www.nongnu.org/bsltl
Package: bsltl