User Tools

Site Tools


analysis:course-w16:week6

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
analysis:course-w16:week6 [2016/02/01 11:19]
mvdm created
analysis:course-w16:week6 [2018/07/07 10:19] (current)
Line 20: Line 20:
 This raises the possibility of manipulating the signal in the frequency domain, for instance by removing or amplifying certain frequencies,​ and then reconstructing the signal. This is an intuitive way to think about //​filtering//,​ defined as an operation or process that removes or attenuates certain features from a signal. [[http://​cns-alumni.bu.edu/​~slehar/​fourier/​fourier.html | This page]] has a nice graphical illustration of Fourier filtering. This raises the possibility of manipulating the signal in the frequency domain, for instance by removing or amplifying certain frequencies,​ and then reconstructing the signal. This is an intuitive way to think about //​filtering//,​ defined as an operation or process that removes or attenuates certain features from a signal. [[http://​cns-alumni.bu.edu/​~slehar/​fourier/​fourier.html | This page]] has a nice graphical illustration of Fourier filtering.
  
-Filtering is of central importance in neuroscience,​ both as an analysis tool (especially when dealing with continuously sampled ​data) and as a model for operations performed by neural circuits at multiple levels. For instance, the classical receptive fields of V1 neurons can be thought of as filters operating on visual input, and the characteristic time course of postsynaptic potentials imposes limits on how fast signals can be transmitted. Here, we focus on some basic data analysis applications.+Filtering is of central importance in neuroscience,​ both as an analysis tool (especially when dealing with time series ​data) and as a model for operations performed by neural circuits at multiple levels. For instance, the classical receptive fields of V1 neurons can be thought of as filters operating on visual input, and the characteristic time course of postsynaptic potentials imposes limits on how fast signals can be transmitted. Here, we focus on some basic data analysis applications.
  
 ===== Step-by-step ===== ===== Step-by-step =====
Line 48: Line 48:
 So, to compute the running mean over four samples, we want: So, to compute the running mean over four samples, we want:
  
-{{ http://​www.mathworks.com/​help/​releases/​R2013b/​matlab/​data_analysis/​eqn1133878950.png?​300 }}+{{ http://​www.mathworks.com/​help/​releases/​R2013b/​matlab/​data_analysis/​eqn1133878950.png?​600 }}
  
 Using ''​filter()'',​ we would simply do Using ''​filter()'',​ we would simply do
Line 262: Line 262:
  
 As is often the case, the output from ''​filtfilt()''​ actually has a steeper rolloff than that from ''​filter()''​. This is because we are effectively filtering twice, an effect that can be approximated by increasing order of the filter (if you were to filter it only once). ''​filtfilt()''​ tends to be more robust, but it is always a good idea to check your filter on white noise if you have not used it before. As is often the case, the output from ''​filtfilt()''​ actually has a steeper rolloff than that from ''​filter()''​. This is because we are effectively filtering twice, an effect that can be approximated by increasing order of the filter (if you were to filter it only once). ''​filtfilt()''​ tends to be more robust, but it is always a good idea to check your filter on white noise if you have not used it before.
 +
 +☛ (test your knowledge) [[analysis:​course-w16:​week4|Module 4]] introduced the importance of using an anti-aliasing filter when (sub)sampling,​ and recommended using the ''​decimate()''​ function because it has exactly such a filter built-in (as opposed to ''​downsample()''​ which does not). However, as you have seen in this module, filtering can produce phase shifts, which could lead to serious artifacts when e.g. relating spike or event times to field potential phases. Find out if the anti-aliasing filter in ''​decimate()''​ produces phase shifts.
  
 ==== Some typical neuroscience applications ==== ==== Some typical neuroscience applications ====
Line 342: Line 344:
 </​code>​ </​code>​
  
-The resulting ​//​envelope// ​is well-behaved and matches the chewing events nicely:+The resulting ​"​chew-band"​ signal power estimate ​is well-behaved and matches the chewing events nicely:
  
 {{ :​analysis:​course:​week5_fig8.png?​600 |}} {{ :​analysis:​course:​week5_fig8.png?​600 |}}
Line 362: Line 364:
 Studies of replay start with the detection of potential replay events. To do this, we need to isolate those features of the LFP that are associated with SWR events and distinguish them from those resulting from artifacts associated with chewing, grooming, et cetera. Studies of replay start with the detection of potential replay events. To do this, we need to isolate those features of the LFP that are associated with SWR events and distinguish them from those resulting from artifacts associated with chewing, grooming, et cetera.
  
-Based on the filtering concepts above, we can implement a workflow for detecting SWR events, as follows:+Based on the filtering concepts above, we can implement a workflow for detecting SWR events, as follows ​(note, you may need to do a ''​git pull''​ to make this work):
  
 <code matlab> <code matlab>
Line 385: Line 387:
 cfg.method = '​raw';​ cfg.method = '​raw';​
 cfg.threshold = 3; cfg.threshold = 3;
-cfg.dcn =  '>';​ % return intervals where threshold is exceeded+cfg.operation ​=  '>';​ % return intervals where threshold is exceeded
 cfg.merge_thr = 0.05; % merge events closer than this cfg.merge_thr = 0.05; % merge events closer than this
 cfg.minlen = 0.05; % minimum interval length cfg.minlen = 0.05; % minimum interval length
Line 400: Line 402:
 %% select only those events of >5 z-scored power %% select only those events of >5 z-scored power
 cfg = []; cfg = [];
-cfg.dcn = '>';​+cfg.operation ​= '>';​
 cfg.threshold = 5; cfg.threshold = 5;
  
-SWR_evt = SelectIV(cfg,​SWR_evt);​+SWR_evt = SelectIV(cfg,​SWR_evt,'​maxSWRp'​);
  
 %% plot events in highlighted on top of full lfp %% plot events in highlighted on top of full lfp
analysis/course-w16/week6.1454343556.txt.gz · Last modified: 2018/07/07 10:19 (external edit)