07-05-2007 04:24 PM
07-06-2007 08:26 AM
Hi Steve,
We don't have any shipping examples that use that specific function. However, we do have one example entitled Filtering and another called Windowing that show how to use similar methods. Find them in the <MeasurementStudioVS2005>\dotNET\Examples\Analysis folder.
You may or may not already know this, but the NationalInstruments.Analysis.Dsp.Filters namepsace includes many classes of filters including the WindowedFirLowPassFilter class. Here is a just a brief code snippet that shows the basics (Note. The numbers I used were just randomly picked numbers so they may not make sense in the "analysis" world but the example just shows how to correctly use the functions).
Dim inputData(1999) As Double
Dim filteredData(1999) As Double
Dim coefficients(4) As Double
Dim samplingFrequency, cutoffFrequency As Double
Dim numberOfCoefficients As Integer
Dim gaussianNoise As GaussianNoiseSignal = New GaussianNoiseSignal(1.0, 17)
' Generate a Gaussian noise signal that represents inputData
inputData = gaussianNoise.Generate(1000.0, 2000)
samplingFrequency = 1000.0
cutoffFrequency = 300.0
numberOfCoefficients = 4
Rest of code continued on next post.....
Hope this helps!
Best Regards,
07-06-2007 08:27 AM
Last piece of code...
Dim filter As New WindowedFirLowpassFilter(samplingFrequency, cutoffFrequency, numberOfCoefficients, FirWindowType.Blackman)
filteredData = filter.FilterData(inputData)
coefficients = filter.GetCoefficients
Hope this helps!
Best Regards,