07-29-2025 02:06 PM
Description:
I am working on a system to simulate an EMG signal using an NI USB DAQ device with LabVIEW. LabVIEW reads EMG data from a CSV file and generates the analog signal at 500 Hz through the analog output. This analog signal is then acquired by an NI PCIe 6323 card connected to my PC via a PCIe-to-Thunderbolt chassis. Using Simulink Desktop Real-Time (SDRT) on this PCIe card, I process the signal in real-time and generate an analog trigger output to control a mechanical ventilator.
My goal is to estimate the delay introduced by the system by comparing the trigger generated by the SDRT real-time model with the trigger generated by the same model running offline in Simulink.
Issue:
When I start LabVIEW and then start Simulink SDRT a few seconds later, I observe that the EMG signal acquired in SDRT has the same waveform shape as the offline model, but the reference peaks (e.g., a timestamp marker at 288 seconds in the offline model) appear significantly later in the real-time acquired signal—between approximately 310 and 460 seconds.
This is counterintuitive because, since SDRT starts after LabVIEW, I would expect the real-time signal to be shorter (due to missing initial samples) and thus the marker to appear earlier (for example around 240 seconds), not later.
Additional observations:
Questions:
07-29-2025 05:38 PM
A forward shift in the marker peak likely indicates a combination of system delays, processing effects, and physical propagation time differences. Careful calibration and understanding of the system's transfer function can help quantify and account for this shift.