• Matlab reconstruct signal form sample points, convulsion


    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 ) = s i n ( 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')
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 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.
  • 相关阅读:
    Android 蓝牙开发( 四 )
    openEuler 22.03 LTS SP3(华为欧拉)一键安装 Oracle 12CR2 RAC(220118) 数据库
    springboot毕设项目宠物领养系统 0t08x(java+VUE+Mybatis+Maven+Mysql)
    354俄罗斯套娃信封问题
    mysql8.0数据库中explain查询及优化方案
    集线器与交换机、虚拟局域网(3.3)
    精简docker的导出镜像
    python subprocess.cal调用wkhtmltohtml中遇到的问题
    【深度学习笔记】9_5 多尺度目标检测
    Java 类型转换和运算符计算
  • 原文地址:https://blog.csdn.net/libizhide/article/details/128164197