Matlab reconstruct signal form sample points, convulsion

本文介绍了一种新的信号重构方法——卷积法,并通过Matlab代码实现了不同采样频率下的信号重构。结果显示,当采样频率高于信号频率两倍时,重构效果良好;反之则出现频率降低的现象。

Usually we describe reconstruction as interpolation, and there are many approaches to reach it. In this article, I introduce a new method- convulsion

Main

  • signal function
    f(x)=sin(15πx+π/10)f(x)=sin(15\pi x+\pi/10)f(x)=sin(15πx+π/10)

  • Convulsion Method
    在这里插入图片描述

  • Description of code
    In this practice, I tested 3 different sample frequencies: 100, 20 and 10 Hz respectively. And the reconstruct frequency is 1000 Hz. As the signal function shows above, the signal frequency is 7.5 Hz.

  • Matlab code

clc;
clear;
sP=0.01;
sX=[0:sP:1];
sY=sin(15*pi*sX+pi/10);
sR=0.001;
xR=[0:sR:1];
N = length(sX);         % number of samples
yR = zeros(size(xR));
for t = 1:length(xR)
    for n = 0:N-1
        yR(t) = yR(t) + sY(n+1)*sin(pi*(xR(t)-n*sP)/sP)/(pi*(xR(t)-n*sP)/sP);
    end
end
subplot(3,1,1)
plot(sX,sY, ".");
hold on;
plot(xR,yR, "-");
title('0.01s intervals')

sP=0.05;
sX=[0:sP:1];
sY=sin(15*pi*sX+pi/10);
sR=0.001;
xR=[0:sR:1];
N = length(sX);         % number of samples
yR = zeros(size(xR));
for t = 1:length(xR)
    for n = 0:N-1
        yR(t) = yR(t) + sY(n+1)*sin(pi*(xR(t)-n*sP)/sP)/(pi*(xR(t)-n*sP)/sP);
    end
end
subplot(3,1,2)
plot(sX,sY, ".");
hold on;
plot(xR,yR, "-");
title('0.05s intervals')

sP=0.1;
sX=[0:sP:1];
sY=sin(15*pi*sX+pi/10);
sR=0.001;
xR=[0:sR:1];
N = length(sX);         % number of samples
yR = zeros(size(xR));
for t = 1:length(xR)
    for n = 0:N-1
        yR(t) = yR(t) + sY(n+1)*sin(pi*(xR(t)-n*sP)/sP)/(pi*(xR(t)-n*sP)/sP);
    end
end
subplot(3,1,3)
plot(sX,sY, ".");
hold on;
plot(xR,yR, "-");
title('0.1s intervals')
  • Result

在这里插入图片描述

  • analysis
  1. As result shown above, the first and second graph revice the original signal perfectly with correct frequency and amplitude. But the frequency of the third one is not right due to the sample frequency (10Hz) is lower than 2 times of signal its original frequency (15Hz). Hence, the reconstruct signal has lower frequency.
在HALCON中,`reconstruct_points_stereo`函数用于重建多视角立体3D参考点 [^2]。 ### 功能概述 该函数主要用于多视角立体视觉中的3D参考点重建。其重建方法在`reconstruct_points_stereo`中有不同选项,如`'surface_pairwise'`或`'surface_fusion'`可在一个校准的多视点立体视觉设置中从预先选择的图像对中获得视差图像,并将收集到的三维信息融合在一个单一的表面重建中;`'points_3d'`则是通过从多个校准过的图像中提取的点对应,通过特定实现重建三维点 [^1]。 ### 相关函数关联 与`reconstruct_points_stereo`函数配合使用的还有一系列多视角立体模型相关的函数,例如: - `create_stereo_model`:用于创建一个多视角立体模型,在使用`reconstruct_points_stereo`之前,需要先创建该模型 [^2]。 - `set_stereo_model_image_pairs`:指定双目(成对)图像的表面立体重建,为`reconstruct_points_stereo`提供图像对信息 [^2]。 - `set_stereo_model_param`:设置多视角立体模型参数,可对重建过程的一些参数进行调整 [^2]。 ### 示例代码 由于未提供完整的代码示例,以下为根据功能推测的可能使用代码框架: ```python # 创建多视角立体模型 create_stereo_model(StereoModelID) # 设置多视角立体模型参数 set_stereo_model_param(StereoModelID, 'param_name', 'param_value') # 指定双目(成对)图像的表面立体重建 set_stereo_model_image_pairs(StereoModelID, ImagePairs) # 重建多视角立体3D参考点 reconstruct_points_stereo(StereoModelID, 'points_3d', ObjectModel3DID) ``` ### 注意事项 使用`reconstruct_points_stereo`时,要确保多视角立体模型已正确创建,图像对已合理指定,并且模型参数设置符合实际需求。同时,不同的重建方法(如`'points_3d'`、`'surface_pairwise'`等)适用于不同的场景,需根据具体情况选择。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值