Documentation |
Octave filter specification
d = fdesign.octave(l)
d = fdesign.octave(l, MASK)
d = fdesign.octave(l, MASK, spec)
d = fdesign.octave(...,
Fs)
d = fdesign.octave(l) constructs an octave filter specification object d, with l bands per octave. The default value for l is 1.
d = fdesign.octave(l, MASK) constructs an octave filter specification object d with l bands per octave and MASK specification for the FVTool. The available values for mask are:
'class 0'
'class 1'
'class 2'
d = fdesign.octave(l, MASK, spec) constructs an octave filter specification object d with l bands per octave, MASK specification for the FVTool, and the spec specification string. The specification strings available are:
'N, F0'
(not case sensitive), where:
N is the filter order
F0 is the center frequency. The center frequency is specified in normalized frequency units assuming a sampling frequency of 48 kHz, unless a sampling frequency in Hz is included in the specification: d = fdesign.octave(..., Fs). If you specify an invalid center frequency, a warning is issued and the center frequency is rounded to the nearest valid value. You can determine the valid center frequencies for your design by using validfrequencies with your octave filter specification object. For example:
d = fdesign.octave(1,'Class 1','N,F0',6,1000,44.1e3); validcenterfreq = validfrequencies(d);
Valid center frequencies:
Must be greater than 20 Hz and less than 20 kHz if you specify a sampling frequency. The range 20 Hz to 20 kHz is the standard range of human hearing.
Are calculated according to the following algorithm if the number of bands per octave, L, is even
G = 10^(3/10); x = -1000:1350; validcenterfreq = 1000*(G.^((2*x-59)/(2*L))); validcenterfreq = validcenterfreq(validcenterfreq>20 & validcenterfreq<2e4);
Only center frequencies greater than 20 and less than 20000 are retained. Choosing a center frequency greater than your Nyquist frequency (1/2 the sampling rate) results in an error when you design the filter. If you do not specify a sampling frequency, the remaining center frequencies are divided by 24000 to obtain valid normalized center frequencies. For fdesign.octave, normalized frequency assumes a sampling frequency of 48 kHz.
validcenterfreq = validcenterfreq/24000;
Are calculated according to the following algorithm if the number of bands per octave, L, is odd
G = 10^(3/10); x = -1000:1350; validcenterfreq = 1000*(G.^((x-30)/L)); validcenterfreq = validcenterfreq(validcenterfreq>20 & validcenterfreq<2e4);
Only center frequencies greater than 20 and less than 20000 are retained. Choosing a center frequency greater than your Nyquist frequency (1/2 the sampling rate) results in an error when you design the filter. If you do not specify a sampling frequency, the remaining center frequencies are divided by 24000 to obtain valid normalized center frequencies. For fdesign.octave, normalized frequency assumes a sampling frequency of 48 kHz.
validcenterfreq = validcenterfreq/24000;
Design an sixth order, octave-band class 0 filter with a center frequency of 1000 Hz and, a sampling frequency of 44.1 kHz.
d = fdesign.octave(1,'Class 0','N,F0',6,1000,44100); Hd = design(d); fvtool(Hd)
The following figure shows the magnitude response plot of the filter. The logarithmic scale for frequency is automatically set by FVTool for the octave filters.