English 中文(简体)
1. 扩展Karplus-低发通行证过滤器
原标题:Extending Karplus-Strong with low pass filter

I have implemented a basic Karplus-Strong algorithm.
Ringbuffer, filling with white noise, output a sample from the front and append the average of first two elements to the end and delete the first element. Repeat last to steps.

For better results and control over them I tried to implement a extended version of the algorithm.
Therefore instead of an averaging filter I need a frequency filter like a low pass filter.
My averaging filter has two inputs and one output: avg(a,b) = (a+b)/2

The sample code on the wikipedia page gives as many outputs as inputs.
http://en.wikipedia.org/wiki/Low-pass_filter

I have found other (mathematic) versions like:
http://cnx.org/content/m15490/latest/
H(z) = (1+(1/z))/2
I guess z is a complex number.

Both version have two inputs but also two outputs.
How do I get one meaningful value out of this?
Or do I have to rewrite bigger parts of the algorithm?
If thats the case where can I find a good explanation of it?

最佳回答

过滤器是Finite Im脉冲反应过滤器的专业化。 You re using the moving averagemeth, 选择系数, 使用了N = 1. 它已经是一种低轨过滤器。

计算过滤器的系数和顺序,使之与特定频率反应相吻合,涉及trick数。 如果移动平均数符合你的账单,最好使用软件包计算系数。 Matlab是通常的选择,GNU 八月份是一个开放源方案。

问题回答

申请人可以多种方式表示:

  1. On the complex plain, your example H(z) = (1+(1/z))/2
  2. As a filter, y[i] = h[0]*x[i] + h[1]*x[i-1] + h[2]*x[i-2] + ...
  3. In the frequency domain, Y[f] = H[f] * X[f]

第二类实际上是混凝土和X阵列。 这也是最容易理解的。

先前的答复解释了何时开始建造过滤器。 假设您的过滤系数,即hs,那么,它只是概括了非否定性系数。

我认为,我看到你的要求。 虽然你们不需要不止一份产出。 在Wikipedia网页上,Karplus-Strong string合成算法需要长L的缓冲。

y [i] = x[i] + h[0]*y [i-(L+1)] + h/l*y [i-(L+2)] +

http://www.cs.princeton.edu/courses/archive/fall07/cos126/assignments/guitar.html 利用环状缓冲来持有最后的L项产出,y [i-1],...,y[i-L]。 最初为<代码>x[i]噪音值>;=L;然而,为<代码>i>Lx[i]=0。 该算法将具有空间效率,因为只有你储存L值。 信号x[i] for i>L刚刚添加到环绕缓冲区。

最后,作为警告说明,如果你不谨慎对待<代码>h的系数数和产出<代码>y的数值,则可能不会有所期望的行为。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签