% hart_can.m % Adaline neuron % Application: Heartbeat Cancellation % February 20, 2003 % author: G. Dempsey, Bradley University % clear clf % define y=target, ym= reference tstep=0.005; % 200 Hz sampling ti=0:tstep:4.995; % define time base (total) load hw16 % load unmodified blood P signals % plot unmodified signals subplot(211),plot(ti,munmod),grid,title('Mother') subplot(212),plot(ti,bunmod),grid,title('Baby') disp('press any key to continue') pause % create practical situation rsig=munmod; % ref signal (at mother's chest) tsig=0.4*bunmod+munmod*0.7; % target signal (at mother's stomach) figure subplot(311),plot(ti,tsig),grid,title('Target- stomach') subplot(312),plot(ti,rsig),grid,title('Reference- chest') ysub=tsig-rsig; subplot(313),plot(ti,ysub),grid,title('Subtraction Method') % define Pattern and Target matrices T=[tsig]'; ndels=I'm not going to tell; rdelay=delaysig(rsig',1,ndels)'; % create ?? delayed samples for ANN input P=[rsig rdelay]'; disp('press any key to continue') pause % INITIALIZE NETWORK ARCHITECTURE %================================ % Set input vector size R, layer sizes S1 & S2, batch size Q. % left to you % Initialize weights and biases. % left to you % TRAIN THE NETWORK %================== % TRAINING PARAMETERS max_epoch = I'm not going to tell; err_goal = I'm not going to tell; lr = I'm not going to tell; % PLOT FINAL APPROXIMATION %========================= figure disp('display final results') subplot(211),plot(ti,bunmod*0.4),grid title('Desired Output Signal') %output=? subplot(212),plot(ti,output),grid title('ANN Output') pause % SUMMARIZE RESULTS %================== % number of epochs % final sum squared error % number of delays