标签:rac function res tfs out tput NPU matlab实现 mes
使用线性插值实现sample rate转换。
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
标签:rac function res tfs out tput NPU matlab实现 mes
原文地址:https://www.cnblogs.com/fellow1988/p/9906171.html