Documentation |
IIR comb filter specification object
d=fdesign.comb
d=fdesign.comb(combtype)
d=fdesign(combtype,specstring)
d=fdesign(combtype,specstring,specvalue1,specvalue2,...)
d=fdesign.comb(...,Fs)
fdesign.comb specifies a peaking or notching comb filter. Comb filters amplify or attenuate a set of harmonically related frequencies.
d=fdesign.comb creates a notching comb filter specification object and applies default values for the filter order (N=10) and quality factor (Q=16).
d=fdesign.comb(combtype) creates a comb filter specification object of the specified type and applies default values for the filter order and quality factor. The valid entries for combtype are shown in the following table. The entries are not case-sensitive.
Argument | Description |
---|---|
notch | creates a comb filter that attenuates a set of harmonically related frequencies. |
peak | creates a comb filter that amplifies a set of harmonically related frequencies. |
d=fdesign(combtype,specstring) creates a comb filter specification object of type combtype and sets its Specification property to specstring with default values. The entries in specstring determine the number of peaks or notches in the comb filter as well as their bandwidth and slope. Valid entries for specstring are shown below. The entries are not case-sensitive.
'N,Q' (default)
''N,BW'
'L,BW,GWB,Nsh'
The following table describes the arguments in specstring.
Argument | Description |
---|---|
BW | Bandwidth of the notch or peak. By default the bandwidth is calculated at the point –3 dB down from the center frequency of the peak or notch. For example, setting BW=0.01 specifies that the –3 dB point will be +/- 0.005 (in normalized frequency) from the center of the notch or peak. |
GWB | Gain at which the bandwidth is measured. This allows the user to specify the bandwidth of the notch or peak at a gain different from the –3 dB default. |
L | Upsampling factor for a shelving filter of order Nsh. L determines the number of peaks or notches, which are equally spaced over the normalized frequency interval [-1,1]. |
N | Filter order. Specifies a filter with N+1 numerator and denominator coefficients. The filter will have N peaks or notches equally spaced over the interval [–1,1] . |
Nsh | Shelving filter order. Nsh represents a positive integer that determines the sharpness of the peaks or notches. The greater the value of the shelving filter order, the steeper the slope of the peak or notch. This results in a filter of order L*Nsh. |
Q | Peak or notch quality factor. Q represents the ratio of the lowest center frequency peak or notch (not including DC) to the bandwidth calculated at the –3 dB point. |
d=fdesign(combtype,specstring,specvalue1,specvalue2,...) creates an IIR comb filter specification object of type combtype and sets its Specification property to the values in specvalue1,specvalue2,...
d=fdesign.comb(...,Fs) creates an IIR comb filter specification object using the sampling frequency, Fs, of the signal to be filtered. The function assumes that Fs is in Hertz and must be specified as a scalar trailing all other provided values.
These examples demonstrate how to create IIR comb filter specification objects. First, create a default specification object.
d=fdesign.comb;
In the next example, create a notching filter of order 8 with a bandwidth of 0.02 (normalized frequency) referenced to the –3 dB point.
d = fdesign.comb('notch','N,BW',8,0.02); Hd = design(d); fvtool(Hd)
Next, create a peaking comb filter with 5 peaks and a quality factor of 25.
d = fdesign.comb('peak','N,Q',5,25); Hd = design(d); fvtool(Hd)
In the next example, create a notching filter to remove interference at 60 Hz and its harmonics. The following code creates a filter with 10 notches and a notch bandwidth of 5 Hz referenced to the -4dB level. The filter has a shelving filter order of 4 and a sampling frequency of 600 Hz. Because the notches are equidistantly spaced in the interval [-300, 300] Hz, they occur at multiples of 60 Hz.
d = fdesign.comb('notch','L,BW,GBW,Nsh',10,5,-4,4,600); Hd=design(d); fvtool(Hd)