SignalProcessing - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Signal Processing : Filtering : SignalProcessing/GenerateFiniteImpulseResponseFilterTaps

SignalProcessing

 GenerateFiniteImpulseResponseFilterTaps
 generate a taps array for a finite impulse response filter

 Calling Sequence GenerateFiniteImpulseResponseFilterTaps( n, freq )

Parameters

 n - posint, the size of the resulting taps Array freq - realcons or [realcons,realcons]}, the frequency for a low-pass or high-pass filter, or a pair [lowfreq, highfreq] of frequencies for a band-pass or band-stop filter. Frequencies f must satisfy 0 < f and f < 1/2.

Options

 • filtertype : string or name, the type of filter
 • window : string or name, the window type
 • normalize : truefalse, whether to normalize
 • container : Array, predefined Array for holding the result

Description

 • The GenerateFiniteImpulseResponseFilterTaps( n, freq ) command generates a taps array for a finite impulse response filter.  The resulting array may be used with the command FiniteImpulseResponseFilter to effect filtering operations on a sample.
 • For a low-pass or high-pass filter, a single frequency freq is required. It must be strictly positive and less than $\frac{1}{2}$.
 • For a band-pass or band-stop filter, a pair [lowfreq, highfreq] of low and high frequencies are required.  Each frequency must be positive and less than $\frac{1}{2}$; they must additionally satisfy $\mathrm{lowfreq}<\mathrm{highfreq}$.
 • Specify the type of filter with the filtertype option.  It can take any of the values "lowpass", "highpass", "bandpass" and "bandstop". The option values can be given as a name or as a string.
 • The type of window to use is indicated by the window option.  It can take any of the following values: "Bartlett", "Blackman", "Hamming" and "Hann". The option values can be given as a name or as a string.
 • The normalize option specifies whether to normalize the filter coefficients produced, and can be either of the values true or false.  The default is normalize = true.
 • If the container=C option is provided, then the results are put into C and C is returned. With this option, no additional memory is allocated to store the result. The container must be an Array of size $n$ having datatype float[8].

 • The SignalProcessing[GenerateFiniteImpulseResponseFilterTaps] command is thread-safe as of Maple 17.

Examples

 > $\mathrm{with}\left(\mathrm{SignalProcessing}\right):$
 > $\mathrm{GenerateFiniteImpulseResponseFilterTaps}\left(8,\frac{1}{3}\right)$
 $\left[\begin{array}{cccccccc}{0.}& {-}{0.0357142857250822}& {4.31857549578176}{}{{10}}^{{-11}}& {0.535714285681896}& {0.535714285681896}& {4.31857549578176}{}{{10}}^{{-11}}& {-}{0.0357142857250822}& {0.}\end{array}\right]$ (1)
 > $\mathrm{GenerateFiniteImpulseResponseFilterTaps}\left(8,\frac{1}{3},':-\mathrm{normalize}'=\mathrm{true}\right)$
 $\left[\begin{array}{cccccccc}{0.}& {-}{0.0357142857250822}& {4.31857549578176}{}{{10}}^{{-11}}& {0.535714285681896}& {0.535714285681896}& {4.31857549578176}{}{{10}}^{{-11}}& {-}{0.0357142857250822}& {0.}\end{array}\right]$ (2)
 > $C≔\mathrm{Array}\left(1..8,'\mathrm{datatype}'={'\mathrm{float}'}_{8},'\mathrm{order}'='\mathrm{C_order}'\right):$
 > $\mathrm{GenerateFiniteImpulseResponseFilterTaps}\left(8,\frac{1}{3},':-\mathrm{container}'=C\right)$
 $\left[\begin{array}{cccccccc}{0.}& {-}{0.0357142857250822}& {4.31857549578176}{}{{10}}^{{-11}}& {0.535714285681896}& {0.535714285681896}& {4.31857549578176}{}{{10}}^{{-11}}& {-}{0.0357142857250822}& {0.}\end{array}\right]$ (3)
 > $C$
 $\left[\begin{array}{cccccccc}{0.}& {-}{0.0357142857250822}& {4.31857549578176}{}{{10}}^{{-11}}& {0.535714285681896}& {0.535714285681896}& {4.31857549578176}{}{{10}}^{{-11}}& {-}{0.0357142857250822}& {0.}\end{array}\right]$ (4)
 > $\mathrm{GenerateFiniteImpulseResponseFilterTaps}\left(8,\frac{1}{3},':-\mathrm{filtertype}'="highpass"\right)$
 $\left[\begin{array}{cccccccc}{0.}& {0.0220588235076414}& {-}{0.147058823517644}& {0.330882352974715}& {-}{0.330882352974715}& {0.147058823517644}& {-}{0.0220588235076414}& {-}{0.}\end{array}\right]$ (5)
 > $\mathrm{GenerateFiniteImpulseResponseFilterTaps}\left(8,\left[0.2,0.4\right],':-\mathrm{filtertype}'="bandstop",':-\mathrm{window}'="Hann"\right)$
 $\left[\begin{array}{cccccccc}{-}{0.}& {0.0250125469199284}& {0.0729369300004544}& {0.402050523079617}& {0.402050523079617}& {0.0729369300004544}& {0.0250125469199284}& {-}{0.}\end{array}\right]$ (6)
 > 

Compatibility

 • The SignalProcessing[GenerateFiniteImpulseResponseFilterTaps] command was introduced in Maple 17.