User Tools

Site Tools


analysis:nsb2015: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:nsb2015:week6 [2015/07/19 21:21]
mvdm [Interpreting the output of MATLAB's fft() function]
analysis:nsb2015:week6 [2018/07/07 10:19] (current)
Line 404: Line 404:
 ==== Pitfalls for real-world signals ==== ==== Pitfalls for real-world signals ====
  
-We are almost ready to apply these methods to some real data. However, we first need to be aware of an issue that often comes up with real data. ''​fft()''​ and tools that rely on it, such as the spectral estimators in the previous section, assume that the data is sampled at evenly spaced intervals. ​We know from the previous module that this is only approximately true for Neuralynx data: chunks of 512 samples are sampled at a regular interval (''​Fs = 2000''​) but the interval between chunks is slightly larger than within, such that the overall Fs is slightly smaller than 2000. Because this difference is tiny, it will not affect our spectral estimate much. However if the difference becomes large our spectrum will be wrong. For instance:+We are almost ready to apply these methods to some real data. However, we first need to be aware of an issue that often comes up with real data. ''​fft()''​ and tools that rely on it, such as the spectral estimators in the previous section, assume that the data is sampled at evenly spaced intervals. ​However, ​this is only approximately true for Neuralynx data: chunks of 512 samples are sampled at a regular interval (''​Fs = 2000''​) but the interval between chunks is slightly larger than within, such that the overall Fs is slightly smaller than 2000. Because this difference is tiny, it will not affect our spectral estimate much. However if the difference becomes large our spectrum will be wrong. For instance:
  
 <code matlab> <code matlab>
Line 459: Line 459:
 ==== Application to real data ==== ==== Application to real data ====
  
-Let's begin by loading a ventral striatal LFP signal, remembering to use our improved ''​LoadCSCi()''​ function which should be placed in your path if it isn't already (if you don't have this, ''​LoadCSC()''​ will also work):+Let's begin by loading a ventral striatal LFP signal:
  
 <code matlab> <code matlab>
Line 485: Line 485:
 </​code>​ </​code>​
  
-Looks good -- note the scale! Recall that the odd structure of the diffs is because of Neuralynx'​s 512-sample-per-block format. So, technically we don't have uniformly spaced samples, but it's close enough that we don't have to bother with interpolating.+The slightly ​odd structure of the diffs is because of Neuralynx'​s 512-sample-per-block format. So, technically we don't have uniformly spaced samples, but it's close enough that we don't have to bother with interpolating.
  
 Let's decimate to speed up subsequent processing: Let's decimate to speed up subsequent processing:
analysis/nsb2015/week6.1437355262.txt.gz ยท Last modified: 2018/07/07 10:19 (external edit)