create one graph using the raw units in millivolts per step, and another graph that has been normalized to the maximum peak-to-peak amplitude of the m-wave in matlab

To create one graph using raw units in millivolts per step, and another graph that has been normalized to the maximum peak-to-peak amplitude of the m-wave in matlab, you can follow the below steps:

  1. Load the data into MATLAB as a row or column vector.
  2. Define the sampling frequency (Fs) and time vector (t) based on your data.
  3. Normalize the data by calculating the maximum peak-to-peak amplitude of the m-wave.
  4. Plot the original signal using the time vector and the millivolts per step units.
  5. Plot the normalized signal using the time vector, but with amplitude values scaled by the maximum peak-to-peak amplitude of the m-wave.

Here is the code:

main.m
% Load the data
data = load('data.txt');
% Define the sampling frequency and time vector
Fs = 1000; % Hz
t = (0:length(data)-1)/Fs;
% Normalize the data
max_amplitude = max(data) - min(data);
normalized_data = (data - min(data)) / max_amplitude;
% Plot the raw signal
subplot(2,1,1);
plot(t, data);
xlabel('Time (s)');
ylabel('Amplitude (mV/step)');
title('Raw Signal');
% Plot the normalized signal
subplot(2,1,2);
plot(t, normalized_data);
xlabel('Time (s)');
ylabel('Normalized Amplitude');
title('Normalized Signal');
522 chars
21 lines

This will generate a figure with two subplots: the top will show the raw signal in millivolts per step units and the bottom will show the normalized signal with amplitude values between 0 and 1.

gistlibby LogSnag