From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read input values in real time

Hi everyone. Sorry for delayed response. I have marked Kudos for all replies but I cannot accept them as soluions since they are not solving my problem.

I have done something similar to what crossrulz suggested in the attached VI but my problem remains.

I donot understand what is the meaning of number of samples in the simulate signal VI. "Number of signals in what?"

I would like to share my experience of some fleeting vain attempts I made to count properly, which is the immediate oibjective of my investigation (I am not as lucky as Riemann).

 

1. When frequency was 10^5 Hz, I set the Sampling rate and Number of Samples both to 10^6. I got increment in steps differing by exactly 10^5. I wanted to count for 10 seconds so my answer sholud be 10 ^6 counts. However this was achieved only by counting for 9 seconds. But answer was exact.

 

2.Peak detection VI is surely fast but even it makes mistakes which I cannot afford (I already posted this). Maybe I donot know what would be the best parameters for this. Can someone help me to set the parameters properly. Please donot change the signal frequency. The parameters should work also for frequency 10 times higher than I have set. I have tried (you can check my parameters) and the best I could get is a count of 2564050 in 10 seconds against an expected (and required) theroetical value of  2564102 ± 1.

 

3.In actual experiment I will be not knowing the input signal frequency for one signal but knowing for other. I will be counting at the same time using same detector so what should be sort of universal parametrs at such high frequencies, so that I count exactly.

 

Thanks!

 

0 Kudos
Message 11 of 15
(1,220 Views)

Hello everyone. On seeing no response I think I am confusing people with too many issues.

I can recast my problem as simple as possible in the following way:

 

Given a signal (simulated or input from a detector) how to determine the frequency of signal to very very very high precision. To give an idea of precision I give an example: Let actual signal frequency is In MHz ➔ 123456.789123456789  MHz, then the designed VI should show precisely upto 123456.7891xxxxxxxx  MHz,  "x" indicates we can have uncertainities at and after these positions. So the first ten digits (when expressed in MHz) should be known exactly without any error. Given that in actual experiment your signal will have some noise incorporated.

 

Tone measurement VIs are not so accurate. I am trying to use Buneman Frequency Estimator VI .

 

Any suggestions please.

Thanks!

0 Kudos
Message 12 of 15
(1,166 Views)

Accuracy of frequency analysis is directly related to the sample rate of the signal in time domain. That means for your example, the minimum frequency for the a 123456.00 MHz signal is 246912.00 MHz or 246.912 GHz. In order to have sufficient resolution for some more digits, this sample rate must be exceeded. The number of digits relate directly to the oversampling factor. NI usually recommends 10-100 times faster sampling rate (compared to the highest frequency you want to identify) to enable "shape-detection".

I'm not going into computation on the relationship between oversampling and available resolution in frequency domain, my guess for your example would be to require an instrument capable of orders of THz acquisition rate.

 

As conclussion: Your request is most likely only realizable if your original signal is in range of low kHz, not in high MHz range. If you really have multiple MHz, you either don't have the resolution (even with VERY expensive instruments) or you will have to rework your requirements to reduce resolution expectations.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 13 of 15
(1,160 Views)

Thanks Norbert.

 

My example was just for explaination. Let me give you more realistic figures. In experiment the signal frequency will be like 2564102.56410 Hz = 2.56410256410 MHz (may also be ten times higher or lower) so I should be able to determine upto 2.564102564xxxxxxxxxx  MHz accurately (i.e atleast first ten digits with no error) where "x" means as in previous post.

 

Which strategy is best suited for this problem?

 

Thanks!

0 Kudos
Message 14 of 15
(1,154 Views)

Hm, i tripped some half-correct statements in my previous post. Sorry about that.

 

The frequency domain has as many samples as the time domain. As the FFT results in complex numbers, half of these values are in the negative frequency, so it is left out for signal analysis. The maximum frequency you can detect is half of the sample rate.

Example:

You have a 1Hz sine signal and acquire 100 samples with a sample rate of 1kHz. The acquisition time will be 0.1 s (100/1kHz = 100/1000 s). When feeding that measurement values into FFT, the result will go up to 500Hz with 50 points between 0 and 500 Hz (as the 50 other points are negative frequencies).

 

Your delta t in time domain is 1ms, your delta f in frequency is 10Hz (500Hz/50). You see that there is a relationship between number of samples to frequency resolution.

If you increase the sample rate, the frequency resolution decreases if you still have the same amount of samples.

So the correct answer is: You have to increase the number of samples, hence the acuisition time, to increase frequency resolution.

 

So i have to correct myself: You most likely have to acquire multiple seconds before going into the FFT. This, however, could be a challenge for your computer as you have a lot of data. That being said, memory consumption and computation times might get a problem.....

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 15 of 15
(1,147 Views)