Does the resample function do sinc interpolation before resampling?
5 ビュー (過去 30 日間)
古いコメントを表示
I have original samples x of x(t) taken at t=kT_s where k is integer and T_s is the sampling period. From these samples, I want to find the samples of the x(t) at time instants t=kT_s+delta. My initial instinct is to reconstruc x(t) from the original samples using the sinc interpolation, and use the resample function at the new time instants. However, I'm not sure if I provided the resample function with the original samples and the new sampling times, it would do the interpolation under the hood.
0 件のコメント
回答 (1 件)
Jon
2023 年 7 月 11 日
編集済み: Jon
2023 年 7 月 11 日
It sounds like you are not resampling at a new frequency (the main purpose of resample) but instead creating samples of a delayed version of your original sequence. Since delaying in the time domain is equivalent to phase shifting in the frequency domain, you can transform your signal to the frequency domain, phase shift it and then transform it back to the time domain.
I haven't tested this code, but it looks like the approach is illustrated by @Prabhan Purwar's contribution: https://www.mathworks.com/matlabcentral/answers/483938-time-shifting-an-audio-in-a-frequency-domain?s_tid=mwa_osa_a
1 件のコメント
Jon
2023 年 7 月 11 日
If your sample rate is relatively high, so, very small changes between your sample points, you could also approximate obtaining the phase shifted samples simply by using interpolation in the time domain, for example:
% Example waveform
T = 0.001;
t = 0:T:1;
x = sin(t*2*pi)+cos(0.5*t*2*pi+pi/3);
% Delayed samples
delta = 0.0123;
tShift = t+delta;
xShift = interp1(t,x,tShift)
% Plot results
plot(t,x,'o-',tShift,xShift,'*')
% Zoom in
plot(t,x,'o-',tShift,xShift,'*')
xlim([0.335,0.345])
参考
カテゴリ
Help Center および File Exchange で Multirate Signal Processing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!