English 中文(简体)
Explain this DSP notation
原标题:

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.

最佳回答

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.

问题回答

暂无回答




相关问题
Playing a Sound With Monotouch

No matter what I try (build -> content, NSUrl, filename) I get a null exception : file not found when I try to play a .caf sound file in monotouch. //var path = NSBundle.MainBundle.PathForResource("...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

Play sound in iPhone web app with Javascript?

I m currently creating an iPhone web application for piano chords, and I wanted to add an option that would let the user press a Play button and play the selected chord. However, I m not sure how to ...

热门标签