| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Filter Design Toolbox |
| Contents | Index |
| Learn more about Filter Design Toolbox |
reorder(hd,order)
reorder(hd,numorder,denorder)
reorder(hd,numorder,denorder,svorder)
reorder(hd,filter_type)
reorder(hd,dir_flag)
reorder(hd,dir_flag,sv)
reorder(hd,order) rearranges the sections of filter hd using the vector of indices provided in order.
order does not need to contain all of the indices of the filter. Omitting one or more filter section indices removes the omitted sections from the filter. You can use a logical array to remove sections from the filter, but not to reorder it (refer to the Examples to see this done).
reorder(hd,numorder,denorder) reorders the numerator and denominator separately using the vectors of indices in numorder and denorder. These two vectors must be the same length.
reorder(hd,numorder,denorder,svorder) the scale values can be independently reordered. When svorder is not specified, the scale values are reordered with the numerator. The output scale value always remains on the end when you use the argument numorder to reorder the scale values.
reorder(hd,filter_type) where filter_type is one of auto, lowpass, highpass, bandpass, or bandstop, reorders hd in a way suitable for the filter type you specify by filter_type. This reordering mode can be especially helpful for fixed-point implementations where the order of the filter sections can significantly affect your filter performance.
The auto option and automatic ordering only apply to filters that you used fdesign to create. With the auto option as an input argument, reorder automatically rearranges the filter sections depending on the specification response type of the design, such as lowpass, or bandstop. This technique appears in the first example.
reorder(hd,dir_flag) if dir_flag is up, the first filter section contains the poles closest to the origin, and the last section contains the poles closest to the unit circle. When dir_flag is down, the sections are ordered in the opposite direction. reorder always pairs zeros with the poles closest to them.
reorder(hd,dir_flag,sv) sv is either the string poles or zeros and describes how to reorder the scale values. By default the scale values are not reordered when you use the dir_flag option.
Being able to rearrange the order of the sections in a filter can be a powerful tool for controlling the filter process. This example uses reorder to change the sections of a df2sos filter. Let reorder do the reordering automatically in the first example. In the second, use reorder to specify the new order for the sections.
First use the automatic reordering option on a lowpass filter.
d = fdesign.lowpass('n,f3db',15,0.75)
hd = design(d,'butter');
d =
Response: 'Lowpass'
Specification: 'N,F3dB'
Description: {'Filter Order';'3dB Frequency'}
NormalizedFrequency: true
FilterOrder: 15
F3dB: 0.75
hdreorder=reorder(hd,'auto');
The SOS matrices show the reordering.
hd.sosMatrix ans = 1.0000 2.0000 1.0000 1.0000 1.3169 0.8623 1.0000 2.0000 1.0000 1.0000 1.1606 0.6414 1.0000 2.0000 1.0000 1.0000 1.0448 0.4776 1.0000 2.0000 1.0000 1.0000 0.9600 0.3576 1.0000 2.0000 1.0000 1.0000 0.8996 0.2722 1.0000 2.0000 1.0000 1.0000 0.8592 0.2151 1.0000 2.0000 1.0000 1.0000 0.8360 0.1823 1.0000 1.0000 0 1.0000 0.4142 0 hdreorder.sosMatrix ans = 1.0000 2.0000 1.0000 1.0000 1.0448 0.4776 1.0000 2.0000 1.0000 1.0000 0.8360 0.1823 1.0000 2.0000 1.0000 1.0000 0.8996 0.2722 1.0000 2.0000 1.0000 1.0000 1.3169 0.8623 1.0000 2.0000 1.0000 1.0000 0.9600 0.3576 1.0000 1.0000 0 1.0000 0.4142 0 1.0000 2.0000 1.0000 1.0000 0.8592 0.2151 1.0000 2.0000 1.0000 1.0000 1.1606 0.6414
For another example of using reorder, create an SOS filter in the direct form II implementation.
[z,p,k] = butter(15,.5); [sos, g] = zp2sos(z,p,k); hd = dfilt.df2sos(sos,g);
Reorder the sections by moving the second section to be between the seventh and eighth sections.
reorder(hd, [1 3:7 2 8]);
hfvt = fvtool(hd, 'analysis', 'coefficients');Remove the third, fourth and seventh sections.
hd1 = copy(hd);
reorder(hd1, logical([1 1 0 0 1 1 0 1]));
setfilter(hfvt, hd1);Move the first filter to the end and remove the eighth section
hd2 = copy(hd);
reorder(hd2, [2:7 1]);
setfilter(hfvt, hd2);Move the numerator and denominator independently.
hd3 = copy(hd);
reorder(hd3, [1 3:8 2], [1:8]);
setfilter(hfvt, hd3);Schlichthärle, Dietrich, Digital Filters Basics and Design, Springer-Verlag Berlin Heidelberg, 2000.
![]() | reffilter | reset | ![]() |

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |