07-02-2016 11:27 AM - edited 07-02-2016 11:31 AM
Don't overcomplicate things! Just use the mean ptbypt vi and get it over with already. No need for any extra code.
@sk1 wrote:
I tried to check your 200 pt moving average vi you had uploaded in the earlier post but it has missing delta-t sub vi. Can you upload your delta-t sub-vi too? So i can check your program too.
This subVI is only used for timing measurement so you can leave it out. It has nothing to do with the functionality you need and there are plenty of other ways to measure the average loop time.
07-06-2016 10:32 AM
Hi ,
Thanks for your suggestions. I have another question with you too.
When i am taking the CDAQ during road test , i am getting noise of frequency around 23 Hz . So i was using bandstop Butterworth filter to filter out that noise of 23 Hz. So when i take the moving average of the filtered data, the data seems to be of very small order magnitude than before when i used to take moving average of the raw data. But like i said when i take the moving average of the raw data , it gives the result as it should be .
Do you have any suggestions or advice in this matter?
Thanks.
Sachet
07-06-2016 11:47 AM
07-06-2016 01:04 PM
@sk1 wrote:
When i am taking the CDAQ during road test , i am getting noise of frequency around 23 Hz . So i was using bandstop Butterworth filter to filter out that noise of 23 Hz. So when i take the moving average of the filtered data, the data seems to be of very small order magnitude than before when i used to take moving average of the raw data. But like i said when i take the moving average of the raw data , it gives the result as it should be .
(Sorry, I cannot tell how your DAQ assistant is configured.)
How many points are in your original data array that you are filtering? While you are filtering the entire array, you are only keeping the first point for the ptbypt averaging and the first point of a filtered waveform is always close to zero with your settings. Maybe you want to take the mean of the array (instead of the first element) to be later averaged.
There is also a butterworth filter ptbypt, maybe you should be using that instead if you want to operate on single points, but filter over time.
07-06-2016 01:49 PM
Hi,
Sorry that i forgot to mention about my DAQ config. I have configured it as "Continous Samples" with frequency of 200 Hz or 200 samples per second.
Yes i think you are right about first point available for moving average . Because when i see it in wave chart the filtered data coming out of the filter is close to zero so is the moving average.
But i haven't tried butterworth filter pt by pt . Right now i dont have DAQ with me but i will let you know the outcome once i use that vi too.
But just to be clear on the concept since i am new to labview. So does that mean my butterworth filter with settings as 22.5 to 23.5 cutoff frequence is sending out only the first element of the waveform as a filtered data instead of whole array ?
Thanks.
Best regards,
Sachet
07-06-2016 01:54 PM
@sk1 wrote:But just to be clear on the concept since i am new to labview. So does that mean my butterworth filter with settings as 22.5 to 23.5 cutoff frequence is sending out only the first element of the waveform as a filtered data instead of whole array ?
No, your "index array" operation only retains the first element of the filtered array output.