data(GH)
dec = 250/50
##### resample all traces by reducing from 250 to 50 samples/s
DH = DECIMATE.SEISN(GH, sel=1:length(GH$JSTR), dec=dec ,
type="LP", proto="BU" , fl=2, fh=50, RM=FALSE, zp=TRUE )
##### compare
##### times in
### starting second should be the same
GH$info$sec[1:5] - DH$info$sec[1:5]
#### number of samples should be reduced
cbind(GH$info$n[1:5] , DH$info$n[1:5] )
### ending seconds should be close but not identical
cbind(GH$info$t2[1:5] , DH$info$t2[1:5] )
cbind(GH$info$dt[1:5] , DH$info$dt[1:5] )
cbind( sapply(GH$JSTR, 'length'), sapply(DH$JSTR, 'length') )
#### for visual comparison:
### par(mfrow=c(2,1) )
## g = swig(GH, sel=which(GH$COMPS=="V" ), SHOWONLY=0 )
## d = swig(DH, sel=which(DH$COMPS=="V" ), SHOWONLY=0 )
Run the code above in your browser using DataLab