ezmsg.simbiophys.dnss.lfp#
# LFP
## Spike Mode
The LFP is a sum of 3 sinusoids at frequencies of 1.0, 3.0, and 9.0 Hz.
The amplitudes and phase shifts are calculated empirically from analyzing some data. Digitally, and transmitted via the HDMI, there is almost no phase delay in these sinusoids; they are shifted 2, 1, and 2 samples after the pattern start, respectively. Their amplitudes are all 894.4.
When using analog components such as the pedestal and headstage, the intrinsic filtering characteristics cause non-linear phase delay, shifting the sinusoids an uneven amount.
## “Other” Mode
The “Other” pattern comprises sequential sine waves of increasing frequency. All of amplitude 6_000 (HDMI) or 1_000 (pedestal). 29_279 samples of a 1 Hz sine wave, phase shift 0. 721 samples held at last value preceding an incomplete wave. 15_000 samples (0.5 seconds) of 10 Hz sine, phase shift 720. 285 samples of 80 Hz sine wave, phase shift 90 samples. 7_500 samples of 100 Hz sine wave, no phase shift. 7_215 samples (0.24 seconds) of 1000 Hz sine, phase shift 0.
Functions
- lfp_generator(pattern='spike', mode='hdmi', fs=30000)[source]#
Generator yielding LFP samples for the DNSS pattern.
This is a send-able generator. After priming with next(), use send(n_samples) to get LFP values for the next n_samples window. The generator maintains internal state tracking the current sample position.
- Parameters:
- Yields:
1D array of LFP values (same for all channels).
- Return type:
Generator[ndarray[tuple[Any,...],dtype[float64]],int,None]
Example
gen = lfp_generator(fs=30000) next(gen) # Prime the generator lfp = gen.send(30000) # Get 1 second of LFP lfp = gen.send(15000) # Get next 0.5 seconds
Classes
- class DNSSLFPProducer(*args, **kwargs)[source]#
Bases:
BaseClockDrivenProducer[DNSSLFPSettings,DNSSLFPState]Produces DNSS LFP signal synchronized to clock ticks.
Each clock tick produces a block of LFP data based on the sample rate (fs) and chunk size (n_time) settings. All channels receive identical LFP values.
- class DNSSLFPSettings(fs=30000, n_time=None, n_ch=256, pattern='spike', mode='hdmi')[source]#
Bases:
ClockDrivenSettingsSettings for DNSS LFP producer.
-
pattern:
str= 'spike'# “spike” for normal neural signal mode, “other” for other mode.
- Type:
LFP pattern
-
pattern:
- class DNSSLFPUnit(*args, settings=None, **kwargs)[source]#
Bases:
BaseClockDrivenUnit[DNSSLFPSettings,DNSSLFPProducer]Unit for generating DNSS LFP from clock input.
- Parameters:
settings (Settings | None)
- SETTINGS#
alias of
DNSSLFPSettings
- lfp_generator(pattern='spike', mode='hdmi', fs=30000)[source]#
Generator yielding LFP samples for the DNSS pattern.
This is a send-able generator. After priming with next(), use send(n_samples) to get LFP values for the next n_samples window. The generator maintains internal state tracking the current sample position.
- Parameters:
- Yields:
1D array of LFP values (same for all channels).
- Return type:
Generator[ndarray[tuple[Any,...],dtype[float64]],int,None]
Example
gen = lfp_generator(fs=30000) next(gen) # Prime the generator lfp = gen.send(30000) # Get 1 second of LFP lfp = gen.send(15000) # Get next 0.5 seconds
- class DNSSLFPSettings(fs=30000, n_time=None, n_ch=256, pattern='spike', mode='hdmi')[source]#
Bases:
ClockDrivenSettingsSettings for DNSS LFP producer.
-
pattern:
str= 'spike'# “spike” for normal neural signal mode, “other” for other mode.
- Type:
LFP pattern
-
pattern:
- class DNSSLFPProducer(*args, **kwargs)[source]#
Bases:
BaseClockDrivenProducer[DNSSLFPSettings,DNSSLFPState]Produces DNSS LFP signal synchronized to clock ticks.
Each clock tick produces a block of LFP data based on the sample rate (fs) and chunk size (n_time) settings. All channels receive identical LFP values.
- class DNSSLFPUnit(*args, settings=None, **kwargs)[source]#
Bases:
BaseClockDrivenUnit[DNSSLFPSettings,DNSSLFPProducer]Unit for generating DNSS LFP from clock input.
- Parameters:
settings (Settings | None)
- SETTINGS#
alias of
DNSSLFPSettings