Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

dsp.VariableBandwidthFIRFilter System object

Variable bandwidth FIR filter

Description

The VariableBandwidthFIRFilter object filters each channel of the input using FIR filter implementations. It does so while having the capability of tuning the bandwidth. This filter supports double and single precision inputs.

To filter each channel of the input:

  1. Define and set up your variable bandwidth FIR filter. See Construction.

  2. Call step to filter each channel of the input according to the properties of dsp.VariableBandwidthFIRFilter. The behavior of step is specific to each object in the toolbox.

Note

Starting in R2016b, instead of using the step method to perform the operation defined by the System object™, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.

Construction

vbw = dsp.VariableBandwidthFIRFilter returns a System object, vbw, which independently filters each channel of the input over successive calls to the step method. This System object uses a specified FIR filter implementation. The filter’s cutoff frequency may be tuned during the filtering operation. The variable bandwidth FIR filter is designed using the window method.

vbw = dsp.VariableBandwidthFIRFilter('PropertyName',PropertyValue, ...) returns a variable bandwidth FIR filter System object, vbw, with each property set to the specified value. You can specify additional name-value pair arguments in any order as (Name1,Value1,...,NameN,ValueN).

Properties

SampleRate

Input sample rate

Specify the sampling rate of the input in Hertz as a finite numeric scalar. The default is 44.1 kHz. This property is non-tunable.

FilterType

Filter type

Specify the type of the filter as one of 'Lowpass' | 'Highpass' | 'Bandpass' | 'Bandstop'. The default is 'Lowpass'. This property is non-tunable.

FilterOrder

FIR filter order

Specify the order of the FIR filter as a positive integer scalar. The default is 30. This property is non-tunable.

Window

Window function

Specify the window function used to design the FIR filter as one of 'Hann' | 'Hamming' | 'Chebyshev' | 'Kaiser'. The default is 'Hann'. This property is non-tunable.

KaiserWindowParameter

Kaiser window parameter

Specify the Kaiser window parameter as a real scalar. This property applies when you set the window property to 'Kaiser'. The default is 0.5. This property is non-tunable.

CutoffFrequency

Filter cutoff frequency

Specify the filter cutoff frequency in Hz as a real, positive scalar, smaller than the SampleRate/2. This property applies if you set the FilterType property to 'Lowpass' or 'Highpass'. The default is 512 Hz. This property is tunable.

CenterFrequency

Filter center frequency

Specify the filter center frequency in Hz as a real, positive scalar, smaller than SampleRate/2. This property applies when you set the FilterType property to 'Bandpass' or 'Bandstop'. The default is 11025 Hz. This property is tunable.

Bandwidth

Filter bandwidth

Specify the filter bandwidth in Hertz as a real, positive scalar, smaller than SampleRate/2. This property applies if you set the FilterType property to 'Bandpass' or 'Bandstop'. The default is 7680 Hz. This property is tunable.

SidelobeAttenuation

Chebyshev window sidelobe attenuation

Specify the Chebyshev window attenuation as a real, positive scalar in decibels (dB). This property applies if you set the Window property to 'Chebyshev'. The default is 60 dB. This property is non-tunable.

Methods

resetReset internal states of variable bandwidth FIR filter
stepFilter signal using variable bandwidth algorithm

More Analysis Methods for Filter System Objects.

Common to All System Objects
clone

Create System object with same property values

getNumInputs

Expected number of inputs to a System object

getNumOutputs

Expected number of outputs of a System object

isLocked

Check locked states of a System object (logical)

release

Allow System object property value changes

Examples

expand all

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

This example shows you how to tune the center frequency and the bandwidth of the FIR filter.

Fs = 44100; % Input sample rate
% Define a bandpass variable bandwidth FIR filter:
vbw = dsp.VariableBandwidthFIRFilter('FilterType','Bandpass',...
    'FilterOrder',100,...
    'SampleRate',Fs,...
    'CenterFrequency',1e4,...
    'Bandwidth',4e3);
tfe = dsp.TransferFunctionEstimator('FrequencyRange','onesided');
aplot = dsp.ArrayPlot('PlotType','Line',...
    'XOffset',0,...
    'YLimits',[-120 5], ...
    'SampleIncrement', 44100/1024,...
    'YLabel','Frequency Response (dB)',...
    'XLabel','Frequency (Hz)',...
    'Title','System Transfer Function');
FrameLength = 1024;
sine = dsp.SineWave('SamplesPerFrame',FrameLength);
for i=1:500
    % Generate input
    x = sine() + randn(FrameLength,1);
    % Pass input through the filter
    y = vbw(x);
    % Transfer function estimation
    h = tfe(x,y);
    % Plot transfer function
    aplot(20*log10(abs(h)))
    % Tune bandwidth and center frequency of the FIR filter
    if (i==250)
        vbw.CenterFrequency = 5000;
        vbw.Bandwidth = 2000;
    end
end

Algorithms

expand all

References

[1] Jarske, P.,Y. Neuvo, and S. K. Mitra, "A simple approach to the design of linear phase FIR digital filters with variable characteristics." Signal Processing. Vol. 14, Issue 4, June 1988, pp. 313-326.

Extended Capabilities

Introduced in R2014a

Was this topic helpful?