LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

applying a HPF only when a certain number of points is available

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!

0 Kudos
Message 1 of 8
(3,346 Views)

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

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 2 of 8
(3,344 Views)

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!

0 Kudos
Message 3 of 8
(3,308 Views)

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

0 Kudos
Message 4 of 8
(3,304 Views)

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.

0 Kudos
Message 5 of 8
(3,300 Views)

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

0 Kudos
Message 6 of 8
(3,295 Views)

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....

0 Kudos
Message 7 of 8
(3,244 Views)

See your other thread.

 

Lynn

0 Kudos
Message 8 of 8
(3,232 Views)