%graphing representative signals load remap2pin2; data=dataStruct.data(1); data=data{:,:}; time=dataStruct.timeVec(1); time=time{:,1}; plot(time(1:2000)/20000,data(1:2000,1)); xlabel('Time (s)'); ylabel('Voltage (mv)'); title('Electrode 1 Signal From Stimulation of Electrode 2','fontsize',12,'fontweight','bold'); %graphing comparison of filtered and unfiltered signalas plot([1:length(temp)]'/20000,data(:,1)+.01,'b', [1:length(temp)]'/20000, temp,'g'); xlabel('Time (s)'); ylabel('Voltage (mv)'); title('Comparison of Filtered and Unfiltered Signals of Electrode 1 from Stimulation of Electrode 2','fontsize',12,'fontweight','bold'); legend('Unfiltered', 'Filtered'); %graphing power spectra plot([1:5000]'*2, real(data_fft2(1:5000,1))+2,'b',[1:5000]'*2, real(data_fft(1:5000,1)),'g'); xlabel('Frequency (Hz)'); ylabel('Amplitude'); title('Fourier Decomposition of Electrode 1 Signal from Stimulation of Electrode 2','fontsize',12,'fontweight','bold'); legend('Unfiltered', 'Filtered'); %graphing filtered signal and spikes plot([1:length(spikes)]'/20000, temp,'b', [1:length(spikes)]'/20000,spikes(:,2)*.003,'g'); xlabel('Time (s)'); ylabel('Voltage / Spike'); title('Comparison of Filtered Signal and Extracted Spikes for Electrode 2 from Stimulation of Electrode 2','fontsize',12,'fontweight','bold'); legend('Filtered Signal', 'Spikes'); %graphing filtered signal and thershold x=1; y=length(temp); plot([x:y]'/20000, temp(x:y,1),'b') %line([x y]',[spikethresh spikethresh]','color','g') xlabel('Time (s)'); ylabel('Voltage / Spike'); title('Comparison of Filtered Signal and Extracted Spikes for Electrode 2 from Stimulation of Electrode 2','fontsize',12,'fontweight','bold'); legend('Filtered Signal', 'Spike Threshold');