- Define simulation parameters (sampling frequency, signal duration, random seed).
- Generate multiple motion classes (e.g., “idle,” “snake,” “up-down”).
- Add realistic noise and emulate sensor characteristics.
- Label data automatically in MATLAB.
- Save your signals to CSV.
- Import the labeled CSV into Edge Impulse.

Public project Dataset - Studio updown
Example: Generating continuous motion data (up-down snake wave and idle) in MATLAB
Below, we recreate a continuous motion sample project that could be used to test wearable sensors, monitor vibrations, or simulate small repetitive movements in an industrial setting.
MATLAB Synthetic Motion Data
MATLAB Online
You can run MATLAB entirely in the browser using MATLAB Online. This makes it easy to share your project, collaborate, or quickly try out scripts without installing anything locally.Prerequisites
You will need:- A MATLAB license or MathWorks account to access MATLAB Online.
- Our synthetic motion generation script see the public project description for the full script.
Getting Started
- Open MATLAB or go to MATLAB Online.
- Create a new Live Script (.mlx) or MATLAB script (.m).
- Copy-paste the synthetic motion generation code from the public project description for continuous motion data.

MATLAB Script
Customizing parameters to simulate motion data
There are several parameters to consider when generating synthetic motion data. You can customize:- Sampling Frequency (fs): Controls how frequently data is sampled (e.g., 62.5 Hz).
- Total Duration (t_end): How long the simulated signal is (e.g., 15 minutes).
- Types of Motion:
- Up-Down Motion: Simple sinusoidal vertical oscillations.
- Snake Motion: Horizontal oscillation with amplitude modulation.
- Wave Motion: Circular or elliptical motion in the XY-plane.
- Add realistic noise or drift to make the data look more authentic. Consider sensor-specific noise levels and random jitter.
Script overview
Running the Script: Generates labeled time-series data (e.g., idle, snake, updown, wave). Save to CSV: The script automatically writes to motion_data.csv. Visualize: MATLAB’s plot and subplot functions help verify that the signals make sense. Below is a minimal code snippet compare with your own script for advanced features:Multi-axis acc_x, acc_y, acc_z example
In many real applications, you have multiple axes (e.g., acc_x, acc_y, acc_z). You can extend the same logic for each axis:Generating and Labeling Multiple Classes
If you want to generate multiple classes like idle, snake, updown, wave you can segment your time vector and assign labels programmatically. Here’s a minimal example:Benefits of using MATLAB for time-series data generation
- Enhance Data Quality: Create reliable time-series signals that closely mimic real-world conditions.
- Increase Dataset Diversity: Generate multiple classes of motion, from subtle vibrations to large, sinusoidal oscillations.
- Save Time and Resources: No need to set up physical experiments to capture sensor data—scripted generation is repeatable and cost-effective.
- Improve Model Accuracy: High-quality, diverse signals help close dataset gaps, reducing overfitting and improving real-world performance.
Importing synthetic motion data into Edge Impulse
Once you have your synthetic data, you can use it to train a model in Edge Impulse. Check out the Continuous motion recognition project for a complete example.
Public project Dataset - MATLAB
Use the CSV Wizard to import your data into a project.
Now that you have your synthetic motion data, you can import it into your project using the CSV Wizard.
CSV - Step 1
- Open the Edge Impulse Studio and navigate to the Data Acquisition tab.

CSV - Step 2
- Click on the CSV Wizard.

CSV - Step 3
- Upload the motion_data.csv file.

CSV - Step 4
- Follow the steps to label and import the data.

Public project Dataset - Studio wave
- Once the data is imported, you can start training your model using the synthetic motion data.

Create Impulse
- Configure the model settings and train the model using the synthetic motion data.
Next steps
For a more advanced example, see the public project:Rolling Element Bearing Fault Diagnosis that uses MATLAB to generate synthetic vibration data for bearing fault detection, based on the MATLAB Rolling Element Bearing Fault Diagnosis example.Conclusion
By leveraging MATLAB for synthetic data generation, you can rapidly prototype and iterate without the overhead of physical sensors or mechanical rigs. This approach helps fill in dataset gaps, improves model robustness, and speeds up development cycles. Please share your own experience with MATLAB and other uses or projects with us on our forum.Further reading
- Integrate Custom MATLAB DSP blocks in Edge Impulse for advanced preprocessing before training your models. Check out the MATLAB DSP custom processing block.
- Bearing wear analysis: Public Project