Home

Go Back   Neuralynx Forums > Knowledge Base > Cheetah 4

Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 1 votes, 5.00 average. Display Modes
  #1  
Old 04-24-2006, 03:44 PM
bruth bruth is offline
Administrator
 
Join Date: Jan 2005
Posts: 99
Default How do sampling rates work on Cheetah32/64 systems using Cheetah 4 or earlier?

How do sampling rates work on Cheetah32/64 systems using Cheetah 4 or earlier?

The Cheetah32 and Cheetah64 systems use the DT3010 A/D card for sampling analog data. We give you the ability to change the rate at which this data is sampled through the -SCRate and -SCFreqDivisor configuration commands. People have been wondering what values can be used for these commands, and the possible effects of changing them. This will explain how these values are used, and what limitations they have. If you don't want to read through all the explanations, just jump down to the Key Points section at the bottom of this post.

How the DT3010 sets the sampling frequency

Due to hardware and quality control limitations, the DT3010 is locked in at a 1MHz A/D sampling rate. This 1MHz clock serves two purposes: 1) it is responsible for providing the Cheetah timestamp that is used when timestamping records; and 2) it is divided among the sampling frequencies of the acquisition channels. The first part of that is pretty self explanatory. The 1MHz clock gives our records a 1 microsecond accurate timestamp. The second part will take a little more explaining.

The DT3010 provides us with 32 A/D input channels and the ability to input or output TTL pulses. This is a little simplified, but enough for this discussion. On each clock pulse, we attempt to sample the A/D value from a single channel. If we wanted to sample 32 channels, it would take 32 clock pulses to do so. This would effectively be sampling each channel at 1/32 of the DT3010's 1MHz clock, or 31250Hz. If the TTL port is being sampled, that increases the channel count to 33 channels, giving us a 30303Hz effective sampling rate. This is the value you will normally see for the -SCRate parameter in the configuration files from Neuralynx for Cheetah32/64 systems. Cheetah will always divide the 1MHz clock of the DT3010 evenly across all of the channels being sampled.


What happens when you change your sampling frequency

The value of the SCRate is a system wide value, so setting the -SCRate parameter will set the base effective sampling frequency for all sampled channels. It is important to remember how the 1MHz clock is being used when changing this value. If we were to sample 32 channels, and try to change the -SCRate to 32KHz, the combined sampling rate of all 32 channels would be 1.024MHz. With a 1MHz clock, we can see that this is impossible, and you will see an error when trying to run Cheetah with that configuration.

But what happens when you set the -SCRate to a value less than 1MHz/NumChannels? Cheetah tries to keep the sampling rate at 1MHz/NumChannels, so it will insert dummy channels to keep this relationship. The number of channels must always be an integer; this requires that -SCRate must be an integer divisor of 1MHz. So if you were to set the -SCRate to 28000Hz (a divisor of 35.71), Cheetah would actually set the value to 28571Hz (a divisor of 35) and insert three dummy channels. After sampling the 32nd channel, Cheetah will wait three clock pulses before resampling the first channel.


Sampling at faster than 32KHz

Yes, it is possible. As explained before, Cheetah tries to keep the sampling rate at 1MHz/NumChannels and will insert dummy channels if you try to sample at a lower frequency than 1MHz/NumChannels. But if you are sampling less than the 32 channels that the DT3010 is capable of sampling, you will be able to sample at a higher rate. On a 16 channel system, this means that you have a maximum sampling rate of 62.5KHz (if we ignore the TTL sampling). In practice, most single unit recordings do not benefit from such high speed sampling, but it is possible.


How subsampling works

There are two types of subsampling for CSC channels: 1) Hardware subsampling (via -SCFreqDivisor; 2) Software subsampling (via -SubSamplingInterleave). It is preferable that you use the software subsampling when possible, as it is not limited by the hardware. It simply only processes every Nth sample obtained from the A/D card. Hardware subsampling actually changes the way that Cheetah samples data from the DT3010. If we were to sample 32 channels at 31250Hz all with a hardware subsampling of 2, Cheetah would accomplish this by adding a dummy channel for each of the 32 channels to bring the effective sampling rate down to 15625Hz. This means that, including dummy channels, there are 64 sampling cycles taking place before any channel is resampled. If we were to subsample all 32 channels by 3, that would give us 96 sampling cycles; subsampling by 32 gives us 1024 sampling cycles. Couple this with the fact that changing the -SCRate also adds dummy channels, and you can see how there can be many more dummy channels than actual A/D channels. We have set a limit of 1024 sampling cycles before resampling in the Cheetah software. Any configuration that exceeds this value will generate an error. When using software subsampling, no dummy channels are added to accomplish the desired subsampling frequency.

Key Points
  • NumChannels * SCRate must always be less than 1000000.
  • The SCRate will always be rounded to an integer divisor of 1000000.
  • Dummy channels are used to generate sampling rates lower than 1MHz/NumChannels.
  • NumChannels + NumDummyChannels must be less than 1024.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 08:40 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.