ButterworthBandstopFilter Class

Measurement Studio 2019 Help

Edition Date: May 2019

Part Number: 375857B-01

»View Product Info
Download Help (Windows Only)

Members Example See Also


Note: This topic applies to the following Measurement Studio editions: Enterprise, Professional.

Implements a Butterworth bandstop filter.

Namespace: NationalInstruments.Analysis.Dsp.Filters

Assembly: NationalInstruments.Analysis.Enterprise (in NationalInstruments.Analysis.Enterprise.dll) Version: 19.0.45.49153 (19.0.45.49153)

Syntax

Visual Basic (Declaration)
Public Class ButterworthBandstopFilter _
	Inherits IirFilterBase

C#
public class ButterworthBandstopFilter : IirFilterBase

Remarks

This filter is implemented with an IIR cascade filter. This IIR implementation is called cascade because it is a cascade of second- or fourth-order filter stages. The output of one filter stage is the input to the next filter stage for all filter stages.

Examples

The following example demonstrates how to generate a composite signal and then filter the signal using a Butterworth bandstop filter.
CopyVB.NET
Dim samples As Long = 1024
Dim waveformData() As Double
Dim filteredData() As Double
Dim samplingFrequency, lowerCutoffFrequency, upperCutoffFrequency As Double
Dim filterOrder As Integer
Dim sineSignal1 As New SineSignal(20.0, 3.0, 0.0)
Dim sineSignal2 As New SineSignal(60.0, 1.0, 20.0)
Dim sineSignal3 As New SineSignal(100.0, 1.0, 40.0)
Dim signalGen As New SignalGenerator(1000.0, samples)

' Generate composite signal
signalGen.Signals.Add(sineSignal1)
signalGen.Signals.Add(sineSignal2)
signalGen.Signals.Add(sineSignal3)

waveformData = signalGen.Generate

' Set filter parameters
filterOrder = 5
samplingFrequency = 1000.0
lowerCutoffFrequency = 20.0
upperCutoffFrequency = 150.0

' Extract 20 Hz sine signal by bandstop filtering 
Dim newFilter As New ButterworthBandstopFilter(filterOrder, samplingFrequency, lowerCutoffFrequency, upperCutoffFrequency)
filteredData = newFilter.FilterData(waveformData)
CopyC#
int samples = 1024;
double[] waveformData;
double[] filteredData;
double samplingFrequency, lowerCutoffFrequency, upperCutoffFrequency;
int filterOrder;
SineSignal sineSignal1 = new SineSignal(20.0, 3.0, 0.0);
SineSignal sineSignal2 = new SineSignal(60.0, 1.0, 20.0);
SineSignal sineSignal3 = new SineSignal(100.0, 1.0, 40.0);
SignalGenerator signalGen = new SignalGenerator(1000.0, samples);

// Generate composite signal
signalGen.Signals.Add(sineSignal1);
signalGen.Signals.Add(sineSignal2);
signalGen.Signals.Add(sineSignal3);

waveformData = signalGen.Generate();

// Set filter parameters
filterOrder = 5;
samplingFrequency = 1000.0;
lowerCutoffFrequency = 20.0;
upperCutoffFrequency = 150.0;

// Extract 20 Hz sine signal by bandstop filtering
ButterworthBandstopFilter newFilter = new ButterworthBandstopFilter(filterOrder, samplingFrequency, lowerCutoffFrequency, upperCutoffFrequency);
filteredData = newFilter.FilterData(waveformData);

Inheritance Hierarchy

System.Object
  System.MarshalByRefObject
    NationalInstruments.Analysis.Dsp.Filters.IirFilterBase
      NationalInstruments.Analysis.Dsp.Filters.ButterworthBandstopFilter

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

See Also

Reference

ButterworthBandstopFilter Members

NationalInstruments.Analysis.Dsp.Filters Namespace

WAS THIS ARTICLE HELPFUL?

Not Helpful