LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convolution Array Length

I have implemented a low pass filter as shown in the following snippet.  This code is the same as the guts of the NI supplied "FIR Windowed Filter.vi" except for:

1. I have set the Option input to "scaled".

2. I added a 32 position left rotate at the end to compensate for the filter's fixed 32 point delay.

 

The convolution vi pads the arrays with 64 data points.  This is expected behavior (though I only learned about it this afternoon.)

My question is, "What ends up in the 64 padded cells and what should I do about them after the operation.  Having arrays grow, containing possibly meaningless values,

is troublesome.


My first guess is, after I do the 32 postion left rotate, I have restored the meaningful data into the originalarray bounds and I can safely lop off the terminal 64 values.  Is this correct?

 

Thank you.

 

Mark Holm

 

 Low Pass Filter Snippet.png

0 Kudos
Message 1 of 3
(2,766 Views)

For some unknown reason, the 1D convolution does not have an input to define the output size as the 2D convolution already does!! This is the reason my idea here exists, but it did not receive may votes so far (13 votes since summer 2009 :().

 

The content of the "tails" is defined by the data and the size is defined by the sizes of the two array inputs. Depending on what you need, you can safely clip these wings from the output.

 

 

0 Kudos
Message 2 of 3
(2,763 Views)

Thank you altenbach for your reply.
I need to dig a bit deeper.  The arrays are padded (64 "slots" in this case) on the end  The filter process, of which the convolution is the core, results in a delay of 32 "slots".  I presume the, after the convolution, the first and last 32 slots (totalling the 64 added slots) contain something other than filtered data.  In otherwords, the meaningful data has been shifted right 32 slots.  If this is correct, then my 32 slot left rotate puts all of the "padding" back at the end of the array where I can truncate it.

 

Do I understand correctly?

 

Thank you.

 

Mark Holm

0 Kudos
Message 3 of 3
(2,753 Views)