This page is going to discuss how to use the CN0549 Machine Learning Enablement Platform for streaming high fidelity analog sensor data from a device under test (DUT), into MATLAB for data analysis. The goal is that once you have the data in these tools, you'll be able to create your own algorithms and train your system using your own data.
This page will outline how to get the data from the sensor all the way to MATLAB, using open-source hardware and software from Analog Devices. At the end of this page, links will also be provided to specific examples done in MATLAB, where you can recreate each example using the training data and scripts provided.
This user guide page assumes that you have the complete CN0549 system put together. This includes both hardware and software setup. If you have not completed this step, please refer back to the CN0549 user guide on how to get setup.
Hardware:
Software:
The user guide shows the USB OTG connector and the HDMI cable installed, but those two steps will not be needed here since we are streaming data over the network into the laptop.
PPT picture of high level block diagram for the hardware and software
Before you can start gathering data, you first must locate the CN0549 system setup on your network.
For Analog Devices Kuiper Linux
Username = analog and Password = analog.
Press the Enter key between each.
With your system fully setup, it's now time to stream data directly into MATLAB.
Data streaming and device control are provided through the specialized classes called MATLAB system objects in ADI's Sensor Toolbox. Devices or sensors which connect through the CN0540, such as the CN0549, will share a common base class called adi.CN0540Base.m. However, each specific sensor will have its own class that will contain documentation, methods, and properties specific to it. Therefore, end-users should always use the python class associated with the sensor and not the CN0540.
Below is a basic example where we will talk to a CN0540 with CN0549 attached. This is done remotely from a host PC, but can be done locally on the board or through another backend. See the libiio doc for more information. This example can be downloaded from GitHub directly.
%% Configure device for initialization xl = adi.CN0532(); xl.uri = uri; xl.SampleRate = '16000'; xl.SamplesPerRead = 2^14; xl.FDAMode = 'FullPower'; xl.ShiftVoltageMV = 4240; %% Collect data data = xl(); %% Plot data ts = 1/str2double(xl.SampleRate); t = 0:ts:(length(data)-1)*ts; plot(t,data); xlabel('Time (s)');ylabel('ADC Codes');grid on; ylim([min(data)-abs(min(data)*0.01) max(data)+abs(max(data)*0.01)]);
Once run the return data data
will be an array of 32-bit integers of shape (2^12,1)
. These are ADC codes as captured from the CN0540 board connected to the CN0532 sensor board.
For further details about ADI's Sensor Toolbox consult the doc available directly in the toolbox, or look at more examples in the sensor_examples folder.
End of Document