07-11-2013 01:36 PM
I have a NI and I get a N number of samples. But my first samples always start on 0 even thought they are not, I think it`s because of the lowpass filter. So I don`t want to use the first samples but I want to match the rest with a function (cosine for example). How do I discard these first samples?
07-11-2013 01:41 PM
First samples, as in first time when you run the VI... If so, you may want to use 'First Call?' (it in 'Synchronization' palette).
07-11-2013 02:01 PM
It is hard to figure out exactly what you mean. Can you post what code you have so far?
If you just want to throw away your first read, I would use the i of the while/for loop and compare it to 0. If it is 0, ignore it and go to the next iteration. Otherwise you process it however you like.
07-11-2013 02:32 PM
I tried to use first call? but it didn't work maybe I wrote the wrong code, and I also tried a case structure...
I need that the samples start matching the function at the 13th sample
07-11-2013 02:57 PM - edited 07-11-2013 02:59 PM
That code makes no sense. Why are you using a loop generating an array with 50 identical elements? I assume the "samples" are the pressure data. What is "the function" you mentioned?
What do you mean by "match"? Creating an xy graph does not match anything, but that's all you seem to do.
07-11-2013 03:01 PM
Sorry, I just saw that I rewrote the code in the wrong way, here is the correct one.
Well, my loop is to generate 50 values for de cosine function.
And my samples come from the DAC ASSIST.
I want to match those values of the cosine function to the samples.
07-11-2013 03:05 PM - last edited on 10-05-2024 03:28 PM by Content Cleaner
You still have not explained what "match" means. Are you talking about fitting?
Since we don't have your hardware, we do not know what kind of data comes out of the DAQ assistant. You need to provide more detail. Can you replace it with a suitably configured "simulate signal express VI" , for example?
07-11-2013 03:11 PM
Yes, I mean fitting.
My DAC is a NI USB-6218.
The data that is comming out is pressure in voltage (from a pressure transducer)
I understand that is hard to help, but thanks anyway, I`ll keep trying
07-11-2013 03:42 PM
Does the data look anything like a cosine function?
We don't really care about the hardware. More important is how the data looks like. In order to fit it, you need adjustable parameters (e.g. In the case of a general cosine, you need e.g. amplitude, frequency, phase) to be adjusted iteratively until it best matches the data.
07-11-2013 04:04 PM