Disregard response triggers that have less than 50s RT or 2500 ms RT


Author
Message
smo
smo
smo
posted 3 Years Ago HOT
Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)Associate Member (61 reputation)
Group: Forum Members
Posts: 4, Visits: 11
Hi,

Our team is hoping to add some EEG triggers to an Inquisit task (Behavioral Pattern Separation Task - Object Version - Set C - English). All stimulus and response triggers work, but we have an issue when the response time (RT) of one trial was too long that the response trigger of that trial was counted as a response trigger of the following trial. We found this issue because we saw some trials had a RT of less than or equal to 50 ms, which is not a propobale RT people could have. We also saw one trial with two response triggers, one of which is probably from the previous trial. Therefore, we wanted to disregard those trials that have a 50 ms response trigger, which is a response trigger of the previous trial but is counted as a response trigger of the following trial.

Another issue we have are with those trials that have a 2500 ms response trigger and have a 2500 ms RT in the behavioural data (2500 ms indicates the end of trial, so we want to disregard those too). The behavioural data generated by Inquisit 6 worked well as it counted trials that had a 2500 ms RT as no response, but the bdf file (i.e. the EEG data file) will show one trigger only, which is a combination of a response trigger from the previous trial and a stimulus trigger for the next trial.

We wonder:
1. Is there a 50 ms buffer we can add to our code that can prevent any response that is <50 ms to send out a reposne trigger?
2. Is there a way to disregard a 2500 ms response trigger and make sure there is always a stimulus trigger sent out when there is an overalp between stimulus and response trigger?

The following is our trigger code.

Stimulus trigger
//20 for Targetsignal
<port targetsignal>
/ port = LPT1
/ subport = data
/ items = ("00010100")
</port>

//30 for luresignal
<port luresignal>
/ port = LPT1
/ subport = data
/ items = ("00011110")
</port>

//40 for foilsignal
<port foilsignal>
/ port = LPT1
/ subport = data
/ items = ("00101000")
</port>


Response Trigger
// 55
<port oldsignal>
/ port = LPT1
/ subport = data
/ items = ("00110111")
</port>

//66 for similar trials
<port similarsignal>
/ port = LPT1
/ subport = data
/ items = ("01000010")
</port>

//77 for new trials
<port newsignal>
/ port = LPT1
/ subport = data
/ items = ("01001101")
</port>[code]Stimulus trigger
//20 for Targetsignal
<port targetsignal>
/ port = LPT1
/ subport = data
/ items = ("00010100")
</port>

//30 for luresignal
<port luresignal>
/ port = LPT1
/ subport = data
/ items = ("00011110")
</port>

//40 for foilsignal
<port foilsignal>
/ port = LPT1
/ subport = data
/ items = ("00101000")
</port>


Response Trigger
// 55
<port oldsignal>
/ port = LPT1
/ subport = data
/ items = ("00110111")
</port>

//66 for similar trials
<port similarsignal>
/ port = LPT1
/ subport = data
/ items = ("01000010")
</port>

//77 for new trials
<port newsignal>
/ port = LPT1
/ subport = data
/ items = ("01001101")
</port>

<trial target>
/ontrialbegin = [
    values.stimulusselect = list.targets.nextvalue;
    trial.target.insertstimulusframe(picture.target, 1);
    trial.target.insertstimulustime(clearscreen, parameters.stimulusduration);
    trial.target.insertstimulustime(port.targetsignal, 50)
]

/stimulusframes = [1 = responsekeys_part2, targetsignal]
/validresponse = (values.responsekey_old, values.responsekey_similar, values.responsekey_new)
/ correctresponse = (values.responsekey_old)
/ responsemessage = (values.responsekey_old, oldsignal, 0)
/ responsemessage = (values.responsekey_similar, similarsignal, 0)
/ responsemessage = (values.responsekey_new, newsignal, 0)

/beginresponseframe = 1
/responseinterrupt = frames

/ontrialend = [
    trial.target.resetstimulusframes();
    if (trial.target.responsetext == values.responsekey_old) {
        values.responseCategory = "old";    
    } else if (trial.target.responsetext == values.responsekey_new) {
        values.responseCategory = "new";    
    } else if (trial.target.responsetext == values.responsekey_similar) {
        values.responseCategory = "similar";    
    } else if (trial.target.response == 0) {
        values.responseCategory = "";
        values.count_noresponses += 1;
    };

    values.stimulus = picture.target.currentitem;
    
    values.count_targets += 1;
    if (trial.target.response != 0) {
        values.count_targets_corr += 1;
        if (trial.target.correct) {
            values.count_oldtargets += 1;
        } else if (trial.target.responsetext == values.responsekey_similar) {
            values.count_simtargets += 1;    
        } else if (trial.target.responsetext == values.responsekey_new) {
            values.count_newtargets += 1        
        };    
    };

]
/trialduration = (parameters.stimulusduration + parameters.ISI)
/recorddata = true
/branch = [return trial.part2;]
</trial>

Note:
* presents a foil for parameters.stimulusduration
* collects response during that time
* updates summary variables
* calls trial.part2
<trial foil>
/ontrialbegin = [
    values.stimulusselect = list.foils.nextvalue;
    trial.foil.insertstimulusframe(picture.foil, 1);             
    trial.foil.insertstimulustime(clearscreen, parameters.stimulusduration);
    trial.target.insertstimulustime(port.foilsignal, 50)
]

