Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Highlight duration offset or remove timestamps

I did an experiment in which participants listened to audio files. I would like to know

1). How can I highlight the offset of the audio file in the plots, i.e. mark the point in time at which listeners will have heard the audio file?

Since this might lead to potentially messy plots, perhaps a better alternative would be to remove timestamps before that time, hence question two:

2). How can I remove all timestamps in the trajectories that occur before the audio file has completed playing?

I assume 2). is also a bit tricky, as the duration of the audio file is different for each of the items.

Comments

  • Hi there,

    I think this question is somewhat similar to the following thread: https://forum.cogsci.nl/discussion/4412/selecting-data-for-mouse-measures

    However, here the difference is that the duration that should be excluded in a trial varies between trials. I have a potential workaround for implemeting 2 using mousetrap, assuming that the duration of the audio file is recorded in the trial data and stored within mt_data.

    Here is an example script. Please make sure to run it with the most recent version of mousetrap (3.2.0 on CRAN at the time of this post).

    library(mousetrap)
    
    # Get example data from mousetrap package
    mt_data <- mt_example
    
    # Create random time variable between 200 and 300 ms for example
    mt_data$data$random_time <- sample(200:300, size = nrow(mt_data$data))
    
    # Set xpos and ypos before this random time variable to constant value
    # (pick unusual value so it does not coincide with typical start position)
    mt_data$trajectories[,,"xpos"][mt_data$trajectories[,,"timestamps"]<mt_data$data$random_time] <- 9999
    mt_data$trajectories[,,"ypos"][mt_data$trajectories[,,"timestamps"]<mt_data$data$random_time] <- 9999
    
    # Check that implementation worked
    mt_data$data$random_time[3]
    mt_data$trajectories[3,,]
    
    # Remove initial phase in trial with constant position
    # (which removes all but the last of the recently set constant values in a trial)
    mt_data <- mt_exclude_initiation(mt_data, reset_timestamps = TRUE)
    
    # Set value of first position to second position
    # (to ensure that start position makes sense and does not resemble our weird values set above)
    mt_data$trajectories[,1,"xpos"] <- mt_data$trajectories[,2,"xpos"]
    mt_data$trajectories[,1,"ypos"] <- mt_data$trajectories[,2,"ypos"]
    

    Please note that this solution introduces an artifial constant interval of one logged position at the beginning of the trial (see last four lines of example code), however, assuming a constant high frequency recording of the cursor position (as is common in typical lab software like OpenSesame with the mousetrap plugin) this should not be an issue.

    Hope this helps!

    Best,

    Pascal

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games