sampling rate

Hi,

My Bluetooth classic 2.0 wireless data acquisition system is sampling a 10 Hz signal at the rate of 500 samples per second using a 14 bit ADC. The data is written to a file on PC.

I am wondering how would I know from the file on PC that the sampling rate is 500 samples per second. I can see that the correct data is there but how can I measure the frequency?

dave

Reply to
davebrown227
Loading thread data ...

In general with any arbitrary input, or for the purpose of calibrating the data acquisition system's sampling rate?

If the former -- you can't. Sorry. There's just not enough information in the sampled signal to know.

If the latter -- find yourself a good frequency reference (10Hz sine from a cesium clock?), sample it for a good long time, then see what frequency it is in samples/cycle.

--
www.wescottdesign.com
Reply to
Tim Wescott

if those numbers 10Hz 500Hz are exact I'd expect a peak every 50 samples

If they aren't measure the rate that the file is growing at, there should be 500 new records every second.

--
  \_(?)_
Reply to
Jasen Betts

What's the make and model of the data acquisition system? I'm thinking that there may be an on-line manual that discusses the hardware, including the sample rate clock and any possible rate adjust options. In general, if the clock is crystal controlled (and you know the rate selection is correct) you will probably find that it is more accurate than any reference you happen to have laying around the shop.

Otherwise, mains frequency (properly isolated, of course!) is highly accurate over 24 hrs, but moment-to-moment I seem to recall it's on the order of 0.1%. I'd suggest setting up your system to record the mains for 24 hrs and then count cycles and samples.

Best regards,

Bob Masta DAQARTA v9.00 Data AcQuisition And Real-Time Analysis

formatting link
Scope, Spectrum, Spectrogram, Sound Level Meter Frequency Counter, Pitch Track, Pitch-to-MIDI FREE 8-channel Signal Generator, DaqMusiq generator Science with your sound card!

Reply to
Bob Masta

Is it possible to use the real time clock available on the micro controller to mark the time at which ADC takes a sample and then send the time with the sampled data to the PC?

Reply to
davebrown227

I don't think anyone can answer that, since you haven't told us anything about what you are using for the ADC or microcontroller... nor even told us what you are really trying to accomplish.

However, the general idea of reading the clock right after each sample and sending it with the sampled data is probably only feasible for very slow sample rates, relative to the microcontroller speed. I'd guess 500 Hz probably qualifies.

But if we knew what you were really after there may be much better ways. If you are trying to verify that the sample rate is correct, you'll need to sample something with a known frequency, then just do the math.

How much accuracy do you need? You could sample a non-precision 10 Hz (or whatever) with a sound card at 48000 Hz and compare results with your ADC. (Don't try setting the sound card to use another sample rate, since it likely runs at 48000 intrinsically and obtains other rates by sample rate conversion that may not be as accurate.)

Best regards,

Bob Masta DAQARTA v9.00 Data AcQuisition And Real-Time Analysis

formatting link
Scope, Spectrum, Spectrogram, Sound Level Meter Frequency Counter, Pitch Track, Pitch-to-MIDI FREE 8-channel Signal Generator, DaqMusiq generator Science with your sound card!

Reply to
Bob Masta

What microcontroller? You've got a BlueTooth sampling module and a PC -- where's the microcontroller?

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com
Reply to
Tim Wescott

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.