matlab resample,resample matlab实现
使用線(xiàn)性插值實(shí)現(xiàn)sample rate轉(zhuǎn)換。
function output = simpleResample(input, inputfs, outputfs)
inputLen = length(input(:, 1));
outputLen = floor(inputLen * outputfs / inputfs);
output = zeros(outputLen, 1);
timeStep = inputfs / outputfs;
curTime = 1;
integer = 0;
frac = 0;
for i = 1:1:outputLen
integer = floor(curTime)
frac = curTime - floor(curTime);
if integer + 1 < inputLen
output(i, 1) = input(integer, 1) + frac * ( input(integer + 1, 1) - input(integer, 1));
end
curTime = curTime + timeStep;
end
win = fir1(13, 0.6, ‘low‘)
output = filter(win, 1, output);
end
原文:https://www.cnblogs.com/fellow1988/p/9906171.html
總結(jié)
以上是生活随笔為你收集整理的matlab resample,resample matlab实现的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: php背景图片随页面大小改变,css背景
- 下一篇: 分红派息散户有好处吗?