Why does MATLAB change the sampling rate when trying to get data?

I am using a 32-bit Matlab DataQ data acquisition device using the Data Acquisition toolkit.

Sometimes, when I have a sample rate of 300 set, it tells me:

A warning. This equipment cannot support the requested 300 for SampleRate. SampleRate is set to 1000 "

However, if I set SampleRate to 1000, it sometimes sets it back to 300 with the same error message.

In addition, if I install the program so that after an error occurs and the device starts recording, it returns SampleRate, it is always on what I installed, and not on the fact that the program claims that it changed it.

Does anyone know how I know what the actual sampling rate was, or didnโ€™t let her reset mine? I need to know how many samples are there per second for further calculations.

+4
source share
1 answer

The problem is not Matlab, but DAQ. I have a similar "problem" with NI DAQ. The hardware is configured to fetch at a very high speed to avoid aliasing. You can try a higher speed than required, and then use the Matlab "resample" command to reduce the sampling rate. Resample will avoid any overlap of higher frequencies.

0
source

Source: https://habr.com/ru/post/1479821/


All Articles