I need a function for regularising the time base of electronically acquired signals (i.e. vectors of samples with a nominally constant time base). For example, the accelerometer in my smartphone can deliver data at about 50 Hz, but the sampling rate varies by about 5% throughout a recording. I have developed signal processing functions that assume a constant sample rate, so I need to modify my input data vectors so that this assumption becomes true. Furthermore, if I want to combine signals from different sources that have different sampling rates, I will be obliged to harmonise the time bases, somehow. I have written routines in other languages to interpolate (generate a larger number of regularly spaced samples from the input series) or, what I call, "intrapolate" (generate a smaller number of regularly spaced samples from the input series), so it wouldn't be too hard form me to write a function that covers both, but I prefer not to reinvent wheels (unless my wheel is markedly better!) Can anyone tell me if there is already a package that might cover what I need? -- View this message in context: http://r.789695.n4.nabble.com/Is-there-a-time-series-resampling-function-tp4711907.html Sent from the R help mailing list archive at Nabble.com.
There are lots of them. You might be having trouble searching because you don't know how to spell "interpolate". ?approx ?spline Also look at the Time Series task view on CRAN. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. On September 6, 2015 4:54:45 AM PDT, AltShift <allennugent at hotmail.com> wrote:>I need a function for regularising the time base of electronically >acquired >signals (i.e. vectors of samples with a nominally constant time base). > >For example, the accelerometer in my smartphone can deliver data at >about 50 >Hz, but the sampling rate varies by about 5% throughout a recording. I >have >developed signal processing functions that assume a constant sample >rate, so >I need to modify my input data vectors so that this assumption becomes >true. >Furthermore, if I want to combine signals from different sources that >have >different sampling rates, I will be obliged to harmonise the time >bases, >somehow. > >I have written routines in other languages to interpolate (generate a >larger >number of regularly spaced samples from the input series) or, what I >call, >"intrapolate" (generate a smaller number of regularly spaced samples >from >the input series), so it wouldn't be too hard form me to write a >function >that covers both, but I prefer not to reinvent wheels (unless my wheel >is >markedly better!) > >Can anyone tell me if there is already a package that might cover what >I >need? > > > > >-- >View this message in context: >http://r.789695.n4.nabble.com/Is-there-a-time-series-resampling-function-tp4711907.html >Sent from the R help mailing list archive at Nabble.com. > >______________________________________________ >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide >http://www.R-project.org/posting-guide.html >and provide commented, minimal, self-contained, reproducible code.
Have you tried signal package? SF Il 06/set/2015 17:14, "AltShift" <allennugent at hotmail.com> ha scritto:> I need a function for regularising the time base of electronically acquired > signals (i.e. vectors of samples with a nominally constant time base). > > For example, the accelerometer in my smartphone can deliver data at about > 50 > Hz, but the sampling rate varies by about 5% throughout a recording. I have > developed signal processing functions that assume a constant sample rate, > so > I need to modify my input data vectors so that this assumption becomes > true. > Furthermore, if I want to combine signals from different sources that have > different sampling rates, I will be obliged to harmonise the time bases, > somehow. > > I have written routines in other languages to interpolate (generate a > larger > number of regularly spaced samples from the input series) or, what I call, > "intrapolate" (generate a smaller number of regularly spaced samples from > the input series), so it wouldn't be too hard form me to write a function > that covers both, but I prefer not to reinvent wheels (unless my wheel is > markedly better!) > > Can anyone tell me if there is already a package that might cover what I > need? > > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Is-there-a-time-series-resampling-function-tp4711907.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
I insist: as a trial, apply function "resample" (package signal) I think it's worth doing a test ( it performs resampling through bandlimited interpolation) SF Il 06/set/2015 18:52, "Jeff Newmiller" <jdnewmil at dcn.davis.ca.us> ha scritto:> There are lots of them. You might be having trouble searching because you > don't know how to spell "interpolate". > > ?approx > ?spline > > Also look at the Time Series task view on CRAN. > --------------------------------------------------------------------------- > Jeff Newmiller The ..... ..... Go Live... > DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live > Go... > Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/Batteries O.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --------------------------------------------------------------------------- > Sent from my phone. Please excuse my brevity. > > On September 6, 2015 4:54:45 AM PDT, AltShift <allennugent at hotmail.com> > wrote: > >I need a function for regularising the time base of electronically > >acquired > >signals (i.e. vectors of samples with a nominally constant time base). > > > >For example, the accelerometer in my smartphone can deliver data at > >about 50 > >Hz, but the sampling rate varies by about 5% throughout a recording. I > >have > >developed signal processing functions that assume a constant sample > >rate, so > >I need to modify my input data vectors so that this assumption becomes > >true. > >Furthermore, if I want to combine signals from different sources that > >have > >different sampling rates, I will be obliged to harmonise the time > >bases, > >somehow. > > > >I have written routines in other languages to interpolate (generate a > >larger > >number of regularly spaced samples from the input series) or, what I > >call, > >"intrapolate" (generate a smaller number of regularly spaced samples > >from > >the input series), so it wouldn't be too hard form me to write a > >function > >that covers both, but I prefer not to reinvent wheels (unless my wheel > >is > >markedly better!) > > > >Can anyone tell me if there is already a package that might cover what > >I > >need? > > > > > > > > > >-- > >View this message in context: > > > http://r.789695.n4.nabble.com/Is-there-a-time-series-resampling-function-tp4711907.html > >Sent from the R help mailing list archive at Nabble.com. > > > >______________________________________________ > >R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > >https://stat.ethz.ch/mailman/listinfo/r-help > >PLEASE do read the posting guide > >http://www.R-project.org/posting-guide.html > >and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
If Jeff Newmiller wrote> There are lots of them. You might be having trouble searching because you > don't know how to spell "interpolate".Hi Jeff, If you re-read my original post you will see the word interpolate, spelled correctly. I also used the made-up word "intrapolate" (I thought that using quotes in the post would make this obvious) because I am describing a process that is complementary to interpolation. My actual problem is that I don't know how to search CRAN effectively. I'm trying to address this deficiency now. -- View this message in context: http://r.789695.n4.nabble.com/Is-there-a-time-series-resampling-function-tp4711907p4711977.html Sent from the R help mailing list archive at Nabble.com.