EE4820_PS2_Morales

pdf

School

California State University, Los Angeles *

*We aren’t endorsed by this school

Course

4820

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

pdf

Pages

3

Uploaded by tamborsitamy

Report
A m y M o r a l e s | 1 EE 4820: Biomedical Signal Processing Problem Set 2: Reducing Ensemble Noise 1) Describe how ensemble averaging helps as a signal processing method by filling in the blanks: a. Ensemble averaging increases the signal-to-noise ratio (SNR) by a factor of ? (where n is the number of trials or observations) 2) Generate one cycle of the square wave similar to the one shown above in a 500-point MATLAB array. Determine the RMS value of this waveform using Equation 2.13. [Hint: When you take the square of the data array, be sure to use a period before the up arrow so that MATLAB does the squaring point-by-point (i.e., x.^2). clc; clear all % Generate one cycle of a square wave with 500 points t = linspace(0, 1, 500); % Time vector from 0 to 1 with 500 points frequency = 1; % Frequency of the square wave (1 cycle per second) square_wave = square(2 * pi * frequency * t); % Generate the square wave % Determine RMS value using Equation 2.13 rms_value = sqrt(mean(square_wave.^2)); % Calculate the root mean square % Plot the square wave plot(t, square_wave); xlabel( 'Time' ); ylabel( 'Amplitude' ); title( 'One Cycle of Square Wave' ); % Display the RMS value fprintf( 'RMS Value: %.4f\n' , rms_value); )) >> ps2problem2 RMS Value: 1.0000
A m y M o r a l e s | 2 3) If a signal is measured as 2.5 V and the noise is 28 mV (28 × 10−3 V), what is the SNR in dB? ?𝑁? = 20𝑙?𝑔 10 ( 2.5 28𝑥10 −3 )𝑑𝐵 = 20𝑥1.95 = 39𝑑𝐵 4) Ensemble average MATLAB lab exercise % Navigate to the directory containing the data files % Use cd command or add the directory to MATLAB path % Characterizing saccadic eye movements. % Data provided by Semmlow et al. close all ; clear all ; load verg1 ; % Get vergence eye movement data; Ts = 0.002; % Sample interval Tprestim = 0.2; % Pre-stimulus time duration [N, num_trials] = size(data_out); % Get data length (N) and number of trials t = (1:N) * Ts - Tprestim; % Generate time vector (make t=0 the time of movement onset) % Plot ensemble data superimposed plot(t, data_out, 'c' ); % Plot all trials in cyan hold on ; % superimpose % Construct and plot the ensemble average
A m y M o r a l e s | 3 avg = mean(data_out, 2); % Calculate ensemble average plot(t, avg, 'k' ); % Plot in black xlabel( 'Time (sec)' ); % Label axes ylabel( 'Eye Position' ); % r1% to r2% rise time r1 = 10; % in percent r2 = 90; a_r1 = r1/100 * max(avg); % r1% value of the ensemble average a_r2 = r2/100 * max(avg); % r2% value of the ensemble average t_r1 = find(avg <= a_r1, 1, 'first' ) * Ts; % Estimate of the r1% response time in seconds t_r2 = find(avg <= a_r2, 1, 'first' ) * Ts; % Estimate of the r2% response time in seconds t_rise = t_r2 - t_r1; % Plot markers for rise time plot([t(1) t(end)], [a_r1 a_r1], 'g--' ); plot([t_r1 t_r1], [-1 5], 'g--' ); plot([t(1) t(end)], [a_r2 a_r2], 'm--' ); plot([t_r2 t_r2], [-1 5], 'm--' ); % Label the average data text(1, 1.2, 'Averaged Data' ); axis([-Tprestim t(end) -1 5]);
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help