Quick Look
Grade Level: 10 (10-12)
Time Required: 2 hours 30 minutes
(three 50-minute class periods)
Expendable Cost/Group: US $0.00
Group Size: 2
Activity Dependency: None
Subject Areas: Biology, Chemistry, Computer Science, Data Analysis and Probability, Life Science, Problem Solving, Science and Technology
NGSS Performance Expectations:

HS-ETS1-2 |
HS-ETS1-3 |
HS-ETS1-4 |
HS-LS1-3 |
HS-PS3-3 |
HS-PS4-4 |
Summary
This third activity builds on the data collected from the previous "Decoding Muscle Movement: Analyzing Neuromuscular Signals With EMG" activity. Students now gather electrical data from various groups' experiments using Muscle SpikerBox kits, which save the data in .wav format. They then use Google Colab, a cloud-based Python development environment, to create a shared database for collaborative data analysis. As they convert and process the data, students write Python scripts and engage in data analysis, honing key computational thinking skills such as breaking down complex problems, identifying patterns, abstracting essential details, and designing algorithms. This hands-on activity promotes teamwork, enhances data manipulation proficiency with Python, and deepens students' understanding of neuroscience research methodologies.Engineering Connection
Alongside data scientists and computational neuroscientists, biomedical engineers, neural engineers, and electrical engineers play a crucial role in processing and interpreting neural and muscle activation data. Biomedical engineers design and optimize medical devices such as electromyography (EMG) systems, brain-machine interfaces (BMIs), and neuroprosthetics, ensuring accurate data collection and integration with rehabilitation and assistive technologies. Neural engineers, a specialized subset of biomedical engineering, focus on developing advanced signal processing techniques for applications such as deep brain stimulation (DBS) and brain-computer interfaces (BCIs), translating neural activity into meaningful commands for prosthetics or assistive devices. Electrical engineers contribute by designing the hardware and circuitry for neural recording systems, refining sensors, amplifiers, and microcontrollers to capture and transmit bioelectrical signals efficiently. Together, these engineers collaborate with data scientists to develop sophisticated algorithms and analytical tools that enhance the accuracy, usability, and real-world impact of neurotechnology.
Learning Objectives
After this activity, students should be able to:
- Convert .wav data files into .csv data format using Python and save them for future use.
- Use Google Colab for collaborative data analysis.
- Use Python library documentation for appropriate functions.
- Use different data techniques to make the real-life data more manageable.
- Interpret electrical data collected from neuroscience experiments.
Educational Standards
Each TeachEngineering lesson or activity is correlated to one or more K-12 science,
technology, engineering or math (STEM) educational standards.
All 100,000+ K-12 STEM standards covered in TeachEngineering are collected, maintained and packaged by the Achievement Standards Network (ASN),
a project of D2L (www.achievementstandards.org).
In the ASN, standards are hierarchically structured: first by source; e.g., by state; within source by type; e.g., science or mathematics;
within type by subtype, then by grade, etc.
Each TeachEngineering lesson or activity is correlated to one or more K-12 science, technology, engineering or math (STEM) educational standards.
All 100,000+ K-12 STEM standards covered in TeachEngineering are collected, maintained and packaged by the Achievement Standards Network (ASN), a project of D2L (www.achievementstandards.org).
In the ASN, standards are hierarchically structured: first by source; e.g., by state; within source by type; e.g., science or mathematics; within type by subtype, then by grade, etc.
NGSS: Next Generation Science Standards - Science
NGSS Performance Expectation | ||
---|---|---|
HS-ETS1-2. Design a solution to a complex real-world problem by breaking it down into smaller, more manageable problems that can be solved through engineering. (Grades 9 - 12) Do you agree with this alignment? |
||
Click to view other curriculum aligned to this Performance Expectation | ||
This activity focuses on the following Three Dimensional Learning aspects of NGSS: | ||
Science & Engineering Practices | Disciplinary Core Ideas | Crosscutting Concepts |
Design a solution to a complex real-world problem, based on scientific knowledge, student-generated sources of evidence, prioritized criteria, and tradeoff considerations. Alignment agreement: | Criteria may need to be broken down into simpler ones that can be approached systematically, and decisions about the priority of certain criteria over others (trade-offs) may be needed. Alignment agreement: |
NGSS Performance Expectation | ||
---|---|---|
HS-ETS1-3. Evaluate a solution to a complex real-world problem based on prioritized criteria and trade-offs that account for a range of constraints, including cost, safety, reliability, and aesthetics, as well as possible social, cultural, and environmental impacts. (Grades 9 - 12) Do you agree with this alignment? |
||
Click to view other curriculum aligned to this Performance Expectation | ||
This activity focuses on the following Three Dimensional Learning aspects of NGSS: | ||
Science & Engineering Practices | Disciplinary Core Ideas | Crosscutting Concepts |
Evaluate a solution to a complex real-world problem, based on scientific knowledge, student-generated sources of evidence, prioritized criteria, and tradeoff considerations. Alignment agreement: | When evaluating solutions it is important to take into account a range of constraints including cost, safety, reliability and aesthetics and to consider social, cultural and environmental impacts. Alignment agreement: | New technologies can have deep impacts on society and the environment, including some that were not anticipated. Analysis of costs and benefits is a critical aspect of decisions about technology. Alignment agreement: |
NGSS Performance Expectation | ||
---|---|---|
HS-ETS1-4. Use a computer simulation to model the impact of proposed solutions to a complex real-world problem with numerous criteria and constraints on interactions within and between systems relevant to the problem. (Grades 9 - 12) Do you agree with this alignment? |
||
Click to view other curriculum aligned to this Performance Expectation | ||
This activity focuses on the following Three Dimensional Learning aspects of NGSS: | ||
Science & Engineering Practices | Disciplinary Core Ideas | Crosscutting Concepts |
Use mathematical models and/or computer simulations to predict the effects of a design solution on systems and/or the interactions between systems. Alignment agreement: | Both physical models and computers can be used in various ways to aid in the engineering design process. Computers are useful for a variety of purposes, such as running simulations to test different ways of solving a problem or to see which one is most efficient or economical; and in making a persuasive presentation to a client about how a given design will meet his or her needs. Alignment agreement: | Models (e.g., physical, mathematical, computer models) can be used to simulate systems and interactions—including energy, matter, and information flows—within and between systems at different scales. Alignment agreement: |
NGSS Performance Expectation | ||
---|---|---|
HS-LS1-3. Plan and conduct an investigation to provide evidence that feedback mechanisms maintain homeostasis. (Grades 9 - 12) Do you agree with this alignment? |
||
Click to view other curriculum aligned to this Performance Expectation | ||
This activity focuses on the following Three Dimensional Learning aspects of NGSS: | ||
Science & Engineering Practices | Disciplinary Core Ideas | Crosscutting Concepts |
Plan and conduct an investigation individually and collaboratively to produce data to serve as the basis for evidence, and in the design: decide on types, how much, and accuracy of data needed to produce reliable measurements and consider limitations on the precision of the data (e.g., number of trials, cost, risk, time), and refine the design accordingly. Alignment agreement: Scientific inquiry is characterized by a common set of values that include: logical thinking, precision, open-mindedness, objectivity, skepticism, replicability of results, and honest and ethical reporting of findings.Alignment agreement: | Feedback mechanisms maintain a living system's internal conditions within certain limits and mediate behaviors, allowing it to remain alive and functional even as external conditions change within some range. Feedback mechanisms can encourage (through positive feedback) or discourage (negative feedback) what is going on inside the living system. Alignment agreement: | Feedback (negative or positive) can stabilize or destabilize a system. Alignment agreement: |
NGSS Performance Expectation | ||
---|---|---|
HS-PS3-3. Design, build, and refine a device that works within given constraints to convert one form of energy into another form of energy. (Grades 9 - 12) Do you agree with this alignment? |
||
Click to view other curriculum aligned to this Performance Expectation | ||
This activity focuses on the following Three Dimensional Learning aspects of NGSS: | ||
Science & Engineering Practices | Disciplinary Core Ideas | Crosscutting Concepts |
Design, evaluate, and/or refine a solution to a complex real-world problem, based on scientific knowledge, student-generated sources of evidence, prioritized criteria, and tradeoff considerations. Alignment agreement: | At the macroscopic scale, energy manifests itself in multiple ways, such as in motion, sound, light, and thermal energy. Alignment agreement: Although energy cannot be destroyed, it can be converted to less useful forms—for example, to thermal energy in the surrounding environment.Alignment agreement: Criteria and constraints also include satisfying any requirements set by society, such as taking issues of risk mitigation into account, and they should be quantified to the extent possible and stated in such a way that one can tell if a given design meets them.Alignment agreement: | Energy cannot be created or destroyed—it only moves between one place and another place, between objects and/or fields, or between systems. Alignment agreement: Modern civilization depends on major technological systems. Engineers continuously modify these technological systems by applying scientific knowledge and engineering design practices to increase benefits while decreasing costs and risks.Alignment agreement: |
NGSS Performance Expectation | ||
---|---|---|
HS-PS4-4. Evaluate the validity and reliability of claims in published materials of the effects that different frequencies of electromagnetic radiation have when absorbed by matter. (Grades 9 - 12) Do you agree with this alignment? |
||
Click to view other curriculum aligned to this Performance Expectation | ||
This activity focuses on the following Three Dimensional Learning aspects of NGSS: | ||
Science & Engineering Practices | Disciplinary Core Ideas | Crosscutting Concepts |
Evaluate the validity and reliability of multiple claims that appear in scientific and technical texts or media reports, verifying the data when possible. Alignment agreement: | When light or longer wavelength electromagnetic radiation is absorbed in matter, it is generally converted into thermal energy (heat). Shorter wavelength electromagnetic radiation (ultraviolet, X-rays, gamma rays) can ionize atoms and cause damage to living cells. Alignment agreement: | Cause and effect relationships can be suggested and predicted for complex natural and human designed systems by examining what is known about smaller scale mechanisms within the system. Alignment agreement: |
-
SEP.12.9-12.4.
Use mathematical representations of phenomena or design solutions to describe and/or support claims and/or explanations.
(Grades 9 - 12)
More Details
Do you agree with this alignment?
Common Core State Standards - Math
-
Model with mathematics.
(Grades
K -
12)
More Details
Do you agree with this alignment?
-
Evaluate reports based on data.
(Grades
9 -
12)
More Details
Do you agree with this alignment?
Materials List
Each group needs:
- 1 laptop/computer with internet access
- access to Google Colab (Google Colab account setup will be needed; refer to Google Colab Setup PowerPoint)
- wav data files from previous experiments (see Troubleshooting Tips if students do not have .wav data files from the previous activity)
- Pre-Assessment (one per student)
- Understanding Neurosignals Handout (one per student)
- Data Analysis Techniques Handout (one per student)
- Google Colab Preparation Worksheet (one per student)
- Post Assessment (one per student)
For the entire class to share:
- 1 laptop/computer and projector with internet access for you to display practice code
- access to the Convert_wav_to_csv.ipynb file
- access to the Create_collaborative_database.ipynb file
- access to the sample .wav files (sampleData40BPM, sampleData60BPM, sampleData80BPM)
For the teacher:
- Teacher Rubric
- (optional) Downsampling Code Explanation
- (optional) Smoothing Code Explanation
- (optional) Collaborative Database Handout
- (optional) Example Handout
Worksheets and Attachments
Visit [www.teachengineering.org/activities/view/umo-2937-neural-data-processing-database-python-activity] to print or download.Pre-Req Knowledge
Students should have a basic understanding of Python programming, and knowledge of how to interact with different file formats.
It's recommended students complete the Decoding Muscle Movement: Analyzing Neuromuscular Signals With EMG activity.
Introduction/Motivation
In this activity, you’ll dive deeper into the exciting world of neuroscience by analyzing the data from your previous experiments! Using the Muscle SpikerBox kits in the previous activity, you recorded electrical signals from muscles, stored as .wav audio files. Now, you’ll learn how to convert these files into a versatile format, such as .csv, and discover why data manipulation and analysis are so important in scientific research. You’ll use Python and Google Colab—powerful tools that make data analysis accessible and collaborative. Along the way, you’ll build technical skills while seeing how programming applies to neuroscience in real life.
This activity will also strengthen your computational thinking skills. You’ll break down the data analysis process into manageable steps (decomposition), spot trends and patterns in the data (pattern recognition), focus on what’s most important while ignoring distractions (abstraction), and design effective methods for converting and analyzing the data (algorithm design).
Questions to consider:
- How can we visualize and interpret the electrical activity of our muscles?
- What can this data reveal about our nervous system?
- How might we use machine learning to predict muscle activity patterns?
- What features in the data are most relevant for creating a predictive model?
These questions will encourage you to think critically about the data and consider how advanced techniques such as machine learning could help uncover even more insights!
Procedure
Background
The activity focuses on converting audio data to a readable format for analysis. Understanding the basics of data formats and Python scripting is essential for this task.
To effectively analyze neuroscience and EMG data, students need foundational skills in programming and data science. These skills enable them to manipulate, process, and interpret complex datasets, preparing them for real-world applications in research and engineering.
A fundamental understanding of Python programming is essential for working with neuroscience and EMG data. Students should be familiar with basic syntax, data structures such as lists and dictionaries, and file input/output operations. Additionally, they should know how to use powerful Python libraries such as SciPy, NumPy, and Pandas, which facilitate data manipulation, statistical analysis, and signal processing.
Another key tool is Google Colab, a cloud-based Python development environment that allows students to write, execute, and share code without requiring local software installation. Google Colab supports collaborative coding and provides access to computational resources, making it ideal for processing large datasets.
Data conversion techniques are critical, as researchers frequently need to transform raw data into formats suitable for analysis. Using Python scripts, students can convert .wav files into .csv or text files, allowing for easier visualization and statistical examination. These skills are foundational in computational neuroscience, helping students extract meaningful insights from complex biological signals.
Before the Activity
- Optional: Review the basics of neuroscience (see handouts from first activity in the unit) and get familiar with EMG waves and how they help us learn about work done by muscles.
- Gather .wav files from previous experiments.
- Make sure sample .wav files are ready (samples given).
- Ensure that all equipment and software is set up and tested before the class.
- Have Python scripts for conversion ready (sampleData40BPM, sampleData60BPM, sampleData80BPM).
- Make Jupyter notebooks available for students to access: Convert_wav_to_csv.ipynb and Create_collaborative_database.ipynb.
- Make copies:
- Pre-Assessment (one per student)
- Understanding Neurosignals Handout (one per student)
- Data Analysis Techniques Handout (one per student)
- Google Colab Preparation Worksheet (one per student)
- Post Assessment (one per student)
- (optional) Example Handout (one per student)
- (optional) Collaborative Database Handout (one per student)
- Review all informational handouts.
- Backup Plans: Have contingency plans for technical issues, such as alternative datasets or offline activities.
During the Activity
Day 1: Introduction and Objectives (50 minutes)
- Hand out one Pre-Assessment to each student.
- Give students 10 minutes to complete the Pre-Assessment.
- Begin with a recap of previous activities, emphasizing the importance of understanding neuroscience and its practical applications, such as EMG data collection.
Tell students: “In our previous activities, we explored the fascinating field of neuroscience by collecting and observing electrical signals generated by our muscles using Muscle SpikerBox kits. These experiments helped us understand how electrical activity translates into muscle movement, a critical aspect of how our nervous system functions. Today, we take this understanding further by focusing on how this raw data can be processed and analyzed. By converting our collected EMG signals into manageable formats like .csv files, we’ll uncover meaningful patterns and insights that bring us closer to understanding real-world applications, from medical diagnostics and rehabilitation to advanced prosthetics and robotics. This step is crucial, as it mirrors the actual process researchers use to turn data into groundbreaking discoveries.”
- Have students read the Understanding Neurosignals Handout.
- Discuss the objective of the activity: to learn how to convert raw EMG data into usable formats for analysis and to apply data analysis techniques to interpret the data.
- Explain the importance of data conversion and analysis.
- Data conversion is crucial for transforming data into a format suitable for computational analysis.
- Analysis helps in extracting meaningful patterns and insights from raw data, essential for understanding physiological signals and their implications.
- Give each student a copy of the Data Analysis Techniques Handout.
- Go over the concepts in the data analysis handout, explaining the techniques of downsampling and smoothing the data for better data management.
- Downsampling: Reducing the data rate or frequency to make the data more manageable and to focus on significant trends.
- Smoothing: Applying techniques to remove noise from the data, making it easier to identify patterns and trends.
- Divide the class into pairs.
- Give students time to complete the Google Colab Preparation Worksheet, or assign as homework. (Note: Students should complete this worksheet before they start coding, to ensure they understand how to use Google Colab effectively.)
Day 2: Data Conversion (50 minutes)
Introduction to Data Conversion:
- Explain the process of converting .wav files (audio format) to .csv or text files (tabular data format) using Python libraries. (Use the Convert_wav_to_csv Jupyter notebook: Convert_wav_to_csv.ipynb). Tell students:
“Today, we’re going to learn how to take audio data—specifically .wav files—and turn it into a format that’s easier to analyze, such as .csv files. A .wav file is like a recording of sounds, but for us, it contains electrical signals from our muscles. By converting this into .csv format, which organizes data into rows and columns, we can start to make sense of what’s going on in those signals using graphs and analysis tools."
- Highlight the importance of this conversion for further analysis. Tell students:
"This step is critical because raw .wav files are not easily visualized or analyzed directly. Converting them to a structured format like .csv makes it possible to use tools like Python or Excel to identify patterns, filter out noise, and even combine data from multiple sources. This is how scientists and engineers prepare data for deeper analysis."
Using Python Libraries (SciPy):
- Introduce the SciPy library and its functions relevant to data conversion.
- Tell students: "We’ll use a Python tool called SciPy to handle the heavy lifting of this conversion process. SciPy is like a Swiss Army knife for scientific programming—it has built-in functions that let us read .wav files, extract the data inside, and save it into new formats. Don’t worry if this sounds technical; I’ll guide you step-by-step through how it works."
- Let students know that instructions are provided here: https://docs.scipy.org/doc/scipy.
- Provide an overview of Google Colab, an online platform for running Python code.
- Tell students: "To do this, we’ll use a tool called Google Colab. Think of it as a free, online coding notebook where you can write and run Python code without needing to install anything on your computer. It’s especially useful for sharing code and working together, and it’s something professionals in data science and engineering use all the time."
- Let students know that there is a Google Collab tutorial provided here: https://colab.research.google.com/notebooks/intro.ipynb.
- Note: Multiple screenshots are provided in the Google Colab PowerPoint to help set up Google Colab.
Review the Hands-On Guide:
- Distribute a Google Colab notebook with pre-written scripts for converting .wav files to .csv: Convert_wav_to_csv.ipynb.
- Walk through the notebook step-by-step, explaining each part of the script:
- Step 1: Loading a .wav file
- Tell students: "First, we need to load the .wav file that contains the raw data. In our script, we’re using a function called wavfile.read() from the SciPy library. This function takes the file name as input and gives us two outputs: the sampling rate and the audio data. Think of the sampling rate as how many data points were recorded per second, and the audio data as the actual signal we’ll work with."
- Example code (also given in Convert_wav_to_csv.ipynb):
from scipy.io import wavfile
# Load the WAV file from Google Drive
file_path = '/content/drive/MyDrive/Colab Notebooks/Finger Data/sampleData1.wav' # replace this with your file path
sample_rate, data = wavfile.read(file_path) # Read the WAV file, getting the sample rate and data
- Step 2: Exploring the Data
- Tell students: "Now that we have the data, we can take a closer look. The data is stored as an array of numbers, where each number represents the strength of the signal at a specific time. If you plot this, it will look like a waveform—a graph of how the signal changes over time."
- Example Code (also given in Convert_wav_to_csv.ipynb):
import matplotlib.pyplot as plt
plt.plot(data[:1000]) # Plot the first 1000 data points
plt.title('Raw Signal')
plt.xlabel('Sample Number')
plt.ylabel('Amplitude')
plt.show()
- Tell students: "This graph helps us visualize the raw signal, which is important for understanding what we’re working with before converting it."
- Step 3: Saving to a .csv File
- Tell students: "Next, we’ll save this data into a .csv file, so we can use it in tools such as Microsoft Excel or a text editor for further analysis. We’ll use a library called Pandas, which is great for working with tables of data. In this step, we create a table with one column that stores all the signal values, then save it to a .csv file."
- Example Code: (also given in Convert_wav_to_csv.ipynb):
import pandas as pd
df = pd.DataFrame(data, columns=['Signal'])
df.to_csv('output.csv', index=False)
print("Data saved to output.csv")
- Tell students: "This code creates a table with a single column labeled 'Signal' and writes it to a file called output.csv. The index=False part just makes sure we don’t add an extra column for row numbers."
- Step 4: Checking the Saved File
- Tell students: "Finally, we can check the file to make sure it saved correctly. You can open the output.csv file in Excel or a text editor to see the data in tabular form. You should see a single column of numbers, each one representing the signal strength at a different moment in time."
- Example Code: (also given in Convert_wav_to_csv.ipynb):
df.head() # Display the first few rows of the DataFrame in the notebook
- Tell students: "This command shows the first five rows of the table inside the notebook, so you don’t need to open the file right away."
Example Scripts and Demonstration:
- Provide example .wav files for practice (sample files can be provided via data repository or Google Colab).
- Data Repository Option:
- Upload all example .wav files to a shared online repository such as Google Drive or GitHub.
- Share a link with students that grants them access to download the files.
- Organize the files with meaningful names (e.g., example1_low_signal.wav, example2_high_noise.wav) to help students identify different types of signals. (In the sample data files: sampleData40BPM, sampleData60BPM, sampleData80BPM)
- Tell students: "I’ve uploaded a set of practice .wav files to a shared Google Drive folder. Please download these files to your computer or directly into Google Colab. Each file represents a different kind of signal, which will help you practice working with various data types."
- Google Colab Integration:
- Provide instructions to upload files directly into Google Colab or access them from a linked Google Drive account.
- Include a code snippet for importing files into Colab (provided in the Jupyter notebook):
from google.colab import drive
drive.mount('/content/drive')
# Example file path
filepath = '/content/drive/My Drive/example1_low_signal.wav'
- Demonstrate the conversion process, ensuring each pair can execute the script and generate .csv files.
- Use a step-by-step live demonstration in Google Colab to show how a .wav file is processed.
- Start by loading a file (e.g., sampleData40BPM.wav) using the script shared earlier.
- Tell students: “Let’s go through the process together. I’m loading a .wav file called sampleData40BPM.wav. We’ll check the sampling rate, plot the waveform, and then save it as a .csv file. Watch closely as I run each code cell and explain what it’s doing."
- Highlight each step of the process (e.g., loading data, visualizing the waveform, converting to .csv, and saving the file, similar to what was previously demonstrated above.)
- Make the following key points:
- Highlight the Sample Rate: "Notice the sample rate for each file. This determines how many samples per second were recorded, which affects the resolution of our data."
- Waveform Comparison: "Look at the waveform for 40 BPM compared to 60 and 80 BPM. Can you see how the frequency of peaks increases as the beats per minute go up? This reflects faster muscle activity."
- Importance of Data Conversion: "By converting these signals to .csv files, we can analyze and compare them more easily, which is essential for understanding trends in muscle activity."
- Encourage Student Observations: "What differences do you notice in the amplitude or rhythm of the signals as we move from 40 to 80 BPM? How might this relate to muscle activity in different scenarios, such as exercise or rest?"
- Show students the waveform plot generated by matplotlib.
- Display the first few rows of the .csv file in the Colab notebook.
- Let students ask questions.
Student Group Practice Session:
- Allow students time to apply the data conversion process to the three datasets: sampleData40BPM.wav, sampleData60BPM.wav, and sampleData80BPM.wav., offering support as needed.
- Have students load each .wav file into Python.
- Have students plot the waveform for each dataset to observe and compare patterns.
- Have students convert each dataset into a .csv file and save it for further analysis.
- Have students share their .csv files with other groups using a collaborative platform such as Google Drive.
- Give students time to analyze and identify patterns of their sample files:
- Visual Analysis:
- Have students plot the waveforms of all three datasets on a single graph to observe how the signal frequency changes with the BPM.
- Have students notice and discuss the amplitude and timing of peaks to determine differences between the datasets.
- Quantitative Analysis:
- Have students calculate basic statistics (e.g., mean, standard deviation of amplitude) for each dataset.
- Have students examine the number of peaks or oscillations per second to verify the relationship between BPM and signal frequency.
Student Data Session:
- After students use the provided sample data (.wav files) to learn and practice Python scripting for converting .wav to .csv or text files, have students switch to working on the data they collected in the previous activity.
- Encourage pairs to experiment with their collected .wav files and observe the output.
- Have each group discuss the following questions:
- How does the frequency of peaks change as BPM increases? What does this tell us about muscle activity at different levels of exertion?
- Are there differences in the amplitude of the signals between datasets? What might these differences represent (e.g., stronger or weaker muscle contractions)?
- What challenges did you encounter during data conversion, and how did you address them?
- Expected results of student exploration:
- Observed Patterns
- 40 BPM Dataset:
- The waveform will show fewer, more widely spaced peaks, corresponding to slower muscle activity.
- Amplitude may be consistent, representing steady contractions at a lower rate.
- 60 BPM Dataset:
- Peaks will appear closer together, indicating more frequent muscle contractions.
- Some variability in amplitude might be observed, suggesting changes in muscle strength or fatigue.
- 80 BPM Dataset:
- Peaks will be the closest together, showing the highest frequency of muscle contractions.
- Amplitude may vary more significantly, especially if the signal represents fatigue or inconsistent contractions.
- Insights into Muscle Activity
- Increased BPM corresponds to faster muscle contractions, reflecting higher exertion or effort.
- Differences in amplitude might indicate varying levels of contraction strength or noise in the signal.
- The comparison highlights the importance of preprocessing and visualization in interpreting raw data.
Day 3: Data Analysis (50 minutes)
Creating a Collaborative Database:
- Explain the importance of collaborative databases for pooling data and collaborative analysis. (Refer to the Collaborative Database Handout for more information.)
- Collaborative databases are powerful tools that enable multiple users to contribute to, access, and analyze a shared repository of data. In the context of scientific research, such as neuroscience and EMG data analysis, collaborative databases are particularly valuable. Use the ‘Creating collaborative databases’ notebook (Create_collaborative_database.ipynb) to create a .csv database.
- Tell students: "Collaborative databases are essential in research because they allow data from multiple sources to be pooled in one place. In neuroscience, for example, data could come from different labs or even different experiments, but by combining it, we can get a fuller picture of the phenomenon we’re studying. In our case with EMG data, being able to share and collaborate on the data makes it possible to analyze a larger, more diverse dataset, which leads to better, more reliable insights."
- Instruct students on how to create a shared .csv file in Google Colab.
- Have students open the Google Drive in their web browser.
- Have each pair locate their your_file.csv, their converted .wav file, in 'My Drive'.
- Have each pair right-click on the file and select 'Share'.
- Have each pair add specific people to the files or change the link settings to share their files.
Downsampling Data:
- Review downsampling with the students:
- Downsampling is a technique used to reduce the number of data points in a dataset. This is particularly useful when dealing with large datasets, such as EMG signals, to make them more manageable and to speed up the analysis. Downsampling reduces the sampling frequency by selecting fewer data points while maintaining the integrity of the overall pattern or trend. This is often done by skipping over certain samples in the original dataset.
- Why is downsampling important?
- Data reduction: It reduces the data size, making it easier to process and analyze.
- Noise reduction: Downsampling can help in reducing noise by smoothing out small variations that may not be relevant for the analysis.
- Faster processing: Smaller datasets require less computational power, which is beneficial when performing analyses like machine learning or statistical testing.
- How downsampling works: When we downsample, we essentially keep data points from the original signal at a reduced frequency.
- Give students time to downsample their collected data. (Refer to the Downsampling Code Explanation handout for reference.)
- Tell students: "Now that you’ve seen how to downsample the data, go ahead and load your own EMG data. Use the downsample_data() function to reduce the sampling rate. After you downsample, you’ll notice that the signal becomes simpler, and the data file size is smaller. Take a look at the plot and listen to the downsampled file to ensure that the key features of the signal are still there."
- Expected results of student results/output/observations:
- Before downsampling: Students will see the original signal plotted as a waveform, which should be more detailed (i.e., more data points).
- After downsampling: The downsampled signal will appear less detailed. The waveform will still reflect the original signal's trends but with fewer data points, and the amplitude values might be smoother due to the reduction in sampling.
- Downsampled File: A new .wav file (e.g., downsampled_file.wav) will be saved, containing the downsampled data. Students can listen to this file to confirm the signal still resembles the original, but with a lower frequency.
Smoothing Data:
- Review smoothing with the students:
- Tell students: “Smoothing techniques are important for reducing noise in a signal, making it easier to identify meaningful patterns or trends. In real-world data such as EMG signals, we often encounter fluctuations and random variations that can obscure the underlying signal. By applying smoothing methods, we can eliminate or reduce these fluctuations, making the data cleaner and more interpretable.”
- Give students time to smooth their collected data. (Refer to the Smoothing Code Explanation handout for reference.)
Group Discussion and Presentation:
- Gather the class together and have each pair present their findings, discussing the patterns they identified and the techniques they used.
- Have a class discussion about the different approaches and insights gained from the data analysis.
- Students should identify the following from their analysis:
- Peaks and troughs representing muscle contractions and relaxations.
- Periodic patterns, which could indicate repeated movements such as walking or typing.
- Differences in signal strength or frequency between datasets.
- Regular oscillations indicating rhythmic activity.
- Variability in amplitude or timing that could suggest fatigue or changes in activity.
- Students should recognize that they used these techniques:
- Data conversion using Python to transform .wav files into .csv.
- Downsampling to simplify the data for easier analysis.
- Smoothing (e.g., moving averages, Gaussian filters) to reduce noise and clarify patterns.
- Students should gain these insights:
- How raw data is transformed into usable information through computational techniques.
- The relationship between data patterns and physiological processes.
- The importance of clean, well-processed data in making accurate scientific observations.
Conclusions:
- Recap the key concepts from the three days. Tell students:
"Over the past three days, you’ve learned how to process raw EMG data and transform it into meaningful insights. We started by converting raw data into a usable format, explored downsampling to make the data manageable, and applied smoothing techniques to reveal patterns in muscle activity. You’ve seen how data tells a story about our body’s electrical and mechanical functions, and how scientists analyze this information to solve real-world problems."
- Highlight the importance of data conversion and analysis in neuroscience. Tell students:
"Data conversion and analysis are foundational to neuroscience. Raw data, such as the electrical signals from muscles, is often too noisy and complex to interpret directly. By converting and analyzing it, we uncover patterns that help us understand motor control, diagnose diseases, and design assistive technologies. Without these steps, raw data would remain just numbers on a screen, instead of insights that can change lives."
- Encourage students to reflect on how these skills can be applied to other areas of research and study.
- Application to real life: Students should understand how the techniques they learned are used in fields like medical diagnostics, prosthetics, and robotics.
- Broader Impacts: They should see how neuroscience research benefits individuals and society by advancing healthcare and technology.
- Hand out one Post Assessment to each student.
- Give students time to complete the Post Assessment.
- Optional: Provide the examples for students’ engagement and understanding in the Example Handout.
Vocabulary/Definitions
.csv file: A comma-separated values file that stores tabular data.
.wav file: An audio file format that stores waveform data.
data conversion: The process of changing data from one format to another.
downsampling data: The process of reducing the number of data points in a dataset. The main goal of downsampling is to make large datasets more manageable and to reduce the computational load when analyzing the data.
Google Colab: A hosted Jupyter Notebook service that requires no setup to use and provides free access to computing resources, including GPUs and TPUs. Colab is especially well suited to machine learning, data science, and education.
Python library: A collection of Python modules and functions that help in performing specific tasks.
smoothing data: A technique used to remove noise and fluctuations from data to highlight the important trends and patterns. Smoothing helps in making the data easier to interpret by reducing the impact of random variations and emphasizing the overall structure.
Assessment
Pre-Activity Assessment
Pre-Activity Assessment: Students take the Pre-Assessment before the activity occurs. You can use the assessment to assess student’s pre-activity knowledge of the subject matter.
Activity Embedded (Formative) Assessment
Google Colab worksheet: Students answer the questions on the Google Colab Preparation Worksheet to demonstrate their understanding of the Colab setup and Python tools. This worksheet serves as both a learning tool and a formative assessment.
Python coding throughout the activity: As students work through the data conversion process, provide guidance and check for understanding of the Python script. Help them debug the code as needed.
Post-Activity (Summative) Assessment
Post-Activity Assessment: Students take the Post Assessment after the activity. You can use the assessment to assess student’s knowledge of the subject matter after the activity.
Reflection questions: Students are asked to reflect on how data analysis is used in real-world neuroscience research and the importance of accurate data conversion. Students are asked to come up with a real-life example of where this could be useful.
Activity Evaluation: You can use the Teacher Rubric to assess students’ Python coding and subsequent data analysis.
Troubleshooting Tips
For troubleshooting tips for Python, the following websites are excellent resources:
- Stack Overflow: stackoverflow.com
- A popular Q&A site where you can search for specific Python errors and find solutions provided by the community.
- Real Python: realpython.com
- Offers tutorials and articles on various Python topics, including troubleshooting common issues.
- Geeks for Geeks: geeksforgeeks.org
- Provides a wide range of Python programming tutorials, including error handling and troubleshooting tips.
- Python Documentation: docs.python.org
- The official Python documentation includes a section on handling and troubleshooting errors in Python.
- W3Schools: w3schools.com
- Offers a comprehensive guide to Python, including a section on exceptions and error handling.
Note: These websites are valuable resources for finding solutions to common Python programming problems and understanding error messages.
- A GitHub repository offers a simple script to convert WAV files to CSV, which can be adapted for your needs.
- Scientifically Sound provides a tutorial on analyzing EMG signals using Python, which includes steps relevant to reading and processing the data.
- iDiTect's guide on downsampling .wav audio files in Python includes several methods and examples using different libraries.
- Discussions on Signal Processing Stack Exchange provide insights into the challenges and considerations when downsampling and smoothing data.
Using these resources, you can effectively downsample and smooth your EMG data, converting it from .wav to a manageable .csv format for further analysis.
Activity Extensions
- Use Python libraries such as SciPy or NumPy to apply filters (e.g., low-pass, high-pass, band-pass) to the neural data to remove noise and isolate specific frequency components.
- Perform statistical tests to compare different sections of neural data.
Activity Scaling
- For younger students, provide more detailed instructions and demo the Python scripts.
- For more advanced students, include additional data analysis techniques and challenges.
Additional Multimedia Support
- SciPy Documentation: https://docs.scipy.org/doc/scipy
- Google Colab Introduction: https://colab.research.google.com/notebooks/intro.ipynb
- Pandas Documentation: https://pandas.pydata.org/docs
- Matplotlib Documentation: https://matplotlib.org/stable/index.html
Subscribe
Get the inside scoop on all things TeachEngineering such as new site features, curriculum updates, video releases, and more by signing up for our newsletter!More Curriculum Like This

