01-26-2018 10:25 AM
Hi,
I have a synchronized VI that the analog output channel is acquired by the analog input channel.
the analog output is a continuous sine wave.
the analog input signal passes through: Band Pass Filter then Absolute values and then Low Pass Filter.
the problem: the final graph show that it start each time from the start, considering the filters and absolute values I have apply on the signal I aspect it will look different and not each time for each cycle of sine wave will start from the start.
I am using the USB- 6341, X-series.
I have attached the VI and a screenshot of the results so it will be more clear.
Please, any toughs?
thanks in advanced
Solved! Go to Solution.
01-26-2018 11:57 AM
@Naama2110 wrote:
Hi,
I have a synchronized VI that the analog output channel is acquired by the analog input channel.
the analog output is a continuous sine wave.
the analog input signal passes through: Band Pass Filter then Absolute values and then Low Pass Filter.
the problem: the final graph show that it start each time from the start, considering the filters and absolute values I have apply on the signal I aspect it will look different and not each time for each cycle of sine wave will start from the start.
I am using the USB- 6341, X-series.
I have attached the VI and a screenshot of the results so it will be more clear.
Please, any toughs?
thanks in advanced
Are you using the continuous run button by any chance?
Those filters will reset the first time they are called after the code starts. using continuous run is exactly the same as hitting the run button over and over again.
Done speculating,
Ben
01-26-2018 12:10 PM
From the help for Butterworth filters...
This may explain why the filters are resetting on each iteration
01-26-2018 12:22 PM
thank you both so much for your response.
I will try this!
Best regards,
Naama
01-26-2018 03:31 PM
one more thing...
it says in the help page of the butterworts filter: "To process a large data sequence that consists of smaller blocks, set this input to FALSE for the first block and to TRUE for continuous filtering of all remaining blocks."
my application need to work for like 3 minutes when I acquire the data at a sampling rate of: 100KHz.
so how can I follow what it says in the help page? or I can ignore it and just assign a TRUE contact in the init/cont terminal?
thanks in advanced,
Naama!
01-26-2018 03:39 PM
One option is to use a case structure to check if its the first iteration of the loop, and set to true or false accordingly. Or use the First Call? function (and invert).
01-28-2018 08:22 AM
Hi,
and thank you again for your response.
I can't yet try the code because I don't have the USB-6341, but considering only the code is that suppose to solve the problem?
I have attached the relevant part from the block diagram.
thanks in advanced,
Naama
01-28-2018 10:23 AM
Get rid of the NAND funciion where you NAND it with a True constant. That is the same thing as using a NOT function.
You might want to consider using a "not equal to zero" function on the value coming out of the loop's i node. It will return a False on the first iteration of the loop (since i=0) and a True after that (since i <>0). Virtually the same result as you have now. The only difference is the first call? node returns a True only the first that section of code is ever run after hitting the run button. The i node will return a zero on the first iteration of that while loop each time that while loop starts from the beginning again.
01-29-2018 07:50 AM - edited 01-29-2018 07:54 AM
thank you for your response and your recommendation.
so what you suggest on doing is to also delete the first call? and connect only the outcome of the "not equal to zero" to the filter, when the income to this function is the i node of the while loop? (the blue index)
thanks in advanced,
Naama 🙂
01-29-2018 07:53 AM
@Naama2110 wrote:
Thank you for your response and your recommendation.
So what you suggest on doing is to also delete the first call? And connect only the outcome of the "not equal to zero" to the filter, when the income to this function is the i node of the while loop? (the blue index)
Thanks in advance,
Naama 🙂
Correct.