LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get my DAQ to have frequency resolution of 0.5 hz after FFT ?

Hi all,
 
I was just wondering how do I get a frequency resolution of 0.5hz after the FFT from this VI.
 
Or perhaps there can be some advice on where I must improve it.
 
Appreciate all advice, thanks!
 
-How81
 
 
 
as of now, the waveform graph i obtained, I wanted it to be of 0.5 hz, hence I used its property to set it at 0.5hz.

Message Edited by How81 on 10-13-2007 03:31 AM

0 Kudos
Message 1 of 11
(4,510 Views)
In general, to improve the spectral resolution,you should increase the number of points that you record
at the given sampling rate.
     It's not a problem if your signal is not decays/limited at time.
_________________________________________________________________________________________________
LV 8.2 at Windows & Linux


0 Kudos
Message 2 of 11
(4,497 Views)
For a spectral density of 0.5 Hz you'll need 2 seconds data.
df=1/(T[end]-T[start])

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 11
(4,485 Views)
I am curious about the DAQ assistant, I set it at sampling rate of 1k/sec, to take samples of up to 2k, logically, that would amount to 2 seconds right?
 
So the frequency resolution after FFT should be 0.5hz?
 
I am not sure which parameter I should change in order to achieve that.
0 Kudos
Message 4 of 11
(4,463 Views)

Sorry, since I don't have DAQ installed, I cannot configure the DAQ assistant. Still I don't understand the purpose of your inner FOR loop. You are repeating the same old calculation 'i' times, processing the same subset and creating an output array at the autoindexing tunnel containing all identical elements, then you pick one element for autoindexing on the outer loop.

It just makes very little sense! Can you explain your logic?

Could you replace the DAQ assistant with a simulated signal and tell us how you want it processed for the graph.

To get a df of 0.5 Hz, you simply need a dt of for the raw data according to df=1/(N * dt). You need to decide on a dt and N.

Also, setting the multiplier property needs to be done exactly once, and not with every ieration of the inner loop. You should place this property node outside of all loops!

0 Kudos
Message 5 of 11
(4,458 Views)
Hi altenbach,
 
Let me see if I can explain it properly. The reason for the outer loop was to acquire the data over 50 times each time lasting 2 seconds, hence frequency resolution of 0.5hz.
 
After each calculation, I am suppose to retain each value and store them up,indexed. In this case, I was thinking of using an array. I intend to do further calculations to them. Within the inner loop, when  I auto arrayed, the values I obtained gives me what I want, however, the thing is, the whole array changes (as increment begins), the values get updated each time the loop runs. My solution was to auto index it again on an outer loop and hence looking a bit redundant. I believe there is other ways to manipulate it, but I could only come up for now. 
 
I needed the first 50 values of the array that DAQ gives me to work out my required data. Since I need 50 readings per DAQ change, I thought I was right to have another loop nested within for the calculations.
 
Maybe I can include the field  that I am working on, so that I can be understood or corrected. I am finding voltage flicker @ 0-25 hz , but 0.5hz resolution , 50 readings in all. Perceptible frequencies for human eye, is within the region of 30 hz, that's why I see the need for nested loop.
 
Am I right? Thanks for your advice!
0 Kudos
Message 6 of 11
(4,454 Views)
Oh..appreciate that about the properties of the waveform! Will go change that! Smiley Tongue
0 Kudos
Message 7 of 11
(4,446 Views)
Hi How81,
   I won't comment on your code, I'm unable to see it (I have LV 71.1).  So I'll discuss a little bit the DSP.

   If you want such a low frequency resolution, you have to sample a little longer.  If your top-frequency is 25 Hz, I don't see the need for sampling at 1 kS/s, that gives a Nyquist freq. of 500 Hz!!! You'll only have a large amount of data, not of your interest!

   Another good advice, is to sample for a long time.  To have a REAL resolution of 0.5 Hz, It is not sufficient to sample 2 MSample for one microsecond! So, you have to sample at least for 2 seconds, but I strongly suggest to sample for a longer time.  In DSP,you almost always have to use some tolerances.

   Another matter is FFT resolution due to number of samples. If you sample 2 kS/s for 1 second, and you'll get a "2000 point FFT (...)", you'll see 1000 equally spaced frequency samples, from 0 to 1000 Hz (ie 1 Hz spacing), you can't have a resolution of more than 1 Hz. I would suggest something like sampling at (say for tolerance) 100 S/s, (top freq. you seee in FFT: 50 Hz), for 10 seconds: so you have 1000 points, but you have a resolution of 0.1 Hz.

   A part from this, always consider that FFT works in 2-powers, so it's better to do a 1024 points FFT.   Then you can use zero padding techniques to "adjust" fft to see samples at right frequencies, or sample 1024*10 samples in time at 1024 S/s and then decimate..... you have many choices.

   Hope this can help. Have a nice day!

graziano
Message 8 of 11
(4,445 Views)
Hi Graziano,
 
Thanks for the feedback!
 
I am under instructions to have a nyquist reading of up to 500 hertz. There will be future need for it, hence I set the parameters as such. Unfortunately, as a result, there are alot of unnecessary readings currently.Smiley Sad
 
Regarding sampling rate and sample size, my settings are
 
1000sample/sec
2000 samples taken into account,
 
therefore, 2 seconds, 0.5 Hz.
 
The last part on zero-padding on FFT, I am curious about what you meant, I have never try that part before. Meaning I can get to sample 1024 and get whichever part of the waveform I want?  I have been using labview sporadically over the 6 months with varying results, so many things remains new to me. Please elaborate that, it sounds interesting!
 
 
^_^ thank you for all the active responses!
0 Kudos
Message 9 of 11
(4,439 Views)
Hi How81,
   zero padding is a sort of trick to see more points on your FFT, even if they're not "true" points, they interpolate better FFT.  But I'm not good in explaining this.  What I suggest, is to search for some tutorial/books on DSP, just search for Zero padding, and try to see what is it used for. But not sure it will be useful to you...

   About the sample rate, I've nothing to discuss, if requirement is 500 Hz, you're right in sampling at 1000 S/s. But.,... if you really want to "see" 500 Hz component, I strongly suggest to sample faster, id est to have your interest frequency below 2/5 or 3/5 the Nyquist freq.  With numbers: if your requirement is 500 Hz, sampling at 1 kS/s would fit "too exactly", so, if you can, sample at 2.5 kS/s, to have a Nyquist of 1250 Hz (2/5 of 1250 is 500 Hz).  This is not Nyquist theorem, this is heuristic suggestion from other expewrienced DSP gurus....Smiley Happy

  Have a nice day!

graziano

  
0 Kudos
Message 10 of 11
(4,430 Views)