Matlab 中与伽罗瓦域的离散积分有什么问题

问题描述 投票:0回答:1

我想在Matlab中实现与伽罗瓦域的离散积分,其中时间步长不是恒定的。 假设是这样的:

enter image description here

我的尝试

function [ int ] = integrate_matlab( YDataVector, a, b )
%integrate_matlab Calculate the discrete integral
%   Discrete Matlab Integration
%   int_1^N x(t_k) * (b-a)/N, where t_k = a + (b-a) k/N
%
%   YDataVector - Galois vector (255 x 1 gf), this is signal,
%   which values you can reach by YDataVector.x
%
%   int - returns Galois vector (255 x 1 gf)

N = length(YDataVector);
for k=1:N
    tk = a + (b - a) * k/N;
    int = xtk(YDataVector, k) * (b - a) / N;   
         %   How to implement the function xtk(YDataVector)?
end

然后是函数 xtk

function [ xtk_result ] = xtk( YDataVector, k )
%xkt Summary of this function goes here
%   YDataVector - Galois vector (255 x 1 gf), this is signal
%   xtk_result - Galois vector (255 x 1 gf)
%   k - index, this must be here to be able calculate different xtk for different iterations

    xtk_result = ; //  I do not know what to fill here

end

我对 tk 的数学级数方程 x(tk) 感到困惑。 我知道我现在做错了。 写作 x(tk) 只是让我感到困惑,因为我认为它是一个包含该系列的函数。 我知道它是某个时间点的信号,这里是YDataVector,但是如何实现它我已经忘记了。 我可能应该首先迭代这个系列:

t_0 = a;
t_1 = a + (b - a) * 1/N;

这似乎没有帮助,因为 tk 不是迭代定义的。

在实现 x(tk) 系列时我想错了什么?

matlab discrete-mathematics numerical-integration galois-field
1个回答
3
投票

假设t包含x的每个元素对应的时间(存储在YDataVector.x中)。然后,如果我正确理解你的问题,你可以得到 x_tk 与这样的东西:

N = length(YDataVector.x) ;
k = 1 : N;
tk = a + (b-a)* k/N ;
x_tk = interp1(t,YDataVector.x,tk);

© www.soinside.com 2019 - 2024. All rights reserved.