Showing results for 
Search instead for 
Did you mean: 

Decimating for novice help

Go to solution

1) I have 3 channels sampling at 30,000 samples per second for 60 seconds. I am handling the acquisition and putting the data in arrays of integers (I32).

2) I need to decimate them down to 100 samples per second in order to get rms noise from the white noise generated by the input of the shorted ADC.


To do this I need to ...


1) I have been given 3 filter coeffiecents files which I need to use in a multirate FIR filter.

2) The product of this needs to be used to calculate RMS and Mean.


I am not asking someone to solve this for me. But to state the feasability of using labview to run a multirate FIR with predetermined co-effiecents.


This is my first attempt at using FIR filters and my calculus is a little rust. So be gentle.


I have attached the first of 3 sets of coeffients.




0 Kudos
Message 1 of 6

2nd coeffiecent

0 Kudos
Message 2 of 6

3rd coeffiecent

0 Kudos
Message 3 of 6

First of all, you can have 3 attachments to a single post (there's a little Add Attachment link below the attachment input to add more).  If you have more than that, zip them together and post the zip file.


LabVIEW will work just fine with what you are describing.  But to make your life really easy, just use the FIR Filter VI.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 6

I tried using the FIR with coefficients calculated in Matlab and the results were not what I expected.

I tried using the same variables to build FIR Narrowband Coefficients VI. it produced different coefficients which can be expected. But it was 20 coefficients instead of 165.

fir1Sps.txt was from Matlab.


So I am abandoning making the FIR filter coefficients in Labview.

I will try again to use the FIR


Does the FIR remove the first N values from X. Where N is the number of coefficients.

What format does FIR expect the coefficients in? 

0 Kudos
Message 5 of 6
Accepted by topic author BeanBoy

Hi BeanBoy,


You can see how the FIR Filter VI works in the detailed help here, which says:

The FIR Filter VI obtains the elements of Filtered X using the following equation.

where y is Filtered XNb is the number of FIR Coefficients, and bj is FIR Coefficients.


The inputs of the FIR Filter .vi are a 1-D array of X values and a 1-D array of coefficients. All of the coefficients are used for EACH value of X calculated. The dimensions of the arrays do not need to line up. I threw together a quick example with 3 coefficients and 6 values in my input array. The output was a 1-D array of 6 values.


So, in answer to your questions:

Does the FIR remove the first N values from X, where N is the number of coefficients?

No, FIR uses the coefficients to approximate for each value of X.


What format does FIR expect the coefficients in? 

A 1-D array of numeric data.


Note: For Multi-rate FIR Filters, you may need to use the Digital Filter Design toolkit, to be able to use the Multirate FIR Design Express VI.

Joey S.
Senior Product Manager, Software
National Instruments
Message 6 of 6