% Back-prop Application: Removal of 60 Hz noise % activation function is ? % author: G. Dempsey, Bradley University % date: March 27, 2000 % application for DSP/ANN class % dsp.m (HW #15 part 3 preprocessor) % function approximation: % 1) sampled 24.7 Hz + 60 Hz signal (input) % 2) Target: 24.7 Hz signal (output) f=60; f1=24.7; n=0:1:200; fs=500; delt=1/fs; t=n*delt; x1=square(2*pi*f*n*delt); x2=square(2*pi*f1*n*delt); x=x1+x2; % this is the input xd=demp_delay(x,1,12); xdtest1=demp_delay(x1,1,12); % create test signals, 60 Hz only xdtest2=demp_delay(x2,1,12); % 24.7 Hz only clf disp('Press key to see 60 Hz interference') pause plot(t,x1);title('60 Hz Noise') disp('Press key to see 24.7 and 60 Hz') pause plot(t,x) title('Signal and Interference') disp('Press key to see desired output') pause plot(t,x2) title('The Desired Output, 24.7 Hz') % build input pattern matrix P=[x' xd']'; PT1=[x1' xdtest1']'; % test pattern 1 PT2=[x2' xdtest2']'; % test pattern 2 % define target target=x2; T=target; disp('Press key to start network initialization/training') pause % INITIALIZE NETWORK ARCHITECTURE %================================