3.66667

3.7 | 3 ratings Rate this file 5 Downloads (last 30 days) File Size: 2.83 KB File ID: #9094
image thumbnail

resampleX

by Ron Abileah

 

19 Nov 2005 (Updated 24 Oct 2006)

Resample time series

| Watch this File

File Information
Description

Resamples X(n). Y(n) = X(alpha*n), where alpha is a resample interval. For example, if X is data sampled at 1000 samples per second and you would like to transform it to the equivalent of 1100 samples per second use alpha= 1000/1100 (.9091); for 800 sample per second use alpha = 1000/800 (1.25).

ResampleX is similar to the MATLAB "resample" function (in the SignalProcesscing Toolbox). For most applications resampleX is much faster.

MATLAB release MATLAB 7.0.4 (R14SP2)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (3)
12 Mar 2006 Bill Winter

Line 94: m = round((0:(N2-1))/alpha) - (0:(N2-1));

You're essentially doing a nearest neighbor interpolation. You've upsampled the data by your factor of 'r,' but I believe that it's perfectly equivalent to running the command resample(X,r,r/alpha,0). Taking this into account, resampleX loses its speed advantage.

I do appreciate the fact that to run resample, r must be chosen to make r/alpha an integer. An exotic alpha could necessitate an enormous r to work in resample.

05 Oct 2006 D M

When I run resampleX(x,1) I don't get x back. Something seems wrong here ...

28 Apr 2010 mahmoud  
Please login to add a comment or rating.
Updates
05 Dec 2005

Changes incorporate comments and sugestions made two users. Changes are summarized in the comments included in the new m file.

08 Dec 2005

A user found a minor bug. The update has a fix, which improves the accuracy slightly.
Also, please note that there is a new screenshot, consistent with this new version.

23 Oct 2006

User commented that resampleX(x,1) did not return exatly x. The problem was tracked down and fixed. See comments in m file.

24 Oct 2006

Updated the comments in the m file.

Tag Activity for this File
Tag Applied By Date/Time
dsp Ron Abileah 22 Oct 2008 08:07:09
time Cristina McIntire 10 Dec 2008 17:01:00
series Cristina McIntire 10 Dec 2008 17:01:00
upsampling Cristina McIntire 10 Dec 2008 17:01:00
downsampling Cristina McIntire 10 Dec 2008 17:01:00
downsampling Mathieu 19 Mar 2010 11:45:15
downsampling Robert 24 Mar 2010 19:22:33
downsampling Hamid Satarboroujeni 05 Jul 2011 21:35:09
downsampling Stephanie 01 Aug 2011 07:56:30

Contact us at files@mathworks.com