代做Digital Biosignal Processing MATLAB Laboratory 2帮做Matlab编程

Digital Biosignal Processing

MATLAB Laboratory 2

The objective of this exercise is to familiarise yourselves with the concept of discrete time convolution and discrete time Fourier transform. by generating an EMG signal from experimental motor unit action potentials (MUAPs) and motor neuron discharge timings. EMG signals can be modelled as a convolutive mixture of a series of delta functions representing the discharge timings of motor neurons in the spinal cord. The impulse responses of this convolutive mixture are the action potentials of the muscle units (Figure below; see slides 16-21 of Lecture 2).

 

For this laboratory, you are provided with the discharge timings and MUAPs recorded from the biceps brachii muscle of a healthy individual during a contraction at constant torque. The MUAPs are stored in the file “MUAPs.mat”, the discharge timings (as series of discrete time delta functions) in the file “NeuralDrive.mat”, and the recorded torque in the file “Torque.mat”. The sampling frequency of the recordings is 2048 Hz.

Study the short Matlab script. provided below. Use the Matlab script. to analyse the discharge timings and MUAPs in the frequency domain (Fourier transform). Use the script. also for reconstructing the EMG signal and analysing its Fourier transform.

The impulse response of a moving average filter is provided in the script, together with the plot of the frequency response of the filter. Analyse the frequency response by varying the length of the filter. Finally, complete the script. with the computation of the EMG envelope by filtering the rectified EMG (check the effect of the filter length on the envelope estimate).

In your report, please provide the following:

- Use the Fourier transform. of the discharge timings to estimate the average discharge rate of the first motor neuron and comment on the way you obtained the estimate. [30%]

- A plot of torque and EMG envelopes for filter lengths of 1000, 5000, and 10000. Comment on the effect of filter duration in relation to the frequency response of the filter and to the estimated envelope. [70%]

PLEASE NOTICE: The report is limited to one A4 page, including all graphs and comments.

% Clear working space

clear all

close all

clc

% Load required signals

load('MUAPs.mat'); % Single motor unit action potentials (experimental)

load('NeuralDrive.mat'); % Discharge times of motor neurons (experimental)

load('Torque.mat'); % Experimental Torque

fsamp = 2048; % Sampling frequency of the recordings

%% PART 1: Reconstructing the EMG signal through convolution of discharge times by MUAPs

n_MUAPs = size(MUAPs,1); % Number of MUAPs

dur_MUAPs = size(MUAPs,2); % Duration of MUAPs

dur_MUAPseq = size(Real_firing(1,:),2); % Duration of the signal

time_ax=0:1/fsamp:(dur_MUAPseq-1)/fsamp;% Time axis for the signal

% Plot MUAP trains

figure(1),

for jj = 1:n_MUAPs

    conv_train = conv(Real_firing(jj,:),MUAPs(jj,:)); % Convolution (see slide 14-15 of Lecture 2)

    MUAP_Train(jj,:) = conv_train(floor(dur_MUAPs/2)+1:end-floor(dur_MUAPs/2)); % Cut transitory portion

    hold on, plot(time_ax,MUAP_Train(jj,:)/(max(MUAPs(:)) - min(MUAPs(:))) + (n_MUAPs - jj + 1)*1.25,'k');

end

title('Sequence of MUAPs for each motor unit')

xlabel('Time (s)')

ylabel ('MUAP trains')

MUAP_sel = 1; % Select one MUAP (1 to 15) for Fourier analysis

% Plot Fourier Transform. of the discharge timings

figure(2)

f_transf_Firings = fft(Real_firing(MUAP_sel,:));

freq_ax = [-pi+pi/dur_MUAPseq:2*pi/dur_MUAPseq:pi-pi/dur_MUAPseq];

plot(freq_ax,fftshift(abs(f_transf_Firings)));

xlabel('Discrete Angular Frequency')

title('Discrete time Fourier Transform. of Motor Neuron Discharge Sequence')

ylabel('Magnitude of Fourier Transform. (Arbitrary Units)')

% Plot Fourier Transform. of the MUAP

figure(3)

f_transf_MUAP = fft(MUAPs(MUAP_sel,:));

freq_ax = [-pi+pi/dur_MUAPs:2*pi/dur_MUAPs:pi-pi/dur_MUAPs];

plot(freq_ax,fftshift(abs(f_transf_MUAP)));

xlabel('Discrete Angular Frequency')

title('Discrete time Fourier Transform. of Motor Unit Action Potential')

ylabel('Magnitude of Fourier Transform. (Arbitrary Units)')

% Plot Fourier Transform. of the MUAP train

figure(4)

f_transf_MUAP_Train = fft(MUAP_Train(MUAP_sel,:));

freq_ax = [-pi+pi/dur_MUAPseq:2*pi/dur_MUAPseq:pi-pi/dur_MUAPseq];

plot(freq_ax,fftshift(abs(f_transf_MUAP_Train)));

xlabel('Discrete Angular Frequency')

title('Discrete time Fourier Transform. of Motor Unit Action Potential Train')

ylabel('Magnitude of Fourier Transform. (Arbitrary Units)')

% Obtaining the EMG signal by summing all MUAP trains

recoEMG = sum(MUAP_Train,1);

figure(5), plot(1/fsamp:1/fsamp:length(recoEMG)/fsamp,recoEMG);

title('Reconstructed EMG signal'), xlabel('Time (s)'); ylabel('EMG (Arbitrary Units)');

% Plot Fourier Transform. of the EMG signal

figure(6)

f_transf_EMG = fft(recoEMG(MUAP_sel,:));

freq_ax = [-pi+pi/dur_MUAPseq:2*pi/dur_MUAPseq:pi-pi/dur_MUAPseq];

plot(freq_ax,fftshift(abs(f_transf_EMG)));

xlabel('Discrete Angular Frequency')

title('Discrete time Fourier Transform. of the EMG Signal')

ylabel('Magnitude of Fourier Transform. (Arbitrary Units)')

%% PART 2: Using a moving average on the rectified, reconstructed EMG signal to get an envelope

Rect_recoEMG = abs(recoEMG); % Rectify the EMG

MA_coef_num = 5000; % Length of the moving average filter (NOTE: Length determines cut-off frequency)

MA = ones(1,MA_coef_num)/MA_coef_num; % Impulse response of the moving average filter (see slide 30)

% Plot the frequency response of the moving average filter (see slide 31).

% NOTE: The absolute value of the frequency response is plotted in log

% scale

figure(7)

freqz(MA);

% Compute the envelope of the EMG by filtering the rectified signal

[Here calculate the envelope of the EMG signal]

% Plot the envelope of the signal together with torque

[Here plot the EMG envelope with superimposed torque]

 


热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图