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

Both sides previous revision Previous revision
Next revision
Previous revision
analysis:course-w16:week6 [2016/02/02 14:23]
mvdm [Detecting movement artifacts]
analysis:course-w16:week6 [2018/07/07 10:19] (current)
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 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.1454441028.txt.gz · Last modified: 2018/07/07 10:19 (external edit)