Hi Pavithra,
Looks like you are experiencing difference in noise between the Session-based and Legacy-based commands. It might be attributed to various factors, including differences in default settings, synchronization, or other internal configurations between the two methods.
Consider comparing the default settings used by the Session-based command and the Legacy-based command. Also, verify that the Session-based command is properly configured for synchronization. In some cases, differences in synchronization settings can result in additional noise.
You can apply digital filtering techniques to your data to remove unwanted noise. MATLAB provides various filter design and implementation functions, such as “designfilt” and “filter”. You can design a filter based on your application's requirements and apply it to your acquired data.
Please refer to the following example:
% Design a low-pass Butterworth filter
filterOrder = 4;
cutoffFrequency = 1000; % Adjust as needed
fs = yourSamplingRate; % Replace with your actual sampling rate
lowpassFilter = designfilt('lowpassfir', ...
'FilterOrder', filterOrder, ...
'CutoffFrequency', cutoffFrequency, ...
'SampleRate', fs);
% Apply the filter to your data
filteredData = filtfilt(lowpassFilter, yourRawData);
Please refer to the following documentations to learn more:
Hope it helps.