| Filter Design Toolbox™ | ![]() |
h = window(d,fcnhndl,fcnarg)
h = window(d,win)
h = window(d,fcnhndl,fcnarg) designs an FIR filter using the specifications in filter specification object d. Depending on the specification type of d, the returned filter is either a single-rate digital filter — a dfilt, or a multirate digital filter — an mfilt.
fcnhndl is a handle to a filter design function that returns a window vector, such as the hamming or blackman functions. fcnarg is an optional argument that returns a window. You pass the function to window. Refer to example 1 in the following section to see the function argument used to design the filter.
h = window(d,win) designs a filter using the vector you supply in win. The length of vector win must be the same as the impulse response of the filter, which is equal to the filter order plus one. Example 2 shows this being done.
These examples design filters using the two design techniques of specifying a function handle or passing a window vector as an input argument.
Use a function handle and optional input arguments to design a multirate filter. We use a function handle to the function Kaiser to provide the window. Since this example creates a decimating filter specifications object, window returns a multirate filter.
d = fdesign.decim(4,'pl',14); hm = window(d,@kaiser,2.5); fvtool(hm)

Use a window vector provided by the hamming window design function. For this example, the design object is a Nyquist filter, thus window returns hd as a discrete-time filter.
d = fdesign.nyquist(5,'n',150); hd = window(d,hamming(151)); fvtool(hd)

![]() | validstructures | zerophase | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |