How to resample a signal by a fraction

Hello,
I have the time-domain received signal v(t) and I want to re-sample it at as v(t/(1+a)), where a is not an integer and it is in the order of ~10^-3. How can I do that in MATLAB, since the resample function requires that both P and Q be integer?
Thanks

 採用された回答

Matt Kindig
Matt Kindig 2013 年 5 月 19 日
編集済み: Matt Kindig 2013 年 5 月 19 日

0 投票

You could use interpolation instead. Something like this:
vnew = interp1( t, v, t/(1+a), 'linear');
You could use other interpolation approaches ('spline','cubic', etc.) as well, as appropriate.

1 件のコメント

Saed
Saed 2013 年 5 月 20 日
This seems to work just fine.
Thanks

サインインしてコメントする。

その他の回答 (2 件)

David Barry
David Barry 2013 年 5 月 17 日

1 投票

I suggest you reciprocate your a variable and round it to the nearest integer. You then just need to make sure you get the arguments the correct way in the resample function.
y = resample(x,p,q) resamples the sequence in vector x at p/q times the original sampling rate

5 件のコメント

Saed
Saed 2013 年 5 月 17 日
編集済み: Saed 2013 年 5 月 17 日
This is the problem, I do not want to round it to the nearest integer, since it always be 1. I want the resampling factor 1/(1+a) as is.
David Barry
David Barry 2013 年 5 月 17 日
Apologies, I missed your 1+a bit. In that case you need to change both P and Q in the resample function by multiplying up until you get the accuracy you need.
Example: Suppose I want to re-sample by 1/(1+a) where a was 1e-3.
1+1e-3 = 1.0010 so I might want to scale up by factor of 1000 and use values of 1000 and 1001 for P and Q.
Saed
Saed 2013 年 5 月 19 日
What do you mean by scale up by 1000? Like
if true
resample(x,1000*(1+a),1001);
end
?
David Barry
David Barry 2013 年 5 月 20 日
I mean having P and Q values of 1 and 1.0010 is the same as having P and Q values of 1000 and 1001.
Kir
Kir 2020 年 5 月 25 日
P and Q are integers

サインインしてコメントする。

Malcolm Lidierth
Malcolm Lidierth 2013 年 5 月 19 日

0 投票

Is this any help?
% SincResample returns the data convolved with a set of time-shifted windowed sinc functions, one for each of the samples [1..size(x,1)] in the input signal.

カテゴリ

タグ

質問済み:

2013 年 5 月 17 日

コメント済み:

Kir
2020 年 5 月 25 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by