09-30-2013 10:53 AM
Hi
I want to apply a HPF to my data points only after I have n(for example 6000) data points available.
So for anything less than this number, I dont want to apply the filter, but once i have the desired number of points I want to apply it on all the previous exisitng data (from point 1-6000 as well).
I tried putting the HPF in a case condition, but when the condition i s true and it applies the filter it looks strange for some reason...I mean it is not the same as applying the HPF to the first 6000 points.
Thanks!
09-30-2013 10:58 AM
Well, show us what you're doing by attaching your code (not a picture, please). Then it'll be a lot easier to help.
Cameron
10-04-2013 01:42 PM
The way my prgoram works is that i have signals coming in(20 points at a time), and I dsiplay them on a graph.
this runs continously, so when I have reached my limit(6000 points), I want to be able to apply a HPF to all the current values on the graph.
The reason I want to do this is because applying a HPF on a smaller number of points wouldn't really mean anything in my application.
Thanks!
10-04-2013 01:50 PM
As Cameron said, posting your code makes it much easier for us to help you.
In general terms you should probably accumulate data points in an array in a shift register. Keep track of the size. When the size reaches your limit, run the filter. The filter will likely be in a case structure. Beyond that, it does not make any sense to suggest things because there are so many ways to do them.
Lynn
10-04-2013 02:07 PM
Thanks!
Well I want to avoid accumulating all the data points somewhere.
Are shift registers better than using "Insert into arrays"? Since if I use insertions it slows down my program eventually.
I was thinking maybe ther's a way to access all the values on a graph, instead of having to keep track of them myself.
I dont have code for it yet, but as you suggested I would simply need to put it in a case structure.
10-04-2013 02:17 PM
The data points need to be accumulated somewhere. A graph is just an indicator. Achart is both an indicator and a buffer which can accumulate data. Depending on what you are doing with the data, a chart can be a good or poor choice of buffers.
My preference is to do my own accumulation so that I have complete control over how much data I have and what is done with it.
Insert into Array is almost never a good choice because, as you have noted, it forces frequent memory re-allocations as the array grows.
The best way is to decide how much data you want to have in memory at any one time. Then Initialize Array to that size (using Nan, zero, or other approriate value) outside the loop. Wire the initialized array to the left terminal of the shift register. Inside the loop use Replace Array Subset to put data into the array. You need to keep track of the index where the data is to be replaced, usually with another shift register.
When the array gets full, write the data to a file and start over.
Lynn
10-17-2013 12:52 PM
Thanks!
I also have a general question on using HPF.
If I apply a hpf on 10 sets of data, 20 points each, is the results the same as applying the filter on all 200 points(the same values of course) at once?
I tried it and the results seem to be differenet....
10-17-2013 08:02 PM
See your other thread.
Lynn