Discussion:
update rate
(too old to reply)
imperial-aero
2008-02-29 19:10:08 UTC
Permalink
Hi,
I'm a bit confused as to what the Update Rate is.
If I understand correctly the analog output frequency is given by
f(hertz) = Update Rate/Samples per Period
where Samples per Period = Sampling Rate/frequency
Basically I want a signal to have f = 50, which I'm trying to calculate using Sampling Rate, Update Rate and frequency. However, I don't understand what the update rate is. Is it the same as Sampling Rate. I've been trying to find an answer to this the whole day.
Dr. Imad
2008-02-29 21:10:12 UTC
Permalink
 

 

<<<Basically I want a signal to have f = 50, which I'm trying to calculate using Sampling Rate, Update Rate and frequency. However, I don't understand what the update rate is. Is it the same as Sampling Rate. I've been trying to find an answer to this the whole day.>>>>

The sampling rate has nothing to do with the update rate.  When you generate a periodic signal example a sine wave, you are actually generating a digital sine wave, not an analog signal generated by an oscillator.

 

You first have to decide how many points you are sending to the buffer.  Assume you generate one cycle of a sine wave and send it to the buffer.  Then the update rate determines the time between updates.  If the update rate is 1000 S/s, then the DT between samples is 1/1000 = 1 ms.  If the sine wave generated has consecutive points say of 4.5V, 4.6V, 4.7V, then the generated wave will have 4.5V and it remains constant for 1ms, then it changes to 4.6V and remains constant for 1ms, then changes to 4.7V and remains constant for 1ms, etc?

 

If you examine the generated wave on an oscilloscope, you will find that it looks like a stair case because it is held constant between updates.  If the update rate is increased, the generated wave becomes smoother.

 

 

If           U= Update_Rate (Samples/s)

            L=(# of points per buffer)

The frequency generated is then f(Hz) = U /L

if you have more than one cycle per buffer, say n, then the frequency isf (Hz) = n* (U/L)
imperial-aero
2008-03-01 12:10:06 UTC
Permalink
Thank you for the reply Dr. Imad.
I understand what you've explained. But I'm still confused as to how I could define/calculate the Update Rate.
 
From my VI (attached), I'm generating a sine wave using the Basic Function Generator VI and I enter the following inputs,
 

Sampling Rate: 15000 S/s
Number of Samples: 5000                                                    
Frequency: 50 hertz
 
Given the above inputs, what will be my analog output frequency. I have no idea what my Update Rate is or how many points are read into the buffer.
All I know that the output frequency varies with the sampling rate, and I just want to know exactly what my output frequency. What's the relationship between the above inputs and the analog output?
 
Best wishes


try_10.vi:
http://forums.ni.com/attachments/ni/70/8316/1/try_10.vi
Dr. Imad
2008-03-03 16:10:11 UTC
Permalink
Now I know why you meant when you refered to the sampling rate.
 
For your attached data, the frequency generated is 50 Hz.  
 
The vi you used to generate the signal does not  use the number of cycles per buffer directly, this done behind the seen.  So you do not have to worry about it.
 
1/ (the sampling rate)       in this case represents the  DT between samples.  If you want to smoothe the wave, you have to decreaseDT (same thing as increasing sampling frequency).  (or actually you may want to increase the number of samples).
 
If keep increasing bthe sampling ferquency, at one point daqmx will generate an error about exceeding the maximum update rate for the card you are using.
 
Note, your attached vi has an error. The samples per channel and the sampling rate, are bundled incorrectly.  The sampling rate should be bundled first .
imperial-aero
2008-03-03 19:10:07 UTC
Permalink
Thank you for identifying that:)
I think that should solve my problem (can't believe I wasted days on this).
Continue reading on narkive:
Loading...