Scaling of time
22 views (last 30 days)
Paulo Silva on 21 Jun 2011
load the file and do something like this
Ts=0.001; %signal sampling
t=0:Ts:19; %time vector (in your case it's the first row)
Tss=10; %new sampling
tt=t(1:Tss:end); %take a sample every Tss samples
Your mat file must have the time in the first row and the signal in the second, it's the same procedure for the second line, save the mat file [t;s]
If your data is an exact multiple of the decimation factor, then you may want to use
tt = mean(reshape(t,10,));
tt = median(reshape(t,10,));
This at least takes the information inside each period in to account rather than just throwing it away.
If you have the signal processing toolbox, you may wish to use
tt = decimate(t, 10);
Gurudatha Pai on 21 Jun 2011
I am of the opinion that the question and solutions offered here don't match. Your question seems to be of a compression. However, I don't see how you can compress a signal from 19s to 1.9s (or at least it is not clear to me) .
What everybody has suggested is some version of down-sampling and a corresponding decrease of sampling frequency. And hence, the signal length in time is still 19s but it has less number of samples, obviously.
If your question is to say, play an 19s audio file in 1.9s, you could just increase your sampling frequency in
In effect, you have played a 19s signal in 1.9s. (Does it make sense to do that, is perhaps defined by your problem at hand)
dwt (discrete wavelet transforms) might be another mechanism for reducing the data to 1/10th of the original while still maintaining the characteristic signal shapes.