Main Site Documentation

Sampling rate of the FEZ_Domino A/D


#1

Please what is the Sampling rate of the FEZ_Domino A/D?


#2

Let me answer your question better by asking, what sampling rate you are trying to get?


#3

500hZ


#4

let me ask another few questions.

Do you need 500hz AND high reliability in the time between those samples? .NetMF is not real time so can’t guarantee that.

How much processing of stuff between those samples are you going to do? Depending on that, might change the answer.

Do you have a Fez? Seems you would, since you have 70 exp points - so, might just be worth testing it :wink:


#5

Yes you can easily do 500 samples/sec but like Brett said, you can’t grantee the timing in between samples.

If you explain more then we can tell you what can or can’t be done.


#6

okay so , im sampling an ECG signal and performing DSP on it and then sending the processed out. it’s just three difference equations i’m implementing on the signals. I don’t mind if a couple milliseconds of delay.


#7

Please can anyone help?


#8

What is your question?

Yes, you can read analog values 500 times/sec and do some simple calculations in between.


#9

Hi
I made this small test program. It will probably run faster without the debugger but here it is


using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;
using GHIElectronics.NETMF.Hardware;

namespace FEZ_Domino_AD_sampling
{
    public class Program
    {
        public static void Main()
        {
            AnalogIn Sampler = new AnalogIn((AnalogIn.Pin)FEZ_Pin.AnalogIn.An1);
            Sampler.SetLinearScale(0, 100);
            Int64 LastTrigger;

            Thread.Sleep(1000);

            LastTrigger = DateTime.Now.Ticks;

            for (int i = 0; i < 20; i++)
            {
                Int64 TimeStamp = (DateTime.Now.Ticks - LastTrigger);
                Debug.Print("Value=" + Sampler.Read().ToString() + " " + TimeStamp.ToString() + " ticks");
                LastTrigger = DateTime.Now.Ticks;
            }

        }

    }
}

This is the output

Value=99 1319 ticks
Value=99 1360 ticks
Value=99 1359 ticks
Value=99 1360 ticks
Value=99 1359 ticks
Value=99 1359 ticks
Value=99 1360 ticks
Value=99 1360 ticks
Value=99 1359 ticks
Value=99 1360 ticks
Value=99 1360 ticks
Value=99 1360 ticks
Value=99 1359 ticks
Value=99 1360 ticks
Value=99 1360 ticks
Value=99 1359 ticks
Value=99 1360 ticks
Value=99 1359 ticks
Value=99 1360 ticks
Value=99 1360 ticks

I must admit that what 1360 ticks represents in frequency I dont know, but you probably figure it out.


#10

This test creates multiple strings in the loop so this will be faster if you do not do that.


#11

Good point :slight_smile:

I changed the debug line to: Debug.Print(TimeStamp.ToString());

This is the new output;
1311
1350
1350
1350
1350
2980
1350
1350
1350
1350
1350
1350
1350
1350
1350
1350
1350
1350
1350
1350

ehh… why is there not more difference?


#12

You are still creating a string object, it is just smaller than before :slight_smile:


#13

Well, 10 kicks here and 10 ticks there, -it all adds up :slight_smile:


#14

wow guys, you’re the best.You’ll be hearing from in like a day. Thank you so much


#15

Geir, why do I think You messure “for” time and not sample time. Shouldn’t it be like that:

 
 LastTrigger = DateTime.Now.Ticks;
 Int64 TimeStamp; //initialization must be outside the loop ;p
            for (int i = 0; i < 20; i++)
            {
                LastTrigger = DateTime.Now.Ticks;
                Sampler.Read(); //read between two messure, not outside
                TimeStamp = (DateTime.Now.Ticks - LastTrigger);
                Debug.Print(TimeStamp.ToString()); // now string creation didn't interference measurement
                
            }


Don’t have my panda at hand - can’t check if code is working ???


#16

Your absolutely right Rimvis
Here are the new results

1509
1508
1508
1508
1508
1509
1508
1509
1508
1508
1508
1508
1508
1509
1508
1509
1508
1508
1508
1508


#17

Hello, I´m just new using GHI products (FEZ PANDA II), and i have the same question, whats the maximum sampling rate, for this, i´m trying to reach at least 1kHz sampling rate for 4 ADC channels (4kHz in order to use a MUX).
I already work with two channels at 200Hz, executing FFT and other stuff. In that project i work with the basic tutorial timer:
Timer MyTimer = new Timer(new TimerCallback(RunMe), null, 5000, 1);
but what happend if i want a period inferior to 1ms?

I don´t know the capacity of this boards, is it possible to achieve 4 ADC channels (sampling at 1kHz each), execute FFT algorithms, slope and mean calculations, and then give a output signal?

if it is, how should I implement the sampling routine?


#18

joseleuis.vargasluna,

there’s no need to cross-post.