LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scan Rates need to be a Power of 2 x 10

Solved!
Go to solution

Hi,


I am doing some PSD / FFT conversions from a waveform - to get a 1 Hz bandwidth, obviously the Buffer and Scan Rate need to be the same, but more than that, they need to satisfy the equation 10*(2^n) - this gets the waveform perfectly on 1 second long.

 

Using NI 9234 in a NI USB-9162 carrier & DAQmx's - Timing / Start / Read etc...

 

This I believe is due to the ADC conversion, but why 10*(2^n), not just 2^n?

 

Or have I got something fundementally wrong here?

 

Thanks,

 

-

James

0 Kudos
Message 1 of 8
(2,535 Views)

Hi James,

 

Thanks for posting on the NI forums.

 

Its a very interesting question you are asking. Could I ask you to specify where you have got the 10*(2^n) equation from? Is this something you have read somewhere?

 

If you have a link to a document or some sort of reference it would be very useful.

Kind Regards

Michael
NIUK Application Engineer
0 Kudos
Message 2 of 8
(2,459 Views)

Hi,

 

I have read somewhere that sometimes the scan rate needs to be 2^n for the ADC, no idea where the 10* comes from.

 

I had to create a little conversion vi to get the required outcome (see .jpg attached - the false case simply stops the loop).

 

To clarify, I do appear to get the right result in terms of frequency etc if I do use a different scan rate - but the frequency bandwidth would not be, for example, 1 Hz if the number of samples / buffer is the same.

 

E.g:

 

Scan Rate 8000, Sample / Buffer 8000 = Bandwidth of 1.06 Hz and Max frequency ~ 4200 Hz (would expect 1 Hz and 4000 Hz respectively)

 

Scan Rate 10240, Sample / Buffer 10240 = Bandwidth of 1 Hz and Max frequency 5120 (well 5119 - but the starting frequency is 0 Hz) which is as expected.

0 Kudos
Message 3 of 8
(2,451 Views)

Hello James

 

Mike is unfortunately out of the office, so I have therefore taken over this request.

I understand that you have some queries about scan rates with the ADC, but could you explain this further for me as I am unceratin what you are asking for help with.

 

I have found some tutorials on sampling which may clarify a few things.

 

http://zone.ni.com/devzone/cda/tut/p/id/4105

http://zone.ni.com/devzone/cda/tut/p/id/3016

http://zone.ni.com/devzone/cda/tut/p/id/5509

 

Please get in touch so I can continue to offer you support.

 

Regards

Stephanie L
Applications Engineer
National Instruments UK and Ireland
0 Kudos
Message 4 of 8
(2,423 Views)

Hi,


I have actually contacted the NI support direct (i.e. via phone) and had a response that indicates that, yes, this appears to be a feature of the DAQ I am using but I don't think anything concrete has really come through as to why the scan rates need to be so specific.

 

I am aware of the nyqusit frequency and aliasing but as to why the DAQ appears to effectively round my scan rate to something it 'prefers' I cannot pin anyone down to.  I could not see anything in your documentation that identifies that exactly?

0 Kudos
Message 5 of 8
(2,420 Views)
Solution
Accepted by James_AC

Hello James

 

I have spoken to my colleague who was working with you on your scan rate problem and we have discussed your issue together with some of our systems engineers.

 

In conclusion I think that the resource I have attached will be very useful in decided which rate to use as the module is specific about the rates it can use.

http://digital.ni.com/public.nsf/allkb/593CC07F76B1405A862570DE005F6836?OpenDocument

When you have the hardware acquiring successfully you can resample the waveform to get alternative data.

 

You also need to make sure that you are doing any calculations using the real scan rate.

 

Please have a look into these resources and let me know what changes you make in testing and the results you see. There is a lot to look through, some of the documents are regarding the hardware and others the FFT, I understand that you may be aware of some of the suggestions and comments, but they will act as a useful reference tool.

 

Valid Sampling Rates- http://digital.ni.com/public.nsf/allkb/593CC07F76B1405A862570DE005F6836?OpenDocument

How is the scan rate determined - http://digital.ni.com/public.nsf/allkb/5782F1B396474BAF86256A1D00572D6E?OpenDocument

http://digital.ni.com/public.nsf/allkb/4BBE1409700F6CE686256E9200652F6B?OpenDocument

Using FFT - http://digital.ni.com/public.nsf/allkb/549BCD6B247012F686256E00002509E5?OpenDocument

FFT fundamentals - http://zone.ni.com/reference/en-XX/help/371361B-01/lvanlsconcepts/fft_fundamentals/

Output of FFT vi's - http://digital.ni.com/public.nsf/allkb/71F25A66BE33393886257195007C3B65?OpenDocument

http://digital.ni.com/public.nsf/allkb/976C647FDF0B801786256F38004D9E5F?OpenDocument

Sample Rate capability - http://digital.ni.com/public.nsf/allkb/4BBE1409700F6CE686256E9200652F6B?OpenDocument

 

Could you please attach your code and any dependent files as well, I will have a quick look at this to see if we can make any changes.

 

Regards

 

Stephanie L
Applications Engineer
National Instruments UK and Ireland
Message 6 of 8
(2,395 Views)

Ah,

 

The second time of reading it makes sense:

 

Valid sample rates for the NI 9234 obey the following formula:
Fs = (Fm / 256) / N, where N is an integer 1..31.
Where Fm is the internal time base. By default Fm is 13.1072 MHz.

 

13107200 / 256 = 51200

 

51200 / 5 = 10240

 

ok got it.  The code has been looked at and I made the suggested changes...

 

Thanks again,

 

-

James

 

 

0 Kudos
Message 7 of 8
(2,390 Views)

Thanks again Stephanie (and thanks Liam),

 

I modified the .vi that converted frequency into an appropriate scan rate (see attached)

 

Best Regards,

 

-

James

0 Kudos
Message 8 of 8
(2,376 Views)