Edge distortion when resampling a signal
7 次查看(过去 30 天)
显示 更早的评论
I have the follwing cosine signal that is sampled at rate fs = 32 Hz.
f = 30;
fs = 32;
dt = 1/fs;
t = -0.5:dt:0.5;
c = cos(2.*pi.*f.*t);
figure
plot (t,c)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/262399/image.jpeg)
I want to upsample it as follows:
figure
ty = linspace(-0.5,0.5,270)
y = resample(c,1003,123);
plot(ty,y)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/262400/image.jpeg)
But as you can see there is distrotion at the edge. Is there any way to avoid that?
0 个评论
采纳的回答
Star Strider
2020-1-18
From the documentation:
‘When filtering, resample assumes that the input sequence, x, is zero before and after the samples it is given. Large deviations from zero at the endpoints of x can result in unexpected values for y.’ (In: Resample Linear Sequence)
Minimize it by increasing the filter order and using a Kaiser window.
For example:
y = resample(c,1003,123, 16, 192);
Experiment with these and other additional arguments to see the result.
更多回答(0 个)
另请参阅
类别
在 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!