Skip to content

fonction PLATEAU???

2 messages · Thibault Grava, Uwe Ligges

#
Hello,
 
I am working on extracting data from sound recording (fee bee song of the black-capped chickadee). I obtained a two column matrix with x=time(s) and y=frequency(khz). The part of the recording that is interesting me is when the frequency is stable. Does somebody ever used a fonction that extract only constant data among a huge list of data (sample= 180000)? 
 
Thanks
 
 
Thibault Grava 
PhD candidate, 
Natural Resources and Environmental Study (NRES)
University of Northern BC, Prince George, BC
phone office: (250) 960 6050 
email address: grava at unbc.ca
#
Thibault Grava wrote:
I do not quite understand: If the data is constant, why do you want to 
extract it in that case?
Anyway, if data is really constant, then try the rle() function which 
tells you about the run lengths of constant parts (and you can get end 
values by cumsum of the rle output):

x <- c(1,1,1,2,2,2,2,2,1,1)
rle(x)
cumsum(rle(x)$lengths)  # end values


Uwe Ligges