Does the resample function do sinc interpolation before resampling?
4 次查看(过去 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!