11-13-2015 04:11 AM
Hi,
I'm trying to recreate the filter function, with initial conditions, from matlab to LabView. I have the correct Initial conditions as an array like ([ -0.6735,1.3470, -0.6735]) but the IIR Filter wit I.C.vi needs a X initial conditions and Y initial condition.. What that it means? How can I transform my single array of IC to thes two inputs? If I can't, there is a way to know how the vi works to prepare my signal before and obtain the same results as matlab?
Without the IC the vi works perfectly...
Thanks!
11-14-2015 07:50 PM
Having trouble picturing what your code looks like. Could you post it, or a picture of it?
11-16-2015 02:18 AM - edited 11-16-2015 02:25 AM
The code from matlab is:
[b,a] = butter(3,0.125,'high')
Fz = filtfilt(b,a, x)
Where x is a my signal with length = 15.
In the filtfilt code, that can be found here:http://www.mathworks.com/matlabcentral/fileexchange/12886-teqcspec/content/Teqcspec/filtfilt.m , the initial conditions are calculated and stored in "zi", if you follow the code you will obtain as result:
zi =
-0.6735
1.3470
-0.6735
If you keep goind with the code, x is expanded and stored on Y. And the initial conditions are multiplied for y(1).
zi * y(1)
ans =
-2706.8
5413.6
-2706.8
This are my initial condition, as I said in my previous post, obtain b, a, zi are not a problem, I have that handled.
The problem remains when I try to implement the filter function, without I.C. the results are the same. but when I want to use my I.C. LabView wants two array, X and Y, as I.C.
I tried to use only X, only Y, use the same values for X and Y... and no result.
Attached I left the .vi and a the sample values for X. The sample values are extended, so you can skip that part.
Thanks!