/stimulusframes = [1 = responsekeys_part2, foilsignal]
/validresponse = (values.responsekey_old, values.responsekey_similar, values.responsekey_new)
/ correctresponse = (values.responsekey_new)
/ responsemessage = (values.responsekey_old, oldsignal, 0)
/ responsemessage = (values.responsekey_similar, similarsignal, 0)
/ responsemessage = (values.responsekey_new, newsignal, 0)
/beginresponseframe = 1
/responseinterrupt = frames
/ontrialend = [
    trial.foil.resetstimulusframes();
    
    if (trial.foil.responsetext == values.responsekey_old) {
        values.responseCategory = "old";        
    } else if (trial.foil.responsetext == values.responsekey_new) {
        values.responseCategory = "new";    
    } else if (trial.foil.responsetext == values.responsekey_similar) {
        values.responseCategory = "similar";    
    } else if (trial.foil.response == 0) {
        values.responseCategory = "";
        values.count_noresponses += 1;
    };
    
    values.stimulus = picture.foil.currentitem;
    
    values.count_foils += 1;
    if (trial.foil.response != 0) {
        values.count_foils_corr += 1;
        if (trial.foil.correct) {
            values.count_newfoils += 1;
        } else if (trial.foil.responsetext == values.responsekey_old) {
            values.count_oldfoils += 1            
        } else if (trial.foil.responsetext == values.responsekey_similar) {
            values.count_simfoils += 1;                
        };        
    };
]
/trialduration = (parameters.stimulusduration + parameters.ISI)
/recorddata = true
/branch = [return trial.part2;]
</trial>

Note:
* presents a lure for parameters.stimulusduration
* collects response during that time
* updates summary variables
* calls trial.part2
<trial lure>
/ontrialbegin = [
    values.stimulusselect = list.lures.nextvalue;    
    values.lurebin = item.lurebins.item(values.stimulusselect);    
    
    if (values.lurebin == 1) {
        values.L1 += 1;        
    } else if (values.lurebin == 2) {
        values.L2 += 1;        
    } else if (values.lurebin == 3) {
        values.L3 += 1;        
    } else if (values.lurebin == 4) {
        values.L4 += 1;        
    } else if (values.lurebin == 5) {
        values.L5 += 1;        
    } else {
        values.lurebin = "NA";        
    };

    trial.lure.insertstimulusframe(picture.lure, 1);        
    trial.lure.insertstimulustime(clearscreen, parameters.stimulusduration);
    trial.target.insertstimulustime(port.luresignal, 50)
]

/stimulusframes = [1 = responsekeys_part2, luresignal]
/validresponse = (values.responsekey_old, values.responsekey_similar, values.responsekey_new)
/beginresponseframe = 1
/ correctresponse = (values.responsekey_similar)
/ responsemessage = (values.responsekey_similar, similarsignal, 0)
/ responsemessage = (values.responsekey_old, oldsignal, 0)
/ responsemessage = (values.responsekey_new, newsignal, 0)
/responseinterrupt = frames

/ontrialend = [
    trial.lure.resetstimulusframes();
    
    if (trial.lure.responsetext == values.responsekey_old) {
        values.responseCategory = "old";        
    } else if (trial.lure.responsetext == values.responsekey_new) {
        values.responseCategory = "new";        
    } if (trial.lure.responsetext == values.responsekey_similar) {
        values.responseCategory = "similar";        
    } else if (trial.lure.response == 0) {
        values.responseCategory = "";
        values.count_noresponses += 1;
    };
    
    values.stimulus = picture.lure.currentitem;
    
    values.count_lures += 1;
    if (trial.lure.response != 0) {
        values.count_lures_corr += 1;
        if (trial.lure.correct) {
            values.count_simlures += 1;
        } else if (trial.lure.responsetext == values.responsekey_old) {
            values.count_oldlures += 1;            
        } else if (trial.lure.responsetext == values.responsekey_new) {
            values.count_newlures += 1;            
        };        
    };

    if (values.lurebin == "1"){
        if (trial.lure.responsetext == values.responsekey_old){
            values.L1O +=1;
        } else if (trial.lure.responsetext == values.responsekey_similar){
            values.L1S +=1;
        } else if (trial.lure.responsetext == values.responsekey_new){
            values.L1N +=1;            
        } else if ( trial.lure.response == 0){
            values.L1_NR += 1;
        };
    } else if (values.lurebin == "2"){
        if (trial.lure.responsetext == values.responsekey_old){
            values.L2O +=1;
        } else if (trial.lure.responsetext == values.responsekey_similar){
            values.L2S +=1;
        } else if (trial.lure.responsetext == values.responsekey_new){
            values.L2N +=1;            
        } else if ( trial.lure.response == 0){
            values.L2_NR += 1;
        };
    } else if (values.lurebin == "3"){
        if (trial.lure.responsetext == values.responsekey_old){
            values.L3O +=1;
        } else if (trial.lure.responsetext == values.responsekey_similar){
            values.L3S +=1;
        } else if (trial.lure.responsetext == values.responsekey_new){
            values.L3N +=1;            
        } else if ( trial.lure.response == 0){
            values.L3_NR += 1;
        };
    } else if (values.lurebin == "4"){
        if (trial.lure.responsetext == values.responsekey_old){
            values.L4O +=1;
        } else if (trial.lure.responsetext == values.responsekey_similar){
            values.L4S +=1;
        } else if (trial.lure.responsetext == values.responsekey_new){
            values.L4N +=1;            
        } else if ( trial.lure.response == 0){
            values.L4_NR += 1;
        };
    } else if (values.lurebin == "5"){
        if (trial.lure.responsetext == values.responsekey_old){
            values.L5O +=1;
        } else if (trial.lure.responsetext == values.responsekey_similar){
            values.L5S +=1;
        } else if (trial.lure.responsetext == values.responsekey_new){
            values.L5N +=1;            
        } else if ( trial.lure.response == 0){
            values.L5_NR += 1;
        };
    };
]
/trialduration = (parameters.stimulusduration + parameters.ISI)
/recorddata = true
/branch = [return trial.part2;]
</trial>

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search