LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI Filter wraparound

Solved!
Go to solution

Hey folks,

 

We're seeing some weirdness with the Butterworth IIR filters. We give it an array of shorts (Int16) to filter, and if any of the values equal SHORT_MAX (32767) the filtered results can wrap around to -32768. We'd rather it not do that.

 

Has anyone else seen this, is it a known issue?

0 Kudos
Message 1 of 3
(3,000 Views)

Hi Mojo Hand,

 

Do you have a small sample workspace that exhibits this behavior. I tried reproducing this on my end but was unable to do so. What version of CVI are you using? Also, what specific function are you using to filter and what inputs are you providing to it? If you could send me a sample workspace or a snippet of code, it would be helpful in exploring this further.

 

 

Raj
National Instruments
Applications Engineer
Message 2 of 3
(2,967 Views)
Solution
Accepted by Mojo Hand

Oh, we found it! The problem was on our end, unsafely casting the doubles in the filtered results to shorts could cause 33645.4 to be cast to something like -31720. (not exactly that, just illustrating)

 

I appreciate you taking time on this.

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