使用MATLAB执行信号的上采样

时间:2015-08-23 16:03:23

标签: matlab signal-processing

我正在搜索将信号上采样3的代码,然后我找到了以下步骤

products_controller.rb

我不确定这些步骤应该如何执行呢?我只关注直觉

1 个答案:

答案 0 :(得分:3)

Wikipedia复制:

  

整数因子L的插值可以解释为两步过程,具有更高效的等效实现:

     
      
  1. 创建一个序列x_L [n],包含原始样本x [n],由L-1个零分隔。
  2.   
  3. 使用低通滤波器平滑不连续点,取代零。
  4.   

您还可以阅读更多详情herehere

函数upsample仅执行第一步,而函数resample执行它们。看看下面的代码,注意两个数字的差异:

close all; clear all; clc;

t = [0:0.03:1];
x = sin(4*pi*t);

% function resample performs interpolation
y = resample(x, 3, 1);
ty = [0:0.01:1.01];

figure;stem(ty, y, 'r*');
hold on;stem(t, x);

Result using function resample

% function upsample adds zeros
z = upsample(x,3);
tz = [0:0.01:1.01];

figure;stem(tz, z, 'r*');
hold on;stem(t, x);

Result using function upsample