This unit introduces students to neuroscience through a systems approach with a strong emphasis on computational thinking and data analysis. Students investigate the neural origins of muscle movement by collecting and analyzing electrical signals from surface electrodes placed on the arm during simp...

This fourth and final activity in the unit allows students to analyze and visualize neural data, providing them with the opportunity to explore patterns in brain signals. Using Python, students interpret neural activity linked to various movements, such as finger and wrist motions, to understand how...

With a design-thinking approach, students incorporate neuroscience into their robotics learning experiences in this activity. They perform an experiment to design a basic human-robot interface through which electromyography (EMG) signal readings from the muscle movements in their arm are translated ...

In this second activity, students dive deeper into the neuromuscular system by exploring how the body recruits and activates muscles in response to various gestures. They begin by examining the neuromuscular junction and diagramming the neuronal circuitry pathway involved in muscle activation. Using...
Copyright
© 2025 by Regents of the University of Colorado; original © 2024 University of MissouriContributors
Dr. Ashwin Mohan, CS faculty at Illinois Mathematics and Science Academy ; Dr. Sowmya Anjur, retired science faculty from Illinois Mathematics and Science Academy; Dr. Satish Nair, Professor, Robert H. Buescher Faculty Fellow at University of MissouriSupporting Program
Research Experience for Teachers (RET), University of Missouri ColumbiaAcknowledgements
This work is based on work supported in part by the National Science Foundation under grant no. EEC-1801666—Research Experiences for Teachers at the University of Missouri. Any opinions, findings and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.
This endeavor would not have been possible without the guidance and support of Prof. Satish S. Nair, University of Missouri, Neural Engineering Laboratory, Columbia, Missouri (https://nairs.mufaculty.umsystem.edu/home).
Last modified: May 30, 2025
User Comments & Tips