BirdSongToolbox.PreProcessClass.Pipeline¶
-
class
BirdSongToolbox.PreProcessClass.
Pipeline
(Imported_Data)¶ Class for Pre-Processing Neural Data
Notes
- The Processing Functions all follow the same general Steps:
- [1] Validate proper steps have been made and Necessary Object Instances exist
[1.1] Check Pipeline is still Open
[1.2] Check Dependencies Exist
[2] Back-up Neural Data in case of Mistake [Make_Backup(self)]
[3] Do User Specified Processing on Song Neural Data
[4] Do User Specified Processing on Silence Neural Data
[5] Update the Process Log with User Defined Steps (Done Last Incase of Error)
- Attributes
- bird_idstr
Bird Indentifier to Locate Specified Bird’s data folder
- datestr
Experiment Day to Locate it’s Folder
- Sn_Lenint
Time Duration of Birds Motif (in Samples)
- Gap_Lenint
Duration of Buffer used for Trials (in Samples)
- Num_Chanint
Number of Recording Channels used on Bird
- Bad_Channelslist
List of Channels with Noise to be excluded from Common Average Referencing
- Fsint
Sample Frequency of Data (in Samples)
- Song_Neurallist
User Designated Neural data during Song Trials [Number of Trials]-> [Trial Length (Samples @ User Designated Sample Rate) x Ch]
- If Bandpassed:
[Number of Trials]-> [Ch] -> [Trial Length (Samples @ User Designated Sample Rate) x Freq_Bands]
- Song_Audiolist
Audio of Trials, centered on motif [Number of Trials]-> [Trial Length (Samples @ 30KHz) x 1]
- Silence_Neurallist
User Designated Neural data during Silent Trials [Number of Trials]-> [Trial Length (Samples @ User Designated Sample Rate) x Ch]
- Silence_Audiolist
Audio of Silents Trials [Number of Trials]-> [Trial Length (Samples @ 30KHz) x 1]
- Num_Motifsint
Number of Motifs in data set
- Num_Silenceint
Number of Examples of Silence
- Good_Motifslist
Index of All Good Motifs, ‘Good’ is defined as having little noise and no dropped (or missing) syllables
- First_Motifslist
Index of All Good First Motifs, this motif is the first motif in a bout and is classified as ‘Good’
- Last_Motifslist
Index of All Good Last Motifs, this motif is the last motif in a bout and is classified as ‘Good’
- Bad_Motifslist
Index of All Bad Motifs with no dropped syllables, These motifs have interferring audio noise
- LS_Droplist
Index of All Bad Motifs with the last syllable dropped, These motifs are classified as Bad
- All_First_Motifslist
Index of All First Motifs in a Bout Regardless of Quality label, This is Useful for Clip-wise (Series) Analysis
- Good_Channelslist
List of Channels that are to be included in a Common Average Filter
- All_Last_Motifslist
Index of All Last Motifs in a Bout Regardless of Quality label, This is Useful for Clip-wise (Series) Analysis
- Good_Mid_Motifslist
Index of All Good Motifs in the middle of a Bout Regardless of Quality label, This is Useful for Clip-wise (Series) Analysis
Methods
identity()
Desplay Bird ID and Recording Date
Pipe_Steps()
Desplay Pre-Processing Steps and Relevant Parameters
Restore()
Undo Last Pre-Processing Step and Restore from Back-up
Pipe_end()
Close Pipeline and Prevent Accidental Editing of Data
Pipe_Reopen()
Re-Open Pipeline for Further Pre-Processing
Define_Frequencies(*Param)
Define Method for Band Passing
Band_Pass_Filter()
Band Pass Filter Data
Re_Reference()
Re-Reference using a Common Average Reference Filter
Z_Score()
Z-Score Input Data
-
__init__
(self, Imported_Data)¶ Initiallizes by hardcopying the input data for Pre-Processing
Methods
Band_Pass_Filter
(self[, order_num, …])Bandpass Filter Data using User Defined Frequency Bands
Define_Frequencies
(self, Instructions[, …])Creates Index for Frequency Pass Band Boundaries (High and Low Cuttoff Frequencies)
Make_Backup
(self)Quickly Backs Up Neural Data
Pipe_Reopen
(self)Re-Opens Pipeline for Further Processing
Pipe_Steps
(self)Convenience Function: Prints Pipeline Steps Used
Pipe_end
(self)Marks end of Pipeline.
Re_Reference
(self)Re-Reference Data using a Common Average Reference Filter that Excludes Channels Directed by User
Restore
(self)Conveniece Function: Restores Neural Data to the Immediate Prior Step
Update_Log
(self, step)Updates Log recording Processing Steps Implemented
Z_Score
(self)Z-Score Input Data based on Equal Number of Song and Silence Trials
__init__
(self, Imported_Data)Initiallizes by hardcopying the input data for Pre-Processing
hilbert_amplitude
(self)Hilbert Transform Input Data and take the Absolute Value based on Equal Number of Song and Silence Trials
hilbert_phase
(self)Hilbert Transform Input Data and take the Absolute Value based on Equal Number of Song and Silence Trials
identity
(self)Convenience Function: Displays the Bird ID and Recording Date
-
Band_Pass_Filter
(self, order_num=175, FiltFilt=True, verbose=False)¶ Bandpass Filter Data using User Defined Frequency Bands
-
Define_Frequencies
(self, Instructions, StepSize=20, Lowest=0, Slide=False, suppress=False)¶ Creates Index for Frequency Pass Band Boundaries (High and Low Cuttoff Frequencies)
- Parameters
- Instructionsstr or tuple
- Instructions on how to Bandpass Filter Neural Data, options are {tuple, ‘Stereotyped’ or ‘Sliding’}
tuple: Custom Frequency Bands must be structured as ([Bottoms],[Tops])
‘Stereotyped’: Frequency Bands Previously defined in literature (From Wikipedia)
‘Sliding’: Sliding Band pass Filter that are further described by Optional Variables
- StepSizeint (Optional)
Required if Instructions set to ‘Sliding’ Width of All Bandpass Filters (defaults to 20 Hz)
- Lowestint (Optional)
Required if Instructions set to ‘Sliding’ Lowest frequency to start (defaults to 0)
- Slidebool (Optional)
Required if Instructions set to ‘Sliding’ If True Bandpass Filters will have a stepsize of 1 Hz (Defaults to False)
- Suppressbool (Optional)
Required if Instructions set to ‘Sliding’ If True Function’s print statements will be ignored (Defaults to False) [Helps to reduce unnecesary printing steps]
- Returns
- Toplist
List of High Frequency Cuttoffs
- Bottomlist
List of Low Frequency Cutoffs
-
Make_Backup
(self)¶ Quickly Backs Up Neural Data
-
Pipe_Reopen
(self)¶ Re-Opens Pipeline for Further Processing
-
Pipe_Steps
(self)¶ Convenience Function: Prints Pipeline Steps Used
-
Pipe_end
(self)¶ Marks end of Pipeline. Prevents accidental steps after all Processing Steps are Implemented
-
Re_Reference
(self)¶ Re-Reference Data using a Common Average Reference Filter that Excludes Channels Directed by User
-
Restore
(self)¶ Conveniece Function: Restores Neural Data to the Immediate Prior Step
-
Update_Log
(self, step)¶ Updates Log recording Processing Steps Implemented
-
Z_Score
(self)¶ Z-Score Input Data based on Equal Number of Song and Silence Trials
-
hilbert_amplitude
(self)¶ Hilbert Transform Input Data and take the Absolute Value based on Equal Number of Song and Silence Trials
-
hilbert_phase
(self)¶ Hilbert Transform Input Data and take the Absolute Value based on Equal Number of Song and Silence Trials
-
identity
(self)¶ Convenience Function: Displays the Bird ID and Recording Date