From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convolution

Solved!
Go to solution

Hii

 

I am facing problem with 1D convolution .I am convolving two 1D array of size 1024 but  the result I am getting is of size 2047.How to get rid of this or How to  delete specific extra samples that convolution is adding.

I have attached the filter which I am using with my VI .

 

Thank you

Parag

Download All
0 Kudos
Message 1 of 5
(2,909 Views)
Solution
Accepted by topic author parag77

it is an oversight that the 1D convolution does not have a "output size" input, the 2D versions do. (please vote for my idea to have this corrected. Thanks!)

 

All you need to do is take the appropriate array subset to trim the output down to the same size.

 

While you are at it, You should also learn some very basic coding skills. All you need to do is autoindex on the array of names. This eliminates the indexing operation and you no longer should wire to N. N will be determined automatically based on the array size.What if the first iteration of the FOR loop occurs before the "Names" terminal is even written? Other terminals such as "File options" and "Number" belong before the loop, because they hopefully will no change during the execution of the loop.  Reading from a local variable is inefficient and can lead to race conditions. ("Names",  "Image" and "Path"!) Delete the local variables and just wire across the loop boundary. 

Message 2 of 5
(2,885 Views)

Thank you

 

Autoindexing is nice idea,thank you.Where do I have to vote as there is no space for voting in the link that you provided. I used local variables beacuse of entangledment of wires ,this is small portion of my program I have three more frames so in that case these wire makes me confusing.

Can you please tell me where it add extra element in convolution and how to trim it .I tried it ,please see it in my VI is it right ?

 

Thank you

Parag

0 Kudos
Message 3 of 5
(2,873 Views)

To vote, you would click the yellow button next to the icon.

 

Whatever you are doing with the sin stuff now make no sense. Can you explain?

 

Sorry, I don't have IMAQ, so I cannot run your VI, but here's a quick draft to give you some ideas. most likely you need to tweak things a little bit (e.g. adjust the subset linits).

 

 

Message 4 of 5
(2,864 Views)

 

Wow it works..

 

No words to say thanks,you are awsome  . I was wondering from last two days for solution.

 

Thank you.

Parag

 

 

0 Kudos
Message 5 of 5
(2,856 Views)