Data Acquisition Toolbox | ![]() ![]() |
Sampling Rate
The sampling rate is defined as the per-channel rate (in samples/second) that an analog input subsystem converts analog data to digital data. You specify the sampling rate with the SampleRate
property.
The maximum rate at which channels are sampled depends on the type of hardware you are using. If you are using simultaneous sample and hold (SS/H) hardware such as a sound card, then the maximum sampling rate for each channel is given by the maximum board rate. For example, suppose you create the analog input object ai
for a sound card and configure it for stereo operation. If the device has a maximum rate of 48.0 kHz, then the maximum sampling rate per channel is 48.0 kHz.
If you are using scanning hardware such as a National Instruments board, then the maximum sampling rate your hardware is rated at typically applies for one channel. Therefore, the maximum sampling rate per channel is given by the formula
For example, suppose you create the analog input object ai
for a National Instruments board and add 10 channels to it. If the device has a maximum rate of 100 kHz, then the maximum sampling rate per channel is 10 kHz.
ai = analoginput('nidaq',1);
set(ai,'InputType','SingleEnded')
addchannel(ai,0:9);
set(ai,'SampleRate',10000)
Typically, you can achieve this maximum rate only under ideal conditions. In practice, the sampling rate depends on several characteristics of the analog input subsystem including the settling time, the gain, and the channel skew. Channel skew is discussed in the next section.
Note
Whenever the SampleRate value is changed, the BufferingConfig property value is recalculated by the engine if the BufferingMode property is set to Auto . Because BufferingConfig indicates the memory used by the engine, you should monitor this property closely.
|
![]() | Input Channel Configuration | Channel Skew | ![]() |