解释一下这个 DSP 符号

发布于 2024-08-15 17:16:11 字数 781 浏览 7 评论 0原文

我正在尝试实现 Karplus-Strong 拨弦算法的 此扩展 ,但我不明白那里使用的符号。也许需要多年的研究,但也许不会——也许你可以告诉我。

我认为下面的方程是在频域或其他什么方面的。从第一个方程开始,Hp(z),拾取方向低通滤波器。对于一个方向,您使用 p = 0,对于另一个方向,可能使用 0.9。在第一种情况下归结为 1,在第二种情况下归结为 0.1 / (1 - 0.9 z-1)。

替代文本 http://www.dsplated.com/josimages/pasp/img902.png< /a>

现在,我觉得用编码术语来说,这可能意味着:

H_p(float* input, int time) {
  if (downpick) {
    return input[time];
  } else {
    return some_function_of(input[t], input[t-1]);
  }
}

有人能给我一个提示吗?或者这是徒劳的,我真的需要所有 DSP 背景来实现这个?我曾经是一名数学家……但这不是我的领域。

I'm trying to implement this extenstion of the Karplus-Strong plucked string algorithm, but I don't understand the notation there used. Maybe it will take years of study, but maybe it won't - maybe you can tell me.

I think the equations below are in the frequency domain or something. Just starting with the first equation, Hp(z), the pick direction lowpass filter. For one direction you use p = 0, for the other, perhaps 0.9. This boils down to to 1 in the first case, or 0.1 / (1 - 0.9 z-1) in the second.

alt text http://www.dsprelated.com/josimages/pasp/img902.png

Now, I feel like this might mean, in coding terms, something towards:

H_p(float* input, int time) {
  if (downpick) {
    return input[time];
  } else {
    return some_function_of(input[t], input[t-1]);
  }
}

Can someone give me a hint? Or is this futile and I really need all the DSP background to implement this? I was a mathematician once...but this ain't my domain.

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

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

发布评论

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

评论(1

轻许诺言 2024-08-22 17:16:11

所以 z-1 只是表示一个单位的延迟。

让我们取 Hp = (1-p)/(1-pz-1)。

如果我们遵循“x”表示输入、“y”表示输出的约定,则传递函数 H = y/x (=输出/输入),

因此我们得到 y/x = (1-p)/(1-pz< support>-1)

或 (1-p)x = (1-pz-1)y

(1-p)x[n] = y[n] - py[n -1]

或:y[n] = py[n-1] + (1-p)x[n]

即可实现此目的

y += (1-p)*(x-y);

在 C 代码中,除了使用输出“y”之外,无需任何其他状态 “ 作为状态变量本身。或者你可以采用更字面的方法:

y_delayed_1 = y;
y = p*y_delayed_1 + (1-p)*x;

就其他方程而言,它们都是典型的方程,除了第二个方程,它看起来可能是选择 HΒ = 1 的一种方法-z-1 或 1-z-2。 (N 是什么?)

这些过滤器有点模糊,除非您能找到一些预先打包的过滤器,否则它们对您来说会更难处理。一般来说,它们的形式为

H = H0*(1+az-1+bz-2+cz-3... )/(1+rz-1+sz-2+tz-3...)

你所做的就是写下 H = y/x,叉乘得到

H0 * (1+az-1+bz-2+cz-3...) * x = (1+rz-1+sz-2+tz-3...) * y

然后通过以下方式隔离“y”本身,使输出“y”成为其本身和输入的各种延迟的线性函数。

但在大多数情况下,设计过滤器(选择 a、b、c 等)比实现它们更困难。

So the z-1 just means a one-unit delay.

Let's take Hp = (1-p)/(1-pz-1).

If we follow the convention of "x" for input and "y" for output, the transfer function H = y/x (=output/input)

so we get y/x = (1-p)/(1-pz-1)

or (1-p)x = (1-pz-1)y

(1-p)x[n] = y[n] - py[n-1]

or: y[n] = py[n-1] + (1-p)x[n]

In C code this can be implemented

y += (1-p)*(x-y);

without any additional state beyond using the output "y" as a state variable itself. Or you can go for the more literal approach:

y_delayed_1 = y;
y = p*y_delayed_1 + (1-p)*x;

As far as the other equations go, they're all typical equations except for that second equation which looks like maybe it's a way of selecting either HΒ = 1-z-1 OR 1-z-2. (what's N?)

The filters are kind of vague and they'll be tougher for you to deal with unless you can find some prepackaged filters. In general they're of the form

H = H0*(1+az-1+bz-2+cz-3...)/(1+rz-1+sz-2+tz-3...)

and all you do is write down H = y/x, cross multiply to get

H0 * (1+az-1+bz-2+cz-3...) * x = (1+rz-1+sz-2+tz-3...) * y

and then isolate "y" by itself, making the output "y" a linear function of various delays of itself and of the input.

But designing filters (picking the a,b,c,etc.) is tougher than implementing them, for the most part.

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