User Tools

Site Tools


analysis:course-w16:week4

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:week4 [2016/01/21 14:25]
mvdm
analysis:course-w16:week4 [2016/02/03 17:22]
mvdm [Reconstructing a signal from sampled data (optional)]
Line 91: Line 91:
 ==== Subsampling (decimating) time series data ==== ==== Subsampling (decimating) time series data ====
  
-In the real world, the frequency at which we can acquire data will be limited the properties of your experimental equipment. For instance, the maximum sampling rate on a typical Neuralynx system is 32 kHz. Thus, the highest-frequency signal we can detect is 16 kHz (the Nyquist frequency). Crucially, however, we cannot rule out the possibility that frequencies above 16 kHz are present in the signal we are sampling from! Thus, we risk **aliasing**:​ generating "​phantom"​ frequencies in our sampled data that don't exist in the true signal. What to do?+In the real world, the frequency at which we can acquire data will be limited ​by the properties of your experimental equipment. For instance, the maximum sampling rate on a typical Neuralynx system is 32 kHz. Thus, the highest-frequency signal we can detect is 16 kHz (the Nyquist frequency). Crucially, however, we cannot rule out the possibility that frequencies above 16 kHz are present in the signal we are sampling from! Thus, we risk **aliasing**:​ generating "​phantom"​ frequencies in our sampled data that don't exist in the true signal. What to do?
  
 The general solution is to apply an //​anti-aliasing filter// to the data before sampling. To illustrate this, let's generate a signal consisting of two frequencies:​ The general solution is to apply an //​anti-aliasing filter// to the data before sampling. To illustrate this, let's generate a signal consisting of two frequencies:​
Line 123: Line 123:
 <code matlab> <code matlab>
 % sample at 12 Hz with different method % sample at 12 Hz with different method
 +tvec1d = decimate(tvec1,​ dt);
 signal2d = decimate(signal1,​dt);​ signal2d = decimate(signal1,​dt);​
  
Line 182: Line 183:
 <code matlab> <code matlab>
 xl = [1 1.04]; xl = [1 1.04];
-linkaxes('​x'​,'​ax1',​ax2);+linkaxes([ax1, ax2], '​x'​);​
 set(ax1,'​XLim',​xl);​ % see what I did there?) set(ax1,'​XLim',​xl);​ % see what I did there?)
 </​code>​ </​code>​
Line 202: Line 203:
 You should obtain something like: You should obtain something like:
  
-{{ :​analysis:​course:​week3_fig1.png?​nolink&​600 |}}+{{ :​analysis:​course-w16:spline_recover.png?​nolink&​600 |}}
  
 Notice how the spline-interpolated sampled signal is a pretty good approximation to the original. In cases where you care about detecting the values and/or locations of signal peaks, such as during spike sorting, performing spline interpolation can often improve accuracy substantially! Notice how the spline-interpolated sampled signal is a pretty good approximation to the original. In cases where you care about detecting the values and/or locations of signal peaks, such as during spike sorting, performing spline interpolation can often improve accuracy substantially!
Line 208: Line 209:
 ==== Detailed examination of Neuralynx time series data ==== ==== Detailed examination of Neuralynx time series data ====
  
-This section will look in some detail at how raw time series data is stored by the Neuralynx system. Even if you do not use this system in your own work, the lessions ​that can be learned from looking at what can go wrong at the raw data level already are universal!+This section will look in some detail at how raw time series data is stored by the Neuralynx system. Even if you do not use this system in your own work, the lessons ​that can be learned from looking at what can go wrong at the raw data level already are universal!
  
 To get into the guts of actual Neuralynx data, we will not use the sanitized wrapper provided by ''​LoadCSC()''​ but instead use the loading function provided by Neuralynx. Using cell mode in a sandbox file as usual, ''​cd''​ into the ''​R016-2012-10-08''​ data folder you downloaded previously in Week 1. Then deploy the Neuralynx loader: To get into the guts of actual Neuralynx data, we will not use the sanitized wrapper provided by ''​LoadCSC()''​ but instead use the loading function provided by Neuralynx. Using cell mode in a sandbox file as usual, ''​cd''​ into the ''​R016-2012-10-08''​ data folder you downloaded previously in Week 1. Then deploy the Neuralynx loader:
Line 360: Line 361:
  
 โ˜… If you implemented your own file loader(s) back in Module 2, implement checks for missing samples and possible sampling frequency misalignments. โ˜… If you implemented your own file loader(s) back in Module 2, implement checks for missing samples and possible sampling frequency misalignments.
 +
 +โ˜… Important! If you have your own idea of something you'd like to accomplish in this course, even if is isn't listed as an official challenge, ask me and we can make it count as one. What you do in this course should be as relevant as possible to your work!
analysis/course-w16/week4.txt ยท Last modified: 2018/07/07 10:19 (external edit)