Mercurial > hg > map
changeset 23:6cce421531e2
working again
author | Ray Meddis <rmeddis@essex.ac.uk> |
---|---|
date | Wed, 15 Jun 2011 15:06:10 +0100 |
parents | fafe69c43108 |
children | a5e4a43c1673 |
files | Help and reference data/MAP1_14 quick reference.doc Help and reference data/MAPlog.doc Help and reference data/Test files readme.doc MAP/MAP1_14.m README.md multithreshold 1.46.zip multithreshold 1.46/MAPmodel.m multithreshold 1.46/old files/MAPmodel.m multithreshold 1.46/savedData/mostRecentResults.mat multithreshold 1.46/subjGUI_MT.m multithreshold 1.46/testBM.m parameterStore/MAPparamsNormal.m testPrograms/Test files readme.doc testPrograms/demoTwisterProbability.m testPrograms/demoTwisterSpikes.m testPrograms/hs_err_pid1016.log testPrograms/html/myConv.html testPrograms/html/myConv.png testPrograms/html/myConv_01.png testPrograms/html/myConv_02.png testPrograms/html/myConv_03.png testPrograms/html/myConv_04.png testPrograms/html/myConv_05.png testPrograms/html/myConv_06.png testPrograms/html/myConv_07.png testPrograms/html/myConv_08.png testPrograms/html/myConv_09.png testPrograms/html/myConv_10.png testPrograms/myConv.m testPrograms/showMAP.m testPrograms/test_MAP1_14.m userPrograms/Pavel_MAP1_14.m utilities/UTIL_PSTHmakerb.m utilities/UTIL_showMAP.m |
diffstat | 34 files changed, 575 insertions(+), 940 deletions(-) [+] |
line wrap: on
line diff
--- a/MAP/MAP1_14.m Mon Jun 13 17:30:57 2011 +0100 +++ b/MAP/MAP1_14.m Wed Jun 15 15:06:10 2011 +0100 @@ -610,25 +610,22 @@ else % no MOC available yet MOC=ones(1, segmentLength); end - plot(MOC) % current channel + % apply MOC to nonlinear input function + nonlinOutput=stapesDisplacement.* MOC; - % first gammatone filter + % first gammatone filter (nonlin path) for order = 1 : GTnonlinOrder [nonlinOutput GTnonlinBdry1{BFno,order}] = ... filter(GTnonlin_b(BFno,:), GTnonlin_a(BFno,:), ... - stapesDisplacement, GTnonlinBdry1{BFno,order}); + nonlinOutput, GTnonlinBdry1{BFno,order}); end - % broken stick instantaneous compression - % nonlinear gain is weakend by MOC before applied to BM response - y= nonlinOutput.*(MOC* DRNLa); % linear section. - % compress those parts of the signal above the compression - % threshold - abs_x = abs(y); + y= nonlinOutput.* DRNLa; % linear section. + % compress parts of the signal above the compression threshold + abs_x = abs(nonlinOutput); idx=find(abs_x>DRNLcompressionThreshold); if ~isempty(idx)>0 - y(idx)=sign(y(idx)).*... - (DRNLb*abs_x(idx).^DRNLc); + y(idx)=sign(y(idx)).* (DRNLb*abs_x(idx).^DRNLc); end nonlinOutput=y; @@ -1111,6 +1108,7 @@ [smoothedRates, MOCboundary{idx}] = ... filter(MOCfilt_b, MOCfilt_a, rates(idx,:), ... MOCboundary{idx}); + % spont 'rates' is zero for IC MOCattSegment(idx,:)=smoothedRates; % expand timescale back to model dt from ANdt x= repmat(MOCattSegment(idx,:), ANspeedUpFactor,1);
--- a/README.md Mon Jun 13 17:30:57 2011 +0100 +++ b/README.md Wed Jun 15 15:06:10 2011 +0100 @@ -1,4 +1,4 @@ This is the new readMe file ---------------------------- -tada \ No newline at end of file +Look in the 'Help and reference data folder' for advice. \ No newline at end of file
--- a/multithreshold 1.46/MAPmodel.m Mon Jun 13 17:30:57 2011 +0100 +++ b/multithreshold 1.46/MAPmodel.m Wed Jun 15 15:06:10 2011 +0100 @@ -25,12 +25,12 @@ MAPparamsName, AN_spikesOrProbability); if showPlotsAndDetails - options.showModelParameters=0; + options.printModelParameters=0; options.showModelOutput=1; options.printFiringRates=1; options.showACF=0; options.showEfferent=1; - showMAP(options) + UTIL_showMAP(options) end % No response, probably caused by hitting 'stop' button @@ -133,4 +133,4 @@ end -path(savePath) \ No newline at end of file +path(savePath)
--- a/multithreshold 1.46/old files/MAPmodel.m Mon Jun 13 17:30:57 2011 +0100 +++ b/multithreshold 1.46/old files/MAPmodel.m Wed Jun 15 15:06:10 2011 +0100 @@ -30,7 +30,7 @@ options.printFiringRates=1; options.showACF=0; options.showEfferent=1; - showMAP(options) + UTIL_showMAP(options) end % No response, probably caused by hitting 'stop' button @@ -133,4 +133,4 @@ end -path(savePath) \ No newline at end of file +path(savePath)
--- a/multithreshold 1.46/subjGUI_MT.m Mon Jun 13 17:30:57 2011 +0100 +++ b/multithreshold 1.46/subjGUI_MT.m Wed Jun 15 15:06:10 2011 +0100 @@ -1575,12 +1575,13 @@ MAPparamsName, AN_spikesOrProbability); if showPlotsAndDetails - options.showModelParameters=0; + options.printModelParameters=0; options.showModelOutput=1; options.printFiringRates=1; options.showACF=0; options.showEfferent=1; - showMAP(options) + options.surfProbability=0; + UTIL_showMAP(options) end % No response, probably caused by hitting 'stop' button
--- a/multithreshold 1.46/testBM.m Mon Jun 13 17:30:57 2011 +0100 +++ b/multithreshold 1.46/testBM.m Wed Jun 15 15:06:10 2011 +0100 @@ -19,7 +19,7 @@ % levels= 50; nLevels=length(levels); relativeFrequencies=[0.25 .5 .75 1 1.25 1.5 2]; -relativeFrequencies=1; +% relativeFrequencies=1; % refBMdisplacement is the displacement of the BM at threshold % 1 nm disp at threshold (9 kHz, Ruggero) @@ -122,7 +122,7 @@ % Tuning curve if length(relativeFrequencies)>2 - figure(3), subplot(3,nBFs, nBFs+BFno) + figure(3), subplot(3,nBFs, 2*nBFs+BFno) % contour(stimulusFrequencies,levels,peakAmpBM,... % [refBMdisplacement refBMdisplacement],'r') contour(stimulusFrequencies,levels,peakAmpBM,... @@ -138,7 +138,7 @@ % MOC contribution figure(3) - subplot(3,nBFs,2*nBFs+BFno), cla + subplot(3,nBFs,nBFs+BFno), cla plot(levels,20*log10(peakEfferent), 'linewidth',2) ylabel('MOC (dB attenuation)'), xlabel('level') title(['peak MOC: model= ' AN_spikesOrProbability])
--- a/parameterStore/MAPparamsNormal.m Mon Jun 13 17:30:57 2011 +0100 +++ b/parameterStore/MAPparamsNormal.m Wed Jun 15 15:06:10 2011 +0100 @@ -57,7 +57,7 @@ % Acoustic reflex: maximum attenuation should be around 25 dB Price (1966) % i.e. a minimum ratio of 0.056. % 'spikes' model: AR based on brainstem spiking activity (LSR) -OMEParams.rateToAttenuationFactor=0.004; % * N(all ICspikes) +OMEParams.rateToAttenuationFactor=0.006; % * N(all ICspikes) % OMEParams.rateToAttenuationFactor=0; % * N(all ICspikes) % 'probability model': Ar based on AN firing probabilities (LSR) @@ -75,8 +75,7 @@ DRNLParams.BFlist=BFlist; % DRNL nonlinear path -DRNLParams.a=3e4; % nonlinear path gain (below compression threshold) -DRNLParams.a=5e2; % DRNL.a=0 means no OHCs (no nonlinear path) +DRNLParams.a=5e4; % DRNL.a=0 means no OHCs (no nonlinear path) DRNLParams.b=8e-6; % *compression threshold raised compression % DRNLParams.b=1; % b=1 means no compression @@ -100,16 +99,16 @@ % DRNL MOC efferents DRNLParams.MOCdelay = efferentDelay; % must be < segment length! + % 'spikes' model: MOC based on brainstem spiking activity (HSR) -DRNLParams.rateToAttenuationFactor = .009; % strength of MOC -DRNLParams.rateToAttenuationFactor = .004; % strength of MOC +DRNLParams.rateToAttenuationFactor = .01; % strength of MOC % DRNLParams.rateToAttenuationFactor = 0; % strength of MOC +% 'probability' model: MOC based on AN spiking activity (HSR) +DRNLParams.rateToAttenuationFactorProb = .005; % strength of MOC +% DRNLParams.rateToAttenuationFactorProb = .0; % strength of MOC +DRNLParams.MOCrateThreshold =70; % spikes/s probability only -% 'probability' model: MOC based on AN spiking activity (HSR) -DRNLParams.rateToAttenuationFactorProb = .004; % strength of MOC -% DRNLParams.rateToAttenuationFactorProb = .0; % strength of MOC DRNLParams.MOCtau =.1; % smoothing for MOC -DRNLParams.MOCrateThreshold =50; % set to AN rate threshold %% #4 IHC_cilia_RPParams
--- a/testPrograms/demoTwisterProbability.m Mon Jun 13 17:30:57 2011 +0100 +++ b/testPrograms/demoTwisterProbability.m Wed Jun 15 15:06:10 2011 +0100 @@ -10,30 +10,16 @@ %% #2 probability (fast) or spikes (slow) representation -% AN_spikesOrProbability='spikes'; -% or AN_spikesOrProbability='probability'; %% #3 pure tone, harmonic sequence or speech file input -signalType= 'tones'; -duration=0.100; % seconds -duration=0.020; % seconds -sampleRate= 64000; -% toneFrequency= 250:250:8000; % harmonic sequence (Hz) -toneFrequency= 2000; % or a pure tone (Hz8 - -rampDuration=.005; % seconds - -% or signalType= 'file'; fileName='twister_44kHz'; -% fileName='new-da-44khz'; %% #4 rms level -% signal details -leveldBSPL=70; % dB SPL +leveldBSPL=60; % dB SPL %% #5 number of channels in the model @@ -42,34 +28,19 @@ lowestBF=250; highestBF= 8000; BFlist=round(logspace(log10(lowestBF), log10(highestBF), numChannels)); -% or specify your own channel BFs -% BFlist=toneFrequency; - - %% #6 change model parameters paramChanges=[]; -% or -% Parameter changes can be used to change one or more model parameters -% *after* the MAPparams file has been read -% This example declares only one fiber type with a calcium clearance time -% constant of 80e-6 s (HSR fiber) when the probability option is selected. -% switch AN_spikesOrProbability -% case 'probability' -% paramChanges={'IHCpreSynapseParams.tauCa=80e-6;'}; -% otherwise -% paramChanges=[]; -% end %% delare showMap options showMapOptions=[]; % use defaults % or (example: show everything including an smoothed SACF output - showMapOptions.showModelParameters=1; + showMapOptions.printModelParameters=1; showMapOptions.showModelOutput=1; showMapOptions.printFiringRates=1; showMapOptions.showACF=0; - showMapOptions.showEfferent=1; + showMapOptions.showEfferent=0; %% Generate stimuli @@ -99,7 +70,7 @@ toc % the model run is now complete. Now display the results -showMAP(showMapOptions) +UTIL_showMAP(showMapOptions) toc path(restorePath)
--- a/testPrograms/demoTwisterSpikes.m Mon Jun 13 17:30:57 2011 +0100 +++ b/testPrograms/demoTwisterSpikes.m Wed Jun 15 15:06:10 2011 +0100 @@ -1,9 +1,8 @@ function demoTwisterSpikes % MAPdemo runs the MATLAB auditory periphery model (MAP1_14) as far as -% the AN (probabilities) or IC (spikes) with graphical output +% IC (spikes) with graphical output -% Things you might want to change; #1 - #5 %% #1 parameter file name MAPparamsName='Normal'; @@ -11,24 +10,11 @@ %% #2 probability (fast) or spikes (slow) representation AN_spikesOrProbability='spikes'; -% or -% AN_spikesOrProbability='probability'; %% #3 pure tone, harmonic sequence or speech file input -signalType= 'tones'; -duration=0.100; % seconds -duration=0.020; % seconds -sampleRate= 64000; -% toneFrequency= 250:250:8000; % harmonic sequence (Hz) -toneFrequency= 2000; % or a pure tone (Hz8 - -rampDuration=.005; % seconds - -% or signalType= 'file'; fileName='twister_44kHz'; -% fileName='new-da-44khz'; %% #4 rms level @@ -42,34 +28,19 @@ lowestBF=250; highestBF= 8000; BFlist=round(logspace(log10(lowestBF), log10(highestBF), numChannels)); -% or specify your own channel BFs -% BFlist=toneFrequency; - %% #6 change model parameters paramChanges=[]; -% or -% Parameter changes can be used to change one or more model parameters -% *after* the MAPparams file has been read -% This example declares only one fiber type with a calcium clearance time -% constant of 80e-6 s (HSR fiber) when the probability option is selected. -% switch AN_spikesOrProbability -% case 'probability' -% paramChanges={'IHCpreSynapseParams.tauCa=80e-6;'}; -% otherwise -% paramChanges=[]; -% end - %% delare showMap options showMapOptions=[]; % use defaults % or (example: show everything including an smoothed SACF output - showMapOptions.showModelParameters=1; + showMapOptions.printModelParameters=1; showMapOptions.showModelOutput=1; showMapOptions.printFiringRates=1; showMapOptions.showACF=0; - showMapOptions.showEfferent=1; + showMapOptions.showEfferent=0; %% Generate stimuli @@ -103,7 +74,7 @@ toc % the model run is now complete. Now display the results -showMAP(showMapOptions) +UTIL_showMAP(showMapOptions) toc path(restorePath)
--- a/testPrograms/hs_err_pid1016.log Mon Jun 13 17:30:57 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,300 +0,0 @@ -# -# An unexpected error has been detected by Java Runtime Environment: -# -# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000000fef5110, pid=1016, tid=6396 -# -# Java VM: Java HotSpot(TM) 64-Bit Server VM (1.6.0-b105 mixed mode) -# Problematic frame: -# C [awt.dll+0x185110] -# -# If you would like to submit a bug report, please visit: -# http://java.sun.com/webapps/bugreport/crash.jsp -# - ---------------- T H R E A D --------------- - -Current thread (0x000000001181c800): JavaThread "AWT-EventQueue-0" [_thread_in_native, id=6396] - -siginfo: ExceptionCode=0xc0000005, reading address 0xffffffffffffffff - -Registers: -EAX=0x800000ea47fdfdc2, EBX=0x0000000000000001, ECX=0x00000000111de260, EDX=0x0000000011238318 -ESP=0x00000000309cdb80, EBP=0x000000000e690f00, ESI=0x000000001181c990, EDI=0x0000000000000000 -EIP=0x000000000fef5110, EFLAGS=0x0000000000010202 - -Top of Stack: (sp=0x00000000309cdb80) -0x00000000309cdb80: 000000001181c800 0000000000000000 -0x00000000309cdb90: 00000000309cdcd0 0000000015dfd008 -0x00000000309cdba0: 0000000000000001 000000000fef6dd3 -0x00000000309cdbb0: 0000000000000001 000000000e690f00 -0x00000000309cdbc0: 000000001181c990 0000000000000000 -0x00000000309cdbd0: 0000000011238318 00000000169b9f50 -0x00000000309cdbe0: 0000000000000004 00000000152cd810 -0x00000000309cdbf0: 0000000000000000 0000000000000000 -0x00000000309cdc00: 0000000000000001 0000000000000102 -0x00000000309cdc10: 00000000122a308e 0000000000000001 -0x00000000309cdc20: 00000000309cdca8 00000000122afc24 -0x00000000309cdc30: 0000000000000000 0000000026cb7e80 -0x00000000309cdc40: 0000000000000000 0000000015dfd008 -0x00000000309cdc50: 0000000000000001 0000000000000000 -0x00000000309cdc60: 00000000309cdc50 00000000309cdc68 -0x00000000309cdc70: 0000000000000000 00000000309cdcd0 - -Instructions: (pc=0x000000000fef5110) -0x000000000fef5100: e8 5b 72 f9 ff 48 8b 0d 04 9a 08 00 48 8b 04 d8 -0x000000000fef5110: 48 8b 58 30 e8 67 72 f9 ff 48 8b c3 48 83 c4 20 - - -Stack: [0x0000000030950000,0x00000000309d0000), sp=0x00000000309cdb80, free space=502k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -C [awt.dll+0x185110] - -Java frames: (J=compiled Java code, j=interpreted, Vv=VM code) -j sun.awt.Win32GraphicsConfig.getBounds(I)Ljava/awt/Rectangle;+0 -j sun.awt.Win32GraphicsConfig.getBounds()Ljava/awt/Rectangle;+8 -j com.mathworks.mwswing.WindowUtils.getVirtualScreenBounds()Ljava/awt/Rectangle;+98 -j com.mathworks.mwswing.MJUtilities.getVirtualScreenBounds()Ljava/awt/Rectangle;+0 -j com.mathworks.mwswing.desk.DTSingleClientFrame.refineLocation(Lcom/mathworks/mwswing/desk/DTLocation;)Lcom/mathworks/mwswing/desk/DTFloatingLocation;+495 -j com.mathworks.mwswing.desk.DTSingleClientFrame.addClient(Lcom/mathworks/mwswing/desk/DTClient;Lcom/mathworks/mwswing/desk/DTLocation;)V+297 -j com.mathworks.mwswing.desk.Desktop.setClientShowing(Lcom/mathworks/mwswing/desk/DTClient;ZLcom/mathworks/mwswing/desk/DTLocation;ZZ)V+956 -j com.mathworks.mwswing.desk.Desktop.setClientShowing(Lcom/mathworks/mwswing/desk/DTClient;ZLcom/mathworks/mwswing/desk/DTLocation;Z)V+7 -j com.mathworks.mwswing.desk.Desktop.addClient(Ljava/awt/Component;Ljava/lang/String;ZLcom/mathworks/mwswing/desk/DTLocation;ZLcom/mathworks/mwswing/desk/DTClientListener;)V+314 -j com.mathworks.mde.desk.MLDesktop.addClient(Ljava/awt/Component;Ljava/lang/String;ZLcom/mathworks/mwswing/desk/DTLocation;ZLcom/mathworks/mwswing/desk/DTClientListener;)V+40 -j com.mathworks.mde.help.HelpBrowser.createHelpBrowser(Z)Lcom/mathworks/mde/help/HelpBrowser;+90 -j com.mathworks.mde.help.HelpBrowserRegistrar.getHelpBrowser(Z)Lcom/mathworks/mlservices/MLHelpBrowser;+1 -v ~StubRoutines::call_stub -j sun.reflect.NativeMethodAccessorImpl.invoke0(Ljava/lang/reflect/Method;Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+0 -j sun.reflect.NativeMethodAccessorImpl.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;+87 -J java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object; -j com.mathworks.mlservices.MLHelpServices.getRegisteredService(Ljava/lang/String;Ljava/lang/String;Z)Ljava/lang/Object;+71 -j com.mathworks.mlservices.MLHelpServices.instantiateHelpBrowser(Z)Lcom/mathworks/mlservices/MLHelpBrowser;+12 -j com.mathworks.mlservices.MLHelpServices.invoke()V+1 -j com.mathworks.mde.desk.MLDesktop$ShowHelpAction.actionPerformed(Ljava/awt/event/ActionEvent;)V+0 -j javax.swing.AbstractButton.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+84 -j javax.swing.AbstractButton$Handler.actionPerformed(Ljava/awt/event/ActionEvent;)V+5 -j javax.swing.DefaultButtonModel.fireActionPerformed(Ljava/awt/event/ActionEvent;)V+35 -j javax.swing.DefaultButtonModel.setPressed(Z)V+117 -j javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Ljava/awt/event/MouseEvent;)V+35 -j java.awt.AWTEventMulticaster.mouseReleased(Ljava/awt/event/MouseEvent;)V+8 -j java.awt.AWTEventMulticaster.mouseReleased(Ljava/awt/event/MouseEvent;)V+8 -j java.awt.AWTEventMulticaster.mouseReleased(Ljava/awt/event/MouseEvent;)V+8 -j java.awt.Component.processMouseEvent(Ljava/awt/event/MouseEvent;)V+64 -j javax.swing.JComponent.processMouseEvent(Ljava/awt/event/MouseEvent;)V+23 -j com.mathworks.mwswing.MJButton.processMouseEvent(Ljava/awt/event/MouseEvent;)V+37 -j java.awt.Component.processEvent(Ljava/awt/AWTEvent;)V+81 -j java.awt.Container.processEvent(Ljava/awt/AWTEvent;)V+18 -j java.awt.Component.dispatchEventImpl(Ljava/awt/AWTEvent;)V+562 -j java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+42 -J java.awt.LightweightDispatcher.retargetMouseEvent(Ljava/awt/Component;ILjava/awt/event/MouseEvent;)V -j java.awt.LightweightDispatcher.processMouseEvent(Ljava/awt/event/MouseEvent;)Z+139 -j java.awt.LightweightDispatcher.dispatchEvent(Ljava/awt/AWTEvent;)Z+50 -j java.awt.Container.dispatchEventImpl(Ljava/awt/AWTEvent;)V+12 -j java.awt.Window.dispatchEventImpl(Ljava/awt/AWTEvent;)V+19 -J java.awt.EventDispatchThread.pumpOneEventForFilters(I)Z -J java.awt.EventDispatchThread.pumpEventsForFilter(ILjava/awt/Conditional;Ljava/awt/EventFilter;)V -j java.awt.EventDispatchThread.pumpEventsForHierarchy(ILjava/awt/Conditional;Ljava/awt/Component;)V+11 -j java.awt.EventDispatchThread.pumpEvents(ILjava/awt/Conditional;)V+4 -j java.awt.EventDispatchThread.pumpEvents(Ljava/awt/Conditional;)V+3 -j java.awt.EventDispatchThread.run()V+9 -v ~StubRoutines::call_stub - ---------------- P R O C E S S --------------- - -Java Threads: ( => current thread ) - 0x0000000030c4a800 JavaThread "Image Fetcher 0" daemon [_thread_blocked, id=2956] - 0x0000000030c47c00 JavaThread "Inactive RequestProcessor thread [Was:TimedSoftReference/org.openide.util.TimedSoftReference]" daemon [_thread_blocked, id=2312] - 0x0000000030c4a000 JavaThread "Thread-410" [_thread_blocked, id=3948] - 0x0000000030c4b800 JavaThread "Timer-8" [_thread_blocked, id=7832] - 0x0000000030c49800 JavaThread "Thread-94" [_thread_blocked, id=1800] - 0x0000000030c49400 JavaThread "Thread-20" [_thread_blocked, id=3944] - 0x0000000030c48400 JavaThread "Prefs Updater" [_thread_blocked, id=6592] - 0x0000000030c47800 JavaThread "Thread-7" [_thread_blocked, id=6296] - 0x0000000030c47000 JavaThread "Active Reference Queue Daemon" daemon [_thread_blocked, id=3096] - 0x0000000030c46800 JavaThread "Timer-3" daemon [_thread_blocked, id=4900] - 0x0000000030c46000 JavaThread "Timer-2" daemon [_thread_blocked, id=6248] - 0x0000000011809400 JavaThread "TimerQueue" daemon [_thread_blocked, id=2784] -=>0x000000001181c800 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=6396] - 0x000000001179b800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=4168] - 0x0000000011799000 JavaThread "AWT-Shutdown" [_thread_blocked, id=5348] - 0x0000000011798800 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=1520] - 0x000000000fb14800 JavaThread "Timer-0" [_thread_blocked, id=2516] - 0x000000000fa83c00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=6708] - 0x000000000fa81800 JavaThread "CompilerThread1" daemon [_thread_blocked, id=7064] - 0x000000000fa75800 JavaThread "CompilerThread0" daemon [_thread_blocked, id=6704] - 0x000000000fa74400 JavaThread "Attach Listener" daemon [_thread_blocked, id=5696] - 0x000000000fa57000 JavaThread "Finalizer" daemon [_thread_blocked, id=5540] - 0x000000000fa56400 JavaThread "Reference Handler" daemon [_thread_blocked, id=1012] - 0x0000000003d2fc00 JavaThread "main" [_thread_in_native, id=6784] - -Other Threads: - 0x000000000fa52400 VMThread [id=4948] - 0x000000000fa89400 WatcherThread [id=1092] - -VM state:not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: None - -Heap - PSYoungGen total 7488K, used 7456K [0x00000000265a0000, 0x0000000027080000, 0x00000000296a0000) - eden space 7296K, 100% used [0x00000000265a0000,0x0000000026cc0000,0x0000000026cc0000) - from space 192K, 83% used [0x0000000026ce0000,0x0000000026d08000,0x0000000026d10000) - to space 1920K, 0% used [0x0000000026ea0000,0x0000000026ea0000,0x0000000027080000) - PSOldGen total 45376K, used 35394K [0x000000001d2a0000, 0x000000001fef0000, 0x00000000265a0000) - object space 45376K, 78% used [0x000000001d2a0000,0x000000001f530b20,0x000000001fef0000) - PSPermGen total 83392K, used 45466K [0x00000000152a0000, 0x000000001a410000, 0x000000001d2a0000) - object space 83392K, 54% used [0x00000000152a0000,0x0000000017f069f0,0x000000001a410000) - -Dynamic libraries: -0x0000000140000000 - 0x0000000140138000 C:\Program Files\MATLAB\R2008a\bin\win64\MATLAB.exe -0x0000000076d20000 - 0x0000000076ec9000 C:\Windows\SYSTEM32\ntdll.dll -0x0000000076b00000 - 0x0000000076c1f000 C:\Windows\system32\kernel32.dll -0x000007fefcd20000 - 0x000007fefcd8b000 C:\Windows\system32\KERNELBASE.dll -0x0000000180000000 - 0x0000000180401000 C:\Program Files\MATLAB\R2008a\bin\win64\libut.dll -0x000007fefdd40000 - 0x000007fefdd57000 C:\Windows\system32\imagehlp.dll -0x000007fefdfb0000 - 0x000007fefe04f000 C:\Windows\system32\msvcrt.dll -0x0000000076ef0000 - 0x0000000076ef7000 C:\Windows\system32\PSAPI.DLL -0x00000000011f0000 - 0x0000000001218000 C:\Program Files\MATLAB\R2008a\bin\win64\LIBEXPAT.dll -0x0000000073330000 - 0x00000000733f9000 C:\Windows\WinSxS\amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.5592_none_88e45feb2faab9ce\MSVCR80.dll -0x000000004a800000 - 0x000000004a917000 C:\Program Files\MATLAB\R2008a\bin\win64\icuuc36.dll -0x000007fefef50000 - 0x000007feff02b000 C:\Windows\system32\ADVAPI32.dll -0x000007fefd940000 - 0x000007fefd95f000 C:\Windows\SYSTEM32\sechost.dll -0x000007fefe050000 - 0x000007fefe17d000 C:\Windows\system32\RPCRT4.dll -0x0000000001220000 - 0x0000000001223000 C:\Program Files\MATLAB\R2008a\bin\win64\icudt36.dll -0x000000004ab00000 - 0x000000004ab0f000 C:\Program Files\MATLAB\R2008a\bin\win64\icuio36.dll -0x0000000001250000 - 0x0000000001356000 C:\Program Files\MATLAB\R2008a\bin\win64\icuin36.dll -0x0000000071c30000 - 0x0000000071d39000 C:\Windows\WinSxS\amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.5592_none_88e45feb2faab9ce\MSVCP80.dll -0x0000000076c20000 - 0x0000000076d1a000 C:\Windows\system32\USER32.dll -0x000007fefd1c0000 - 0x000007fefd227000 C:\Windows\system32\GDI32.dll -0x000007fefd150000 - 0x000007fefd15e000 C:\Windows\system32\LPK.dll -0x000007fefd870000 - 0x000007fefd939000 C:\Windows\system32\USP10.dll -0x0000000001370000 - 0x00000000014e4000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwservices.dll -0x0000000001500000 - 0x0000000001570000 C:\Program Files\MATLAB\R2008a\bin\win64\libmx.dll -0x0000000001580000 - 0x0000000001597000 C:\Program Files\MATLAB\R2008a\bin\win64\zlib1.dll -0x00000000015a0000 - 0x0000000001648000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwmathutil.dll -0x0000000001660000 - 0x00000000016b5000 C:\Program Files\MATLAB\R2008a\bin\win64\mpath.dll -0x00000000016d0000 - 0x00000000016f1000 C:\Program Files\MATLAB\R2008a\bin\win64\mlutil.dll -0x000007fef9110000 - 0x000007fef91b0000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_a4d6a923711520a9\COMCTL32.dll -0x000007fefde30000 - 0x000007fefdec7000 C:\Windows\system32\comdlg32.dll -0x000007fefdcc0000 - 0x000007fefdd31000 C:\Windows\system32\SHLWAPI.dll -0x000007fefe180000 - 0x000007fefef08000 C:\Windows\system32\SHELL32.dll -0x000007fefc100000 - 0x000007fefc116000 C:\Windows\system32\NETAPI32.dll -0x000007fefc0f0000 - 0x000007fefc0fc000 C:\Windows\system32\netutils.dll -0x000007fefc7c0000 - 0x000007fefc7e3000 C:\Windows\system32\srvcli.dll -0x000007fefc140000 - 0x000007fefc155000 C:\Windows\system32\wkscli.dll -0x000007fefdd60000 - 0x000007fefddad000 C:\Windows\system32\WS2_32.dll -0x000007fefef40000 - 0x000007fefef48000 C:\Windows\system32\NSI.dll -0x0000000001710000 - 0x0000000001765000 C:\Program Files\MATLAB\R2008a\bin\win64\mcr.dll -0x0000000001780000 - 0x00000000017a5000 C:\Program Files\MATLAB\R2008a\bin\win64\iqm.dll -0x00000000017c0000 - 0x00000000017e1000 C:\Program Files\MATLAB\R2008a\bin\win64\bridge.dll -0x0000000001800000 - 0x0000000001811000 C:\Program Files\MATLAB\R2008a\bin\win64\libmex.dll -0x0000000001830000 - 0x00000000018bc000 C:\Program Files\MATLAB\R2008a\bin\win64\m_dispatcher.dll -0x00000000018d0000 - 0x00000000018f5000 C:\Program Files\MATLAB\R2008a\bin\win64\datasvcs.dll -0x0000000012000000 - 0x0000000012295000 C:\Program Files\MATLAB\R2008a\bin\win64\xerces-c_2_7.dll -0x0000000001920000 - 0x00000000021b1000 C:\Program Files\MATLAB\R2008a\bin\win64\m_interpreter.dll -0x00000000021d0000 - 0x0000000002201000 C:\Program Files\MATLAB\R2008a\bin\win64\libmat.dll -0x0000000002220000 - 0x0000000002325000 C:\Program Files\MATLAB\R2008a\bin\win64\libhdf5.dll -0x0000000002330000 - 0x000000000239f000 C:\Program Files\MATLAB\R2008a\bin\win64\profiler.dll -0x00000000023b0000 - 0x00000000023ba000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwmathrng.dll -0x00000000023d0000 - 0x00000000023ea000 C:\Program Files\MATLAB\R2008a\bin\win64\m_pcodeio.dll -0x0000000002400000 - 0x000000000244a000 C:\Program Files\MATLAB\R2008a\bin\win64\m_ir.dll -0x0000000002460000 - 0x0000000002a1b000 C:\Program Files\MATLAB\R2008a\bin\win64\m_parser.dll -0x0000000002a30000 - 0x0000000002a42000 C:\Program Files\MATLAB\R2008a\bin\win64\ir_xfmr.dll -0x0000000002a60000 - 0x0000000002c7b000 C:\Program Files\MATLAB\R2008a\bin\win64\mcos.dll -0x0000000002c90000 - 0x0000000002c9c000 C:\Program Files\MATLAB\R2008a\bin\win64\mtok.dll -0x0000000002cb0000 - 0x0000000002cd0000 C:\Program Files\MATLAB\R2008a\bin\win64\m_pcodegen.dll -0x000007fef4250000 - 0x000007fef4375000 C:\Windows\system32\dbghelp.dll -0x0000000002ce0000 - 0x0000000002cf0000 C:\Program Files\MATLAB\R2008a\bin\win64\boost_thread-vc80-mt-1_34_1.dll -0x0000000002d00000 - 0x0000000002dc0000 C:\Program Files\MATLAB\R2008a\bin\win64\udd.dll -0x0000000002dd0000 - 0x0000000002f12000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwgui.dll -0x0000000002f30000 - 0x000000000316a000 C:\Program Files\MATLAB\R2008a\bin\win64\hg.dll -0x0000000003180000 - 0x00000000031d6000 C:\Program Files\MATLAB\R2008a\bin\win64\jmi.dll -0x00000000031f0000 - 0x000000000322e000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwhardcopy.dll -0x0000000003240000 - 0x000000000329c000 C:\Program Files\MATLAB\R2008a\bin\win64\libuij.dll -0x00000000032b0000 - 0x000000000353c000 C:\Program Files\MATLAB\R2008a\bin\win64\numerics.dll -0x0000000003550000 - 0x000000000355c000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwblas.dll -0x0000000003570000 - 0x000000000357f000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwbinder.dll -0x0000000003590000 - 0x00000000035b4000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwlapack.dll -0x00000000035d0000 - 0x00000000035db000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwfftw.dll -0x00000000035f0000 - 0x0000000003625000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwrookfastbp.dll -0x0000000003640000 - 0x000000000366e000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwma57.dll -0x0000000010000000 - 0x00000000100d3000 C:\Program Files\MATLAB\R2008a\bin\win64\libifcoremd.dll -0x0000000003680000 - 0x000000000389d000 C:\Program Files\MATLAB\R2008a\bin\win64\libmmd.dll -0x00000000038a0000 - 0x00000000038a9000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwcsparse.dll -0x00000000038c0000 - 0x000000000398a000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwumfpack.dll -0x00000000039a0000 - 0x00000000039ad000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwamd.dll -0x00000000039c0000 - 0x0000000003a52000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwcholmod.dll -0x0000000003a70000 - 0x0000000003a7c000 C:\Program Files\MATLAB\R2008a\bin\win64\libmwcolamd.dll -0x0000000003a90000 - 0x0000000003b49000 C:\Program Files\MATLAB\R2008a\bin\win64\uiw.dll -0x0000000003b60000 - 0x0000000003b6a000 C:\Program Files\MATLAB\R2008a\bin\win64\uinone.dll -0x000000006e030000 - 0x000000006e1cc000 C:\Windows\WinSxS\amd64_microsoft.vc80.mfc_1fc8b3b9a1e18e3b_8.0.50727.5592_none_8448f49f328da8c3\MFC80.DLL -0x000007fefaf90000 - 0x000007fefb001000 C:\Windows\system32\WINSPOOL.DRV -0x000007fefd230000 - 0x000007fefd433000 C:\Windows\system32\ole32.dll -0x000007fefded0000 - 0x000007fefdfa7000 C:\Windows\system32\OLEAUT32.dll -0x0000000003b80000 - 0x0000000003c10000 C:\Program Files\MATLAB\R2008a\bin\win64\udd_mi.dll -0x0000000003c20000 - 0x0000000003c38000 C:\Program Files\MATLAB\R2008a\bin\win64\mwoles05.DLL -0x0000000003c50000 - 0x0000000003cb9000 C:\Program Files\MATLAB\R2008a\bin\win64\comcli.dll -0x0000000071c10000 - 0x0000000071c30000 C:\Windows\WinSxS\amd64_microsoft.vc80.atl_1fc8b3b9a1e18e3b_8.0.50727.5592_none_8a1e1b372ed7b012\ATL80.DLL -0x0000000003cd0000 - 0x0000000003cde000 C:\Program Files\MATLAB\R2008a\bin\win64\mlautoregister.dll -0x000007fefef10000 - 0x000007fefef3e000 C:\Windows\system32\IMM32.DLL -0x000007fefd040000 - 0x000007fefd149000 C:\Windows\system32\MSCTF.dll -0x000000006fa00000 - 0x000000006fa3f000 C:\PROGRA~2\Sophos\SOPHOS~1\SOPHOS~2.DLL -0x0000000007740000 - 0x000000000810e000 C:\Program Files\MATLAB\R2008a\bin\win64\mkl.dll -0x0000000003e50000 - 0x0000000003e9b000 C:\Program Files\MATLAB\R2008a\bin\win64\libguide40.dll -0x0000000003eb0000 - 0x0000000003eb8000 C:\Program Files\MATLAB\R2008a\bin\win64\mklcompat.dll -0x0000000008110000 - 0x00000000086b7000 C:\Program Files\MATLAB\R2008a\bin\win64\mllapack.dll -0x0000000007310000 - 0x0000000007404000 C:\Program Files\MATLAB\R2008a\bin\win64\libfftw3i.dll -0x0000000007410000 - 0x00000000074fe000 C:\Program Files\MATLAB\R2008a\bin\win64\libfftw3f.dll -0x000007fefcc70000 - 0x000007fefcc7f000 C:\Windows\system32\profapi.dll -0x000007fefcba0000 - 0x000007fefcbaf000 C:\Windows\system32\CRYPTBASE.dll -0x000007fefb790000 - 0x000007fefb984000 C:\Windows\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_fa396087175ac9ac\comctl32.dll -0x000007fefd960000 - 0x000007fefdb37000 C:\Windows\system32\SETUPAPI.dll -0x000007fefcfe0000 - 0x000007fefd016000 C:\Windows\system32\CFGMGR32.dll -0x000007fefd020000 - 0x000007fefd03a000 C:\Windows\system32\DEVOBJ.dll -0x000007fefd570000 - 0x000007fefd609000 C:\Windows\system32\CLBCatQ.DLL -0x000007fefb1f0000 - 0x000007fefb31c000 C:\Windows\system32\propsys.dll -0x000007fefa7a0000 - 0x000007fefa7cd000 C:\Windows\system32\ntmarta.dll -0x000007fefd160000 - 0x000007fefd1b2000 C:\Windows\system32\WLDAP32.dll -0x000007fef9e00000 - 0x000007fef9e27000 C:\Windows\system32\iphlpapi.dll -0x000007fef9df0000 - 0x000007fef9dfb000 C:\Windows\system32\WINNSI.DLL -0x000007fefc340000 - 0x000007fefc39b000 C:\Windows\system32\DNSAPI.dll -0x000007fef99d0000 - 0x000007fef99e1000 C:\Windows\system32\dhcpcsvc6.DLL -0x000007fef98e0000 - 0x000007fef98f8000 C:\Windows\system32\dhcpcsvc.DLL -0x000007fefcb10000 - 0x000007fefcb35000 C:\Windows\system32\SspiCli.dll -0x000000006e860000 - 0x000000006e863000 C:\Windows\system32\icmp.Dll -0x000000000eeb0000 - 0x000000000f401000 C:\Program Files\MATLAB\R2008a\sys\java\jre\win64\jre1.6.0\bin\server\jvm.dll -0x000007fefa880000 - 0x000007fefa8bb000 C:\Windows\system32\WINMM.dll -0x0000000006b50000 - 0x0000000006b5a000 C:\Program Files\MATLAB\R2008a\sys\java\jre\win64\jre1.6.0\bin\hpi.dll -0x0000000006b70000 - 0x0000000006b7e000 C:\Program Files\MATLAB\R2008a\sys\java\jre\win64\jre1.6.0\bin\verify.dll -0x0000000006ff0000 - 0x0000000007017000 C:\Program Files\MATLAB\R2008a\sys\java\jre\win64\jre1.6.0\bin\java.dll -0x0000000006b80000 - 0x0000000006b92000 C:\Program Files\MATLAB\R2008a\sys\java\jre\win64\jre1.6.0\bin\zip.dll -0x0000000007500000 - 0x0000000007516000 C:\Program Files\MATLAB\R2008a\bin\win64\nativejava.dll -0x0000000007520000 - 0x0000000007536000 C:\Program Files\MATLAB\R2008a\bin\win64\nativejmi.dll -0x00000000087d0000 - 0x00000000087d7000 C:\Program Files\MATLAB\R2008a\bin\win64\nativeservices.dll -0x000000000fd70000 - 0x000000000ffc0000 C:\Program Files\MATLAB\R2008a\sys\java\jre\win64\jre1.6.0\bin\awt.dll -0x0000000011e60000 - 0x0000000011ec9000 C:\Program Files\MATLAB\R2008a\sys\java\jre\win64\jre1.6.0\bin\fontmanager.dll -0x00000000089b0000 - 0x00000000089c7000 C:\Program Files\MATLAB\R2008a\sys\java\jre\win64\jre1.6.0\bin\net.dll - -VM Arguments: -jvm_args: -Xss512k -XX:PermSize=32M -Xms64m -XX:NewRatio=3 -XX:MaxPermSize=128M -Xmx196m -XX:MaxDirectMemorySize=2147400000 -Dsun.java2d.noddraw=true -Dsun.awt.nopixfmt=true -Xshare:off -Xrs -Djava.library.path=C:\Program Files\MATLAB\R2008a\bin\win64 vfprintf abort -java_command: <unknown> -Launcher Type: generic - -Environment Variables: -CLASSPATH=.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip -PATH=C:\Program Files (x86)\Nokia\PC Connectivity Solution\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Intel\DMIX;C:\Program Files (x86)\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Wave Systems Corp\Gemalto\Access Client\v5\;c:\Program Files\WIDCOMM\Bluetooth Software\;c:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared\;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared\;C:\Program Files (x86)\Common Files\Adobe\AGL;C:\Program Files\MATLAB\R2010b\bin;C:\Program Files\MATLAB\R2010a\bin;C:\Program Files\MATLAB\R2008a\bin;C:\Program Files\MATLAB\R2008a\bin\win64;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Microsoft Windows Performance Toolkit\ -USERNAME=rmeddis -OS=Windows_NT -PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 37 Stepping 2, GenuineIntel - - - ---------------- S Y S T E M --------------- - -OS: Windows NT 6.1 Build 7601 Service Pack 1 - -CPU:total 4 em64t ht - -Memory: 4k page, physical 8181592k(5524620k free), swap 16361336k(13575508k free) - -vm_info: Java HotSpot(TM) 64-Bit Server VM (1.6.0-b105) for windows-amd64, built on Nov 29 2006 00:38:01 by "java_re" with unknown MS VC++:1400 -
--- a/testPrograms/html/myConv.html Mon Jun 13 17:30:57 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,172 +0,0 @@ - -<!DOCTYPE html - PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"> -<html xmlns:mwsh="http://www.mathworks.com/namespace/mcode/v1/syntaxhighlight.dtd"> - <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - - <!-- -This HTML is auto-generated from an M-file. -To make changes, update the M-file and republish this document. - --> - <title>myConv</title> - <meta name="generator" content="MATLAB 7.6"> - <meta name="date" content="2011-06-05"> - <meta name="m-file" content="myConv"><style> - -body { - background-color: white; - margin:10px; -} - -h1 { - color: #990000; - font-size: x-large; -} - -h2 { - color: #990000; - font-size: medium; -} - -/* Make the text shrink to fit narrow windows, but not stretch too far in -wide windows. */ -p,h1,h2,div.content div { - max-width: 600px; - /* Hack for IE6 */ - width: auto !important; width: 600px; -} - -pre.codeinput { - background: #EEEEEE; - padding: 10px; -} -@media print { - pre.codeinput {word-wrap:break-word; width:100%;} -} - -span.keyword {color: #0000FF} -span.comment {color: #228B22} -span.string {color: #A020F0} -span.untermstring {color: #B20000} -span.syscmd {color: #B28C00} - -pre.codeoutput { - color: #666666; - padding: 10px; -} - -pre.error { - color: red; -} - -p.footer { - text-align: right; - font-size: xx-small; - font-weight: lighter; - font-style: italic; - color: gray; -} - - </style></head> - <body> - <div class="content"> - <h2>Contents</h2> - <div> - <ul> - <li><a href="#3">testing convolution speculation</a></li> - <li><a href="#4">convolution function</a></li> - <li><a href="#5">normalise conv function</a></li> - <li><a href="#6">adjust for spike current</a></li> - <li><a href="#7">convolution</a></li> - </ul> - </div><pre class="codeinput">signalDuration=.1; -spikeTime= signalDuration/2; -<span class="keyword">for</span> sampleRate=[1000 2000]; -</pre><pre class="codeinput"> disp([<span class="string">'sample rate= '</span> num2str(sampleRate)]) -</pre><pre class="codeoutput">sample rate= 1000 -</pre><pre class="codeoutput">sample rate= 2000 -</pre><h2>testing convolution speculation<a name="3"></a></h2><pre class="codeinput">dt= 1/sampleRate; -signalLength=round(signalDuration/dt); -spikeArray=zeros(1,signalLength); -spikeLocation=round(spikeTime/dt); -spikeArray(spikeLocation)=1; -disp([<span class="string">'length of spike array= '</span> num2str(length(spikeArray))]) -t=dt*(1:length(spikeArray)); -plot(t, spikeArray) -</pre><pre class="codeoutput">length of spike array= 100 -</pre><img vspace="5" hspace="5" src="myConv_01.png"> <pre class="codeoutput">length of spike array= 200 -</pre><img vspace="5" hspace="5" src="myConv_06.png"> <h2>convolution function<a name="4"></a></h2><pre class="codeinput">CNspikeToCurrentTau=0.01; -t=dt:dt:3*CNspikeToCurrentTau; -CNalphaFunction=<span class="keyword">...</span> - (1/CNspikeToCurrentTau)*t.*exp(-t/CNspikeToCurrentTau); - -plot(t, CNalphaFunction) -</pre><img vspace="5" hspace="5" src="myConv_02.png"> <img vspace="5" hspace="5" src="myConv_07.png"> <h2>normalise conv function<a name="5"></a></h2><pre class="codeinput">CNalphaFunction=CNalphaFunction/sum(CNalphaFunction); -plot(t, CNalphaFunction) -disp([<span class="string">'area under function= '</span> num2str(sum(CNalphaFunction))]) -</pre><pre class="codeoutput">area under function= 1 -</pre><img vspace="5" hspace="5" src="myConv_03.png"> <pre class="codeoutput">area under function= 1 -</pre><img vspace="5" hspace="5" src="myConv_08.png"> <h2>adjust for spike current<a name="6"></a></h2><pre class="codeinput">CNcurrentPerSpike=2; -CNalphaFunction=CNalphaFunction*CNcurrentPerSpike; -plot(t, CNalphaFunction) -</pre><img vspace="5" hspace="5" src="myConv_04.png"> <img vspace="5" hspace="5" src="myConv_09.png"> <h2>convolution<a name="7"></a></h2><pre class="codeinput">result=conv(spikeArray,CNalphaFunction); -t=dt*(1:length(result)); -plot(t, result) -disp([<span class="string">'area under function= '</span> num2str(sum(result))]) -</pre><pre class="codeoutput">area under function= 2 -</pre><img vspace="5" hspace="5" src="myConv_05.png"> <pre class="codeoutput">area under function= 2 -</pre><img vspace="5" hspace="5" src="myConv_10.png"> <pre class="codeinput"><span class="keyword">end</span> -</pre><p class="footer"><br> - Published with MATLAB® 7.6<br></p> - </div> - <!-- -##### SOURCE BEGIN ##### -signalDuration=.1; -spikeTime= signalDuration/2; -for sampleRate=[1000 2000]; - disp(['sample rate= ' num2str(sampleRate)]) - -%% testing convolution speculation -dt= 1/sampleRate; -signalLength=round(signalDuration/dt); -spikeArray=zeros(1,signalLength); -spikeLocation=round(spikeTime/dt); -spikeArray(spikeLocation)=1; -disp(['length of spike array= ' num2str(length(spikeArray))]) -t=dt*(1:length(spikeArray)); -plot(t, spikeArray) - -%% convolution function -CNspikeToCurrentTau=0.01; -t=dt:dt:3*CNspikeToCurrentTau; -CNalphaFunction=... - (1/CNspikeToCurrentTau)*t.*exp(-t/CNspikeToCurrentTau); - -plot(t, CNalphaFunction) - -%% normalise conv function -CNalphaFunction=CNalphaFunction/sum(CNalphaFunction); -plot(t, CNalphaFunction) -disp(['area under function= ' num2str(sum(CNalphaFunction))]) - -%% adjust for spike current -CNcurrentPerSpike=2; -CNalphaFunction=CNalphaFunction*CNcurrentPerSpike; -plot(t, CNalphaFunction) - -%% convolution -result=conv(spikeArray,CNalphaFunction); -t=dt*(1:length(result)); -plot(t, result) -disp(['area under function= ' num2str(sum(result))]) - -end - - - - -##### SOURCE END ##### ---> - </body> -</html> \ No newline at end of file
--- a/testPrograms/myConv.m Mon Jun 13 17:30:57 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,43 +0,0 @@ -signalDuration=.1; -spikeTime= signalDuration/2; -for sampleRate=[1000 2000]; - disp(['sample rate= ' num2str(sampleRate)]) - -%% testing convolution speculation -dt= 1/sampleRate; -signalLength=round(signalDuration/dt); -spikeArray=zeros(1,signalLength); -spikeLocation=round(spikeTime/dt); -spikeArray(spikeLocation)=1; -disp(['length of spike array= ' num2str(length(spikeArray))]) -t=dt*(1:length(spikeArray)); -plot(t, spikeArray) - -%% convolution function -CNspikeToCurrentTau=0.01; -t=dt:dt:3*CNspikeToCurrentTau; -CNalphaFunction=... - (1/CNspikeToCurrentTau)*t.*exp(-t/CNspikeToCurrentTau); - -plot(t, CNalphaFunction) - -%% normalise conv function -CNalphaFunction=CNalphaFunction/sum(CNalphaFunction); -plot(t, CNalphaFunction) -disp(['area under function= ' num2str(sum(CNalphaFunction))]) - -%% adjust for spike current -CNcurrentPerSpike=2; -CNalphaFunction=CNalphaFunction*CNcurrentPerSpike; -plot(t, CNalphaFunction) - -%% convolution -result=conv(spikeArray,CNalphaFunction); -t=dt*(1:length(result)); -plot(t, result) -disp(['area under function= ' num2str(sum(result))]) - -end - - -
--- a/testPrograms/showMAP.m Mon Jun 13 17:30:57 2011 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,275 +0,0 @@ -function showMAP (options) -% defaults -% options.showModelParameters=1; -% options.showModelOutput=1; -% options.printFiringRates=1; -% options.showACF=1; -% options.showEfferent=1; -% options.surfProbability=0; -% options.fileName=[]; - -dbstop if warning - -global dt ANdt saveAN_spikesOrProbability savedBFlist saveMAPparamsName... - savedInputSignal TMoutput OMEoutput ARattenuation ... - DRNLoutput IHC_cilia_output IHCrestingCiliaCond IHCrestingV... - IHCoutput ANprobRateOutput ANoutput savePavailable tauCas ... - CNoutput ICoutput ICmembraneOutput ICfiberTypeRates MOCattenuation -global OMEParams DRNLParams IHC_cilia_RPParams IHCpreSynapseParams -global AN_IHCsynapseParams MacGregorParams MacGregorMultiParams - - -restorePath=path; -addpath ( ['..' filesep 'utilities'], ['..' filesep 'parameterStore']) - -if nargin<1 - options.showModelParameters=1; - options.showModelOutput=1; - options.printFiringRates=1; - options.showACF=0; - options.showEfferent=1; - options.surfProbability=0; - options.fileName=[]; -end - -if options.showModelParameters - % Read parameters from MAPparams<***> file in 'parameterStore' folder - % and print out all parameters - cmd=['MAPparams' saveMAPparamsName ... - '(-1, 1/dt, 1);']; - eval(cmd); -end - -if options.printFiringRates - %% print summary firing rates - fprintf('\n\n') - disp('summary') - disp(['AR: ' num2str(min(ARattenuation))]) - disp(['MOC: ' num2str(min(min(MOCattenuation)))]) - nANfiberTypes=length(tauCas); - if strcmp(saveAN_spikesOrProbability, 'spikes') - nANfibers=size(ANoutput,1); - nHSRfibers=nANfibers/nANfiberTypes; - duration=size(TMoutput,2)*dt; - disp(['AN: ' num2str(sum(sum(ANoutput(end-nHSRfibers+1:end,:)))/... - (nHSRfibers*duration))]) - - nCNneurons=size(CNoutput,1); - nHSRCNneuronss=nCNneurons/nANfiberTypes; - disp(['CN: ' num2str(sum(sum(CNoutput(end-nHSRCNneuronss+1:end,:)))... - /(nHSRCNneuronss*duration))]) - disp(['IC: ' num2str(sum(sum(ICoutput))/duration)]) - % disp(['IC by type: ' num2str(mean(ICfiberTypeRates,2)')]) - else - disp(['AN: ' num2str(mean(mean(ANprobRateOutput)))]) - [PSTH pointsPerBin]= UTIL_makePSTH(ANprobRateOutput, dt, 0.001); - disp(['max max AN: ' num2str(max(max(... - PSTH/pointsPerBin )))]) - end -end - - -%% figure (99) summarises main model output -if options.showModelOutput - plotInstructions.figureNo=99; - signalRMS=mean(savedInputSignal.^2)^0.5; - signalRMSdb=20*log10(signalRMS/20e-6); - - % plot signal (1) - plotInstructions.displaydt=dt; - plotInstructions.numPlots=6; - plotInstructions.subPlotNo=1; - plotInstructions.title=... - ['stimulus: ' num2str(signalRMSdb, '%4.0f') ' dB SPL']; - r=size(savedInputSignal,1); - if r==1, savedInputSignal=savedInputSignal'; end - UTIL_plotMatrix(savedInputSignal', plotInstructions); - - % stapes (2) - plotInstructions.subPlotNo=2; - plotInstructions.title= ['stapes displacement']; - UTIL_plotMatrix(OMEoutput, plotInstructions); - - % DRNL (3) - plotInstructions.subPlotNo=3; - plotInstructions.title= ['BM displacement']; - plotInstructions.yValues= savedBFlist; - UTIL_plotMatrix(DRNLoutput, plotInstructions); - - switch saveAN_spikesOrProbability - case 'spikes' - % AN (4) - plotInstructions.displaydt=ANdt; - plotInstructions.title='AN'; - plotInstructions.subPlotNo=4; - plotInstructions.yLabel='BF'; - plotInstructions.yValues= savedBFlist; - plotInstructions.rasterDotSize=1; - plotInstructions.plotDivider=1; - if sum(sum(ANoutput))<100 - plotInstructions.rasterDotSize=3; - end - UTIL_plotMatrix(ANoutput, plotInstructions); - - % CN (5) - plotInstructions.displaydt=ANdt; - plotInstructions.subPlotNo=5; - plotInstructions.title='CN spikes'; - if sum(sum(CNoutput))<100 - plotInstructions.rasterDotSize=3; - end - UTIL_plotMatrix(CNoutput, plotInstructions); - - % IC (6) - plotInstructions.displaydt=ANdt; - plotInstructions.subPlotNo=6; - plotInstructions.title='IC'; - if size(ICoutput,1)>3 - if sum(sum(ICoutput))<100 - plotInstructions.rasterDotSize=3; - end - UTIL_plotMatrix(ICoutput, plotInstructions); - else - plotInstructions.title='IC (HSR) membrane potential'; - plotInstructions.displaydt=dt; - plotInstructions.yLabel='V'; - plotInstructions.zValuesRange= [-.1 0]; - UTIL_plotMatrix(ICmembraneOutput, plotInstructions); - end - - otherwise % probability (4-6) - plotInstructions.displaydt=dt; - plotInstructions.numPlots=2; - plotInstructions.subPlotNo=2; - plotInstructions.yLabel='BF'; - if nANfiberTypes>1, - plotInstructions.yLabel='LSR HSR'; - plotInstructions.plotDivider=1; - end - plotInstructions.title='AN - spike probability'; - UTIL_plotMatrix(ANprobRateOutput, plotInstructions); - end -end - -%% surface plot of probability -if options.surfProbability - figure(97), clf - % select only HSR fibers at the bottom of the matrix - ANprobRateOutput= ANprobRateOutput(end-length(savedBFlist)+1:end,:); - [nY nX]=size(ANprobRateOutput); - if nY>2 - time=dt*(1:nX); - surf(time, savedBFlist, ANprobRateOutput) - shading interp - set(gca, 'yScale','log') - xlim([0 max(time)]), ylim([0 max(savedBFlist)]), zlim([0 1000]) - xlabel('time (s)') - ylabel('best frequency (Hz)') - zlabel('spike rate') - view([-20 60]) - if isfield(options, 'fileName') - title ([options.fileName ': ' num2str(signalRMSdb,'% 3.0f') ' dB']) - else - title ([ num2str(signalRMSdb,'% 3.0f') ' dB']) - end - - end -end - - -%% plot efferent control values as dB -if options.showEfferent - plotInstructions=[]; - plotInstructions.figureNo=98; - figure(98), clf - plotInstructions.displaydt=dt; - plotInstructions.numPlots=2; - plotInstructions.subPlotNo=1; - plotInstructions.zValuesRange=[ -25 0]; - plotInstructions.title= ['AR strength. Signal level= ' ... - num2str(signalRMSdb,'%4.0f') ' dB SPL']; - UTIL_plotMatrix(20*log10(ARattenuation), plotInstructions); - - plotInstructions.subPlotNo=2; - plotInstructions.yValues= savedBFlist; - plotInstructions.yLabel= 'BF'; - plotInstructions.title= ['MOC strength']; - plotInstructions.zValuesRange=[ -25 0]; - subplot(2,1,2) - % imagesc(MOCattenuation) - UTIL_plotMatrix(20*log10(MOCattenuation), plotInstructions); - colorbar -end - - %% ACF plot if required - if options.showACF - tic - method.dt=dt; - method.segmentNo=1; - method.nonlinCF=savedBFlist; - - minPitch= 80; maxPitch= 4000; numPitches=100; % specify lags - pitches=10.^ linspace(log10(minPitch), log10(maxPitch),numPitches); - pitches=fliplr(pitches); - filteredSACFParams.lags=1./pitches; % autocorrelation lags vector - filteredSACFParams.acfTau= .003; % time constant of running ACF - filteredSACFParams.lambda= 0.12; % slower filter to smooth ACF - filteredSACFParams.lambda= 0.01; % slower filter to smooth ACF - - filteredSACFParams.plotACFs=0; % special plot (see code) - filteredSACFParams.plotFilteredSACF=0; % 0 plots unfiltered ACFs - filteredSACFParams.plotMoviePauses=.3; % special plot (see code) - - filteredSACFParams.usePressnitzer=0; % attenuates ACF at long lags - filteredSACFParams.lagsProcedure= 'useAllLags'; - % filteredSACFParams.lagsProcedure= 'useBernsteinLagWeights'; - % filteredSACFParams.lagsProcedure= 'omitShortLags'; - filteredSACFParams.criterionForOmittingLags=3; - filteredSACFParams.plotACFsInterval=200; - - if filteredSACFParams.plotACFs - % plot original waveform on ACF plot - figure(13), clf - subplot(4,1,1) - t=dt*(1:length(savedInputSignal)); - plot(t,savedInputSignal) - xlim([0 t(end)]) - title(['stimulus: ' num2str(signalRMSdb, '%4.0f') ' dB SPL']); - end - - % plot original waveform on summary/smoothed ACF plot - figure(96), clf - subplot(2,1,1) - t=dt*(1:length(savedInputSignal)); - plot(t,savedInputSignal) - xlim([0 t(end)]) - title(['stimulus: ' num2str(signalRMSdb, '%4.0f') ' dB SPL']); - - - % compute ACF - switch saveAN_spikesOrProbability - case 'probability' - inputToACF=ANprobRateOutput.^0.5; - otherwise - inputToACF=ANoutput; - end - - disp ('computing ACF...') - [P, BFlist, sacf, boundaryValue] = ... - filteredSACF(inputToACF, method, filteredSACFParams); - disp(' ACF done.') - - % SACF - subplot(2,1,2) - imagesc(P) - ylabel('periodicities (Hz)') - xlabel('time (s)') - title(['running smoothed (root) SACF. ' saveAN_spikesOrProbability ' input']) - pt=[1 get(gca,'ytick')]; % force top xtick to show - set(gca,'ytick',pt) - set(gca,'ytickLabel', round(pitches(pt))) - tt=get(gca,'xtick'); - set(gca,'xtickLabel', round(100*t(tt))/100) - end - - path(restorePath)
--- a/testPrograms/test_MAP1_14.m Mon Jun 13 17:30:57 2011 +0100 +++ b/testPrograms/test_MAP1_14.m Wed Jun 15 15:06:10 2011 +0100 @@ -22,7 +22,7 @@ % Set the signal rms level (in leveldBSPL) % % #5 -% Indentify the channels in terms of their best frequencies in the vector +% Identify the channels in terms of their best frequencies in the vector % BFlist. % % Last minute changes to the parameters fetched earlier can be made using @@ -39,30 +39,24 @@ %% #2 probability (fast) or spikes (slow) representation AN_spikesOrProbability='spikes'; + % or +% NB probabilities are not corrected for refractory effects AN_spikesOrProbability='probability'; %% #3 pure tone, harmonic sequence or speech file input signalType= 'tones'; -duration=0.100; % seconds -% duration=0.020; % seconds -sampleRate= 64000; +sampleRate= 100000; +duration=0.010; % seconds % toneFrequency= 250:250:8000; % harmonic sequence (Hz) -toneFrequency= 1000; % or a pure tone (Hz8 - +toneFrequency= 4000; % or a pure tone (Hz8 rampDuration=.005; % seconds % or -signalType= 'file'; -fileName='twister_44kHz'; -% fileName='new-da-44khz'; +% signalType= 'file'; +% fileName='twister_44kHz'; -% ? and mix with an optional second file? -mixerFile=[]; -%or -mixerFile='babble'; -leveldBSPL2=60; %% #4 rms level % signal details @@ -91,20 +85,27 @@ % 'IHCpreSynapseParams.tauCa=86e-6;'}; % paramChanges={'DRNLParams.rateToAttenuationFactorProb = 0;'}; -%% delare showMap options -showMapOptions=[]; % use defaults + +%% delare 'showMap' options to control graphical output +global showMapOptions % or (example: show everything including an smoothed SACF output -showMapOptions.showModelParameters=1; -showMapOptions.showModelOutput=1; -showMapOptions.printFiringRates=1; -showMapOptions.showACF=0; -showMapOptions.showEfferent=1; -if strcmp(AN_spikesOrProbability, 'probability') - showMapOptions.surfProbability=1; +showMapOptions.printModelParameters=1; % prints all parameters +showMapOptions.showModelOutput=1; % plot of all stages +showMapOptions.printFiringRates=1; % prints stage activity levels +showMapOptions.showACF=0; % shows SACF (probability only) +showMapOptions.showEfferent=1; % tracks of AR and MOC +showMapOptions.surfProbability=1; % 2D plot of HSR response +if strcmp(AN_spikesOrProbability, 'spikes') + % avoid nonsensical options + showMapOptions.surfProbability=0; + showMapOptions.showACF=0; end if strcmp(signalType, 'file') + % needed for labeling plot showMapOptions.fileName=fileName; +else + showMapOptions.fileName=[]; end %% Generate stimuli @@ -116,11 +117,11 @@ case 'tones' inputSignal=createMultiTone(sampleRate, toneFrequency, ... leveldBSPL, duration, rampDuration); - + case 'file' %% file input simple or mixed [inputSignal sampleRate]=wavread(fileName); - dt=1/sampleRate; + dt=1/sampleRate; inputSignal=inputSignal(:,1); targetRMS=20e-6*10^(leveldBSPL/20); rms=(mean(inputSignal.^2))^0.5; @@ -128,32 +129,6 @@ inputSignal=inputSignal*amp; silence= zeros(1,round(0.1/dt)); inputSignal= [silence inputSignal' silence]; - - if ~isempty(mixerFile) - [inputSignal2 sampleRate2]=wavread(mixerFile); - if ~isequal(sampleRate,sampleRate2) - error... - ('file and mixer file have different sample rates') - end - inputSignal2=inputSignal2(:,1); - [r c]=size(inputSignal); - inputSignal2=inputSignal2(1:r); - targetRMS=20e-6*10^(leveldBSPL2/20); - rms=(mean(inputSignal2.^2))^0.5; - amp=targetRMS/rms; - inputSignal2=inputSignal2*amp; - rampDuration=dt*length(inputSignal2)/3; - if rampDuration>0.5*duration, rampDuration=duration/2; end - rampTime=dt:dt:rampDuration; - time=dt*(1:length(inputSignal2)); - ramp=[0.5*(1+cos(2*pi*rampTime/(2*rampDuration)+pi)) ... - ones(1,length(time)-length(rampTime))]; - inputSignal2=inputSignal2.*ramp'; - ramp=fliplr(ramp); - inputSignal2=inputSignal2.*ramp'; - end - - inputSignal=inputSignal+inputSignal2; end @@ -167,17 +142,19 @@ restorePath=path; addpath (['..' filesep 'MAP']) +addpath (['..' filesep 'utilities']) MAP1_14(inputSignal, sampleRate, BFlist, ... MAPparamsName, AN_spikesOrProbability, paramChanges); -path(restorePath) toc % the model run is now complete. Now display the results -showMAP(showMapOptions) +disp(' param changes to list of parameters below') for i=1:length(paramChanges) disp(paramChanges{i}) end +UTIL_showMAP(showMapOptions) + toc path(restorePath) @@ -204,5 +181,6 @@ % add 10 ms silence silence= zeros(1,round(0.03/dt)); +silence= zeros(1,round(0.01/dt)); inputSignal= [silence inputSignal silence];
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/userPrograms/Pavel_MAP1_14.m Wed Jun 15 15:06:10 2011 +0100 @@ -0,0 +1,189 @@ +function Pavel_MAP1_14 +% test_MAP1_14 is a general purpose test routine that can be adjusted to +% test a number of different applications of MAP1_14 +% +% A range of options are supplied in the early part of the program +% +% One use of the function is to create demonstrations; filenames <demoxx> +% to illustrate particular features +% +% #1 +% Identify the file (in 'MAPparamsName') containing the model parameters +% +% #2 +% Identify the kind of model required (in 'AN_spikesOrProbability'). +% A full brainstem model (spikes) can be computed or a shorter model +% (probability) that computes only so far as the auditory nerve +% +% #3 +% Choose between a tone signal or file input (in 'signalType') +% +% #4 +% Set the signal rms level (in leveldBSPL) +% +% #5 +% Identify the channels in terms of their best frequencies in the vector +% BFlist. +% +% Last minute changes to the parameters fetched earlier can be made using +% the cell array of strings 'paramChanges'. +% Each string must have the same format as the corresponding line in the +% file identified in 'MAPparamsName' +% +% When the demonstration is satisfactory, freeze it by renaming it <demoxx> + + +%% #1 parameter file name +MAPparamsName='Normal'; + + +%% #2 probability (fast) or spikes (slow) representation +AN_spikesOrProbability='spikes'; + +% or +% AN_spikesOrProbability='probability'; +% NB probabilities are not corrected for refractory effects + + +%% #3 pure tone, harmonic sequence or speech file input +signalType= 'tones'; +sampleRate= 100000; +duration=0.1; % seconds +% toneFrequency= 250:250:8000; % harmonic sequence (Hz) +toneFrequency= 1000; % or a pure tone (Hz8 +rampDuration=.005; % seconds + +% or +% signalType= 'file'; +% fileName='twister_44kHz'; + + +%% #4 rms level +% signal details +leveldBSPL= 30; % dB SPL + + +%% #5 number of channels in the model +% 21-channel model (log spacing) +% numChannels=21; +% lowestBF=250; highestBF= 8000; +% BFlist=round(logspace(log10(lowestBF), log10(highestBF), numChannels)); + +% or specify your own channel BFs +numChannels=1; +BFlist=toneFrequency; + + +%% #6 change model parameters +paramChanges=[]; + +% or +% Parameter changes can be used to change one or more model parameters +% *after* the MAPparams file has been read +% This example declares only one fiber type with a calcium clearance time +% constant of 80e-6 s (HSR fiber) when the probability option is selected. +% It also removes the speed up that normally takes place for AN spikes +% It also increases the number of AN fibers computed to 500. +paramChanges={... + 'AN_IHCsynapseParams.ANspeedUpFactor=1;', ... + 'IHCpreSynapseParams.tauCa=86e-6;',... + 'AN_IHCsynapseParams.numFibers= 500;' }; + + +%% delare 'showMap' options to control graphical output +global showMapOptions + +% or (example: show everything including an smoothed SACF output +showMapOptions.printModelParameters=1; % prints all parameters +showMapOptions.showModelOutput=1; % plot of all stages +showMapOptions.printFiringRates=1; % prints stage activity levels +showMapOptions.showACF=0; % shows SACF (probability only) +showMapOptions.showEfferent=0; % tracks of AR and MOC +showMapOptions.surfProbability=0; % 2D plot of HSR response +if strcmp(AN_spikesOrProbability, 'spikes') + % avoid nonsensical options + showMapOptions.surfProbability=0; + showMapOptions.showACF=0; +end +if strcmp(signalType, 'file') + % needed for labeling plot + showMapOptions.fileName=fileName; +else + showMapOptions.fileName=[]; +end + +%% Generate stimuli + +dbstop if error +restorePath=path; +addpath (['..' filesep 'MAP'], ['..' filesep 'wavFileStore']) +switch signalType + case 'tones' + inputSignal=createMultiTone(sampleRate, toneFrequency, ... + leveldBSPL, duration, rampDuration); + + case 'file' + %% file input simple or mixed + [inputSignal sampleRate]=wavread(fileName); + dt=1/sampleRate; + inputSignal=inputSignal(:,1); + targetRMS=20e-6*10^(leveldBSPL/20); + rms=(mean(inputSignal.^2))^0.5; + amp=targetRMS/rms; + inputSignal=inputSignal*amp; + silence= zeros(1,round(0.1/dt)); + inputSignal= [silence inputSignal' silence]; +end + + +%% run the model +tic + +fprintf('\n') +disp(['Signal duration= ' num2str(length(inputSignal)/sampleRate)]) +disp([num2str(numChannels) ' channel model']) +disp('Computing ...') + +restorePath=path; +addpath (['..' filesep 'MAP']) + +MAP1_14(inputSignal, sampleRate, BFlist, ... + MAPparamsName, AN_spikesOrProbability, paramChanges); +path(restorePath) +toc + +% the model run is now complete. Now display the results +% the model run is now complete. Now display the results +disp(' param changes to list of parameters below') +for i=1:length(paramChanges) + disp(paramChanges{i}) +end +UTIL_showMAP(showMapOptions) + +toc +path(restorePath) + + +function inputSignal=createMultiTone(sampleRate, toneFrequency, ... + leveldBSPL, duration, rampDuration) +% Create pure tone stimulus +dt=1/sampleRate; % seconds +time=dt: dt: duration; +inputSignal=sum(sin(2*pi*toneFrequency'*time), 1); +amp=10^(leveldBSPL/20)*28e-6; % converts to Pascals (peak) +inputSignal=amp*inputSignal; + +% apply ramps +% catch rampTime error +if rampDuration>0.5*duration, rampDuration=duration/2; end +rampTime=dt:dt:rampDuration; +ramp=[0.5*(1+cos(2*pi*rampTime/(2*rampDuration)+pi)) ... + ones(1,length(time)-length(rampTime))]; +inputSignal=inputSignal.*ramp; +ramp=fliplr(ramp); +inputSignal=inputSignal.*ramp; + +% add 10 ms silence +silence= zeros(1,round(0.03/dt)); +inputSignal= [silence inputSignal silence]; +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utilities/UTIL_PSTHmakerb.m Wed Jun 15 15:06:10 2011 +0100 @@ -0,0 +1,37 @@ +function [PSTH ]=UTIL_PSTHmakerb(inputData, dt, PSTHbinWidth) +% UTIL_PSTHmakerb averages mean values into bins. +% No corrections are applied +% usage: +% PSTH=UTIL_PSTHmaker(inputData, method) +% +% arguments +% inputData is a channel x time matrix +% PSTH is the reduced matrix, the sum of all elements in the bin +% + +[numChannels numDataPoints]= size(inputData); + +% Multiple fibers is the same as repeat trials +% Consolidate data into a histogram +dataPointsPerBin=round(PSTHbinWidth/dt); +if dataPointsPerBin<=1; +% Too few data points + PSTH=inputData; + return +end + +numBins=floor(numDataPoints/dataPointsPerBin); +PSTH=zeros(numChannels,numBins); + +% take care that signal length is an integer multiple of bin size +% by dropping the last unuseable values +useableDataLength=numBins*dataPointsPerBin; +inputData=inputData(:,1:useableDataLength); + +for ch=1:numChannels + % Convert each channel into a matrix where each column represents + % the content of a single PSTH bin + PSTH2D=reshape (inputData(ch,:), dataPointsPerBin, numBins ); + % and sum within each bin (across the rows + PSTH(ch,:)=mean (PSTH2D,1); +end
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/utilities/UTIL_showMAP.m Wed Jun 15 15:06:10 2011 +0100 @@ -0,0 +1,281 @@ +function UTIL_showMAP (options) +% options +% options.printModelParameters=1; +% options.showModelOutput=1; +% options.printFiringRates=1; +% options.showACF=1; +% options.showEfferent=1; +% options.surfProbability=0; +% options.fileName=[]; +% options.surfProbability=0; + +dbstop if warning + +global dt ANdt saveAN_spikesOrProbability savedBFlist saveMAPparamsName... + savedInputSignal TMoutput OMEoutput ARattenuation ... + DRNLoutput IHC_cilia_output IHCrestingCiliaCond IHCrestingV... + IHCoutput ANprobRateOutput ANoutput savePavailable tauCas ... + CNoutput ICoutput ICmembraneOutput ICfiberTypeRates MOCattenuation +global OMEParams DRNLParams IHC_cilia_RPParams IHCpreSynapseParams +global AN_IHCsynapseParams MacGregorParams MacGregorMultiParams + + +restorePath=path; +addpath ( ['..' filesep 'utilities'], ['..' filesep 'parameterStore']) + +if nargin<1 + options=[]; +end +% defaults (plot staged outputs and print rates only) +if ~isfield(options,'printModelParameters'),options.printModelParameters=0;end +if ~isfield(options,'showModelOutput'),options.showModelOutput=1;end +if ~isfield(options,'printFiringRates'),options.printFiringRates=1;end +if ~isfield(options,'showACF'),options.showACF=0;end +if ~isfield(options,'showEfferent'),options.showEfferent=0;end +if ~isfield(options,'surfProbability'),options.surfProbability=0;end +if ~isfield(options,'fileName'),options.fileName=[];end + + +if options.printModelParameters + % Read parameters from MAPparams<***> file in 'parameterStore' folder + % and print out all parameters + cmd=['MAPparams' saveMAPparamsName ... + '(-1, 1/dt, 1);']; + eval(cmd); +end + +if options.printFiringRates + %% print summary firing rates + fprintf('\n\n') + disp('summary') + disp(['AR: ' num2str(min(ARattenuation))]) + disp(['MOC: ' num2str(min(min(MOCattenuation)))]) + nANfiberTypes=length(tauCas); + if strcmp(saveAN_spikesOrProbability, 'spikes') + nANfibers=size(ANoutput,1); + nHSRfibers=nANfibers/nANfiberTypes; + duration=size(TMoutput,2)*dt; + disp(['AN: ' num2str(sum(sum(ANoutput(end-nHSRfibers+1:end,:)))/... + (nHSRfibers*duration))]) + + nCNneurons=size(CNoutput,1); + nHSRCNneuronss=nCNneurons/nANfiberTypes; + disp(['CN: ' num2str(sum(sum(CNoutput(end-nHSRCNneuronss+1:end,:)))... + /(nHSRCNneuronss*duration))]) + disp(['IC: ' num2str(sum(sum(ICoutput))/duration)]) + % disp(['IC by type: ' num2str(mean(ICfiberTypeRates,2)')]) + else + disp(['AN: ' num2str(mean(mean(ANprobRateOutput)))]) + [PSTH pointsPerBin]= UTIL_makePSTH(ANprobRateOutput, dt, 0.001); + disp(['max max AN: ' num2str(max(max(... + PSTH/pointsPerBin )))]) + end +end + + +%% figure (99) summarises main model output +if options.showModelOutput + plotInstructions.figureNo=99; + signalRMS=mean(savedInputSignal.^2)^0.5; + signalRMSdb=20*log10(signalRMS/20e-6); + + % plot signal (1) + plotInstructions.displaydt=dt; + plotInstructions.numPlots=6; + plotInstructions.subPlotNo=1; + plotInstructions.title=... + ['stimulus: ' num2str(signalRMSdb, '%4.0f') ' dB SPL']; + r=size(savedInputSignal,1); + if r==1, savedInputSignal=savedInputSignal'; end + UTIL_plotMatrix(savedInputSignal', plotInstructions); + + % stapes (2) + plotInstructions.subPlotNo=2; + plotInstructions.title= ['stapes displacement']; + UTIL_plotMatrix(OMEoutput, plotInstructions); + + % DRNL (3) + plotInstructions.subPlotNo=3; + plotInstructions.title= ['BM displacement']; + plotInstructions.yValues= savedBFlist; + UTIL_plotMatrix(DRNLoutput, plotInstructions); + + switch saveAN_spikesOrProbability + case 'spikes' + % AN (4) + plotInstructions.displaydt=ANdt; + plotInstructions.title='AN'; + plotInstructions.subPlotNo=4; + plotInstructions.yLabel='BF'; + plotInstructions.yValues= savedBFlist; + plotInstructions.rasterDotSize=1; + if length(tauCas)==2 + plotInstructions.plotDivider=1; + else + plotInstructions.plotDivider=0; + end + if sum(sum(ANoutput))<100 + plotInstructions.rasterDotSize=3; + end + UTIL_plotMatrix(ANoutput, plotInstructions); + + % CN (5) + plotInstructions.displaydt=ANdt; + plotInstructions.subPlotNo=5; + plotInstructions.title='CN spikes'; + if sum(sum(CNoutput))<100 + plotInstructions.rasterDotSize=3; + end + UTIL_plotMatrix(CNoutput, plotInstructions); + + % IC (6) + plotInstructions.displaydt=ANdt; + plotInstructions.subPlotNo=6; + plotInstructions.title='IC'; + if size(ICoutput,1)>3 + if sum(sum(ICoutput))<100 + plotInstructions.rasterDotSize=3; + end + UTIL_plotMatrix(ICoutput, plotInstructions); + else + plotInstructions.title='IC (HSR) membrane potential'; + plotInstructions.displaydt=dt; + plotInstructions.yLabel='V'; + plotInstructions.zValuesRange= [-.1 0]; + UTIL_plotMatrix(ICmembraneOutput, plotInstructions); + end + + otherwise % probability (4-6) + plotInstructions.displaydt=dt; + plotInstructions.numPlots=2; + plotInstructions.subPlotNo=2; + plotInstructions.yLabel='BF'; + if nANfiberTypes>1, + plotInstructions.yLabel='LSR HSR'; + plotInstructions.plotDivider=1; + end + plotInstructions.title='AN - spike probability'; + UTIL_plotMatrix(ANprobRateOutput, plotInstructions); + end +end + +if options.surfProbability + %% surface plot of probability + figure(97), clf + % select only HSR fibers at the bottom of the matrix + ANprobRateOutput= ANprobRateOutput(end-length(savedBFlist)+1:end,:); + PSTHbinWidth=0.001; + PSTH=UTIL_PSTHmakerb(ANprobRateOutput, ANdt, PSTHbinWidth); + [nY nX]=size(PSTH); + time=PSTHbinWidth*(1:nX); + surf(time, savedBFlist, PSTH) + shading interp + set(gca, 'yScale','log') + xlim([0 max(time)]) + ylim([0 max(savedBFlist)]) + zlim([0 1000]) + xlabel('time (s)') + ylabel('best frequency (Hz)') + zlabel('spike rate') + view([-20 60]) + % view([0 90]) + title ([options.fileName ': ' num2str(signalRMSdb,'% 3.0f') ' dB']) +end + + +%% plot efferent control values as dB +if options.showEfferent + plotInstructions=[]; + plotInstructions.figureNo=98; + figure(98), clf + plotInstructions.displaydt=dt; + plotInstructions.numPlots=2; + plotInstructions.subPlotNo=1; + plotInstructions.zValuesRange=[ -25 0]; + plotInstructions.title= ['AR strength. Signal level= ' ... + num2str(signalRMSdb,'%4.0f') ' dB SPL']; + UTIL_plotMatrix(20*log10(ARattenuation), plotInstructions); + + plotInstructions.subPlotNo=2; + plotInstructions.yValues= savedBFlist; + plotInstructions.yLabel= 'BF'; + plotInstructions.title= ['MOC strength']; + plotInstructions.zValuesRange=[ -25 0]; + subplot(2,1,2) + % imagesc(MOCattenuation) + UTIL_plotMatrix(20*log10(MOCattenuation), plotInstructions); + colorbar +end + +%% ACF plot if required +if options.showACF + tic + method.dt=dt; + method.segmentNo=1; + method.nonlinCF=savedBFlist; + + minPitch= 80; maxPitch= 4000; numPitches=100; % specify lags + pitches=10.^ linspace(log10(minPitch), log10(maxPitch),numPitches); + pitches=fliplr(pitches); + filteredSACFParams.lags=1./pitches; % autocorrelation lags vector + filteredSACFParams.acfTau= .003; % time constant of running ACF + filteredSACFParams.lambda= 0.12; % slower filter to smooth ACF + filteredSACFParams.lambda= 0.01; % slower filter to smooth ACF + + filteredSACFParams.plotACFs=0; % special plot (see code) + filteredSACFParams.plotFilteredSACF=0; % 0 plots unfiltered ACFs + filteredSACFParams.plotMoviePauses=.3; % special plot (see code) + + filteredSACFParams.usePressnitzer=0; % attenuates ACF at long lags + filteredSACFParams.lagsProcedure= 'useAllLags'; + % filteredSACFParams.lagsProcedure= 'useBernsteinLagWeights'; + % filteredSACFParams.lagsProcedure= 'omitShortLags'; + filteredSACFParams.criterionForOmittingLags=3; + filteredSACFParams.plotACFsInterval=200; + + if filteredSACFParams.plotACFs + % plot original waveform on ACF plot + figure(13), clf + subplot(4,1,1) + t=dt*(1:length(savedInputSignal)); + plot(t,savedInputSignal) + xlim([0 t(end)]) + title(['stimulus: ' num2str(signalRMSdb, '%4.0f') ' dB SPL']); + end + + % plot original waveform on summary/smoothed ACF plot + figure(96), clf + subplot(2,1,1) + t=dt*(1:length(savedInputSignal)); + plot(t,savedInputSignal) + xlim([0 t(end)]) + title(['stimulus: ' num2str(signalRMSdb, '%4.0f') ' dB SPL']); + + + % compute ACF + switch saveAN_spikesOrProbability + case 'probability' + inputToACF=ANprobRateOutput.^0.5; + otherwise + inputToACF=ANoutput; + end + + disp ('computing ACF...') + [P, BFlist, sacf, boundaryValue] = ... + filteredSACF(inputToACF, method, filteredSACFParams); + disp(' ACF done.') + + % SACF + subplot(2,1,2) + imagesc(P) + ylabel('periodicities (Hz)') + xlabel('time (s)') + title(['running smoothed (root) SACF. ' saveAN_spikesOrProbability ' input']) + pt=[1 get(gca,'ytick')]; % force top xtick to show + set(gca,'ytick',pt) + set(gca,'ytickLabel', round(pitches(pt))) + tt=get(gca,'xtick'); + set(gca,'xtickLabel', round(100*t(tt))/100) +end + +path(restorePath)