Effacer les filtres
Effacer les filtres

How to set sampling rate of analog output of NI DAQ USB 6008 at 360 Hz?

4 vues (au cours des 30 derniers jours)
VIKAS SINHA
VIKAS SINHA le 2 Déc 2021
%% I am using NI DAQ USB 6008. I have csv file where signal data is sampled at 360 S/s, but NI DAQ USB 6008 analog output has bydefault sampling rate at 1000 S/s. How can I set sampling rate of analog output at 360 S/s.
Fs = 360; % Sampling frequency
T = 1/Fs; % Sampling period
N = Fs*10;
t = (0:1/Fs:10-1/Fs); % Time vector
daq.getDevices
d = daq("ni"); %%Create a DataAcquisition object for the specified vendor.
d.Rate = 360;
% d.DurationInSeconds = N*T;
n = d.Rate;
addoutput(d,"Dev1","ao0","Voltage"); %Add channels and set channel properties, if any
x1 = csvread('samples100.csv'); % ecg singal
zer = (zeros(1,3600))';
one = (ones(1,3600))';
y1 = (x1 + one*2);
y2 = ADC(y1);
for i = 1:length(t)
write(d,outputSignal1(i));
end

Réponses (0)

Catégories

En savoir plus sur Counter and Timer Input and Output dans Help Center et File Exchange

Produits


Version

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by