I have made my own python script to work on the raw ECG data and sleep stage epochs.
My question: Is there any offset in data of sleep stages and raw ECG. For example, first sleep stage epoch is after some 100 seconds from the start of ECG data.
I know that sleep stages are scored using EEG. So may be, what I am looking for is the time difference between the start of EEG sampling and the start of ECG sampling. I know that being a PSG system this is highly unlikely, but I haven't gone through all the documentation and don't want to miss anything.
Thanks in advance,
It is very common for studies to contain raw ECG and EEG data before the first epoch marked as sleep. This is important in PSG because the time between a participant beginning their "time in bed" (which can occur at epoch 1) and sleep onset is an important statistic for various calculations. Some studies where participants have trouble initiating sleep can contain minutes or hours of ECG and EEG data before any sleep is scored.
During many PSG setups all leads (including EEG and ECG) are fully attached before beginning recording and can result in sampling of both starting simultaneously. In other cases raw data can be recorded during hookup for troubleshooting, and result in ECG (which is commonly attached first) appearing on the recording well before any EEG data. I would recommend using denoted "recording start", "lights off" or "start time in bed" notes when available as opposed to epoch 1 (e.g. the time between epoch 1 and "lights off" may contain raw data, but is not considered a usable part of the PSG).
I hope that adds some clarification.
Yes, this kind of answers my question. But to be really sure, I would like to re-iterate my question which I think was kind of confusing in the first time.
Question : Is it possible that EEG sampling starts at 0th second, and ECG sampling starts at 40th second. So the 1st recorded epoch (which would be an awake stage) will not relate to any data in ECG. And the 2nd recorded epoch, will relate to first 20 seconds of ECG data.
Now considering 125 samples/second for both EEG and ECG. Again (last 20 seconds of ) 2nd recorded epoch will relate to ECG data indexing from 0 to 2500 (20 *125), where as the indexes of EEG data for 2nd recorded epoch would be from 3750 (30 * 125) to 7500 (60 * 125).
Similarly, for 3rd recorded epoch ECG indexes would be 2500 (20 * 125) to 6250 (50 * 125) and for EEG would be from 7500 (60 * 125) to 11250 (90 * 125).
( OR, ECG sampling might have started before EEG sampling. )
Thanks in advance,
The short answer is that sampling should all begin at the 0th second, but does not always contain physiological data at this point.
There are various reasons related to hardware, software, technician process and patient setup that can result in physiological data not being recorded at the 0th second. Even if there is no physiological data being captured all channels will begin recording simultaneously and display either a value of zero or a wide range of values caused by artifact (caused by hardware/setup factors.) Looking for start times based on sampling rates must also note that sampling rates can vary between EDFs, cohorts and channels contained in the same EDF (ex. EEG sampled at 256 and ECG sampled at 512).