如何将采样率的影响添加到差分方程中?

发布于 2024-10-12 03:50:56 字数 1255 浏览 12 评论 0原文

我想实现下面的差分方程来设计累加器和微分器:

累加器:
y[n] = y[n-1] + x[n],其中 y[n] 是第 n 个输出,x[n] 是第 n 个输入。

差异化因素:
y[n] = x[n] - x[n-1],其中 y[n] 是第 n 个输出,x[n] 是第 n 个输入。

累加器:

double xn, yn, yn1 = 0;
std::vector<double> InputVector = GetInputVector(), OutputVector;
for(int i=0; i<MAX_NUM_INPUTS; i++)
{
    if (IsFinished()) break;
    yn = yn1 + xn;
    yn1 = yn;
    OutputVector.push_back(yn);
}

微分器:

double xn, yn, xn1 = 0;
std::vector<double> InputVector = GetInputVector(), OutputVector;
for(int i=0; i<MAX_NUM_INPUTS; i++)
{
    if (IsFinished()) break;
    yn = xn - xn1;
    xn1 = xn;
    OutputVector.push_back(yn);
}

输入向量中的数据源自连续时间信号。换句话说,对其进行采样以获得这个离散时间信号。它的采样率是 Td

当我增加输入信号的采样率时,累加器输出的幅度。这是预料之中的,因为恰好有更多样本需要区分。另一方面,随着采样率的增加,微分器的输出幅度减小。当采样率是单一的(即 1.0 个样本/秒)时,微分器和积分器的幅度都是正确的(数学表明它们必须是正确的值)。

我的问题是;
如何消除采样率对输出向量的影响?

我的一般问题是;
假设我从任意因果离散时间传递函数 H(z) 获得差分方程。在这种情况下,差分方程可以是任何值。在这种一般情况下如何消除采样率的影响?

(请参阅此论坛帖子了解更多详细信息: 相关论坛帖子

I want to implement the difference equations below to design an accumulator and a differentiator:

Accumulator:
y[n] = y[n-1] + x[n], where y[n]is the n'th output and x[n] is n'th the input.

Differentiator:
y[n] = x[n] - x[n-1], where y[n]is the n'th output and x[n] is n'th the input.

Accumulator:

double xn, yn, yn1 = 0;
std::vector<double> InputVector = GetInputVector(), OutputVector;
for(int i=0; i<MAX_NUM_INPUTS; i++)
{
    if (IsFinished()) break;
    yn = yn1 + xn;
    yn1 = yn;
    OutputVector.push_back(yn);
}

Differantiator:

double xn, yn, xn1 = 0;
std::vector<double> InputVector = GetInputVector(), OutputVector;
for(int i=0; i<MAX_NUM_INPUTS; i++)
{
    if (IsFinished()) break;
    yn = xn - xn1;
    xn1 = xn;
    OutputVector.push_back(yn);
}

The data in the input vector is originated from a continuous time signal. In other words, it is sampled to obtain this discrete time signal. And it has a sampling rate Td.

When I increase the sampling rate of the input signal, the amplitude of the output of the accumulator. This is expected since there happens to be more samples to differentiate. On the other side, with the increasing sampling rate, the output amplitude of the differentiator decreases. The amplitudes of both differentiator and integrator are correct (at the values which the math says they must be) when the sampling rate is unitary (i.e.; 1.0 samples/second).

My question is;
How do I nullify the effect of the sampling rate at the output vector?

My general question is;
Suppose that I obtain a difference equation from an arbitrary causal discrete-time transfer function H(z). The difference equation can be anything in this case. How do I nullify the effect of the sampling rate in this general case?

(Please refer to this forum thread for more detail:
Relevant forum thread)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

人疚 2024-10-19 03:50:56

对于微分器:要获得不同采样间隔的相同结果,请将输出 y 除以 Td。

对于累加器(积分器):将输入x乘以Td。

For differentiator: To get same results for various sampling intervals divide the output y by Td.

For accumulator (integrator): Multiply input x by Td.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文