# [sdiy] Multi-output comb filter?

Tom Wiltshire tom at electricdruid.net
Tue May 22 14:06:58 CEST 2018

```You’re basically running the sieve algorithm for finding prime numbers there, so if you find a pattern or a better method, you’re in line for the Fields Medal.

==================
Electric Druid
Synth & Stompbox DIY
==================

> On 22 May 2018, at 11:00, cheater00 cheater00 <cheater00 at gmail.com> wrote:
>
>   So what I thought might be feasible would be to eg get a single peak at
>   1 Hz, create a 1 Hz comb filter, then subtract a 2 Hz comb from it so
>   you're left with peaks at 1, 3, 5, 7, etc Hz, then subtract a 3 Hz
>   comb, so you're left with 1, 5, -6, 7, 9, 11, -12, etc Hz, then
>   subtract a 5 Hz comb etc. If you look at the first 249 such filters
>   (that's what I could quickly calculate), you will get these
>   coefficients:
>
>   +--0-+-00+-0-++0-0-0++
>   -00+00---0+++0-++0---0
>   0+-000+0-0+0++-0-+00+-
>   -0+--0-+00+--00+-0+++0
>   -0+0+++0-000---0-+-0--
>   +0--+00++00++000-0+--0
>   ++00---0+++0++00-0-00-
>   +0-++0+0-0-+-00-00--00
>   ++-0--+0+-+00--0-+-0-0
>   -0+++0++00++-0+++0+++0
>   +--00+-0---0-0+0+--0-0
>   000-+0
>
>   Meaning: 1 * comb at 1 Hz, -1 * comb at 2 Hz, -1 * comb at 3 Hz, 0 *
>   comb at 4 Hz, -1 * comb at 5 Hz, 1 * comb at 6 Hz, etc.
>
>   I assume this can be found for each nth peak, and a lot of the data
>   will be shared. Note you still need (nyquist/f) delays with 1 bucket, 2
>   buckets, ..., nyquist buckets. That's a good 468 megabytes at a 44.1
>   kHz sampling frequency. I wonder if this too can be shared somehow.
>
>   I don't really see a pattern to the coefficients - i used a program to
>   find them - does anyone else see any rule?
>
>   The program can be found here:
>   [1]https://lpaste.net/6557071818560110592
>
>   You have to use the deepseq package.
>   Change endHz to 250 and run firstPeakOnly from the repl. I'm not sure
>   if the last coeff will be the same as with 22050, as I haven't
>   calculated it up to that number, and I don't really have time to
>   optimize this any more.
>
>   On Tue, 22 May 2018 07:37 , <[2]rsdio at audiobanshee.com> wrote:
>
>     On May 21, 2018, at 10:04 PM, Corey K <[3]coreyker at gmail.com> wrote:
>> �  � Option 2: write out the Z-transform for your comb filter.
>     There will be
>> �  � one pole per peak, and these will be spaced at equal angles
>     around a
>> �  � circle in the complex place. Add a zero to perfectly cancel
>     the pole
>> �  � corresponding to the peak you want removed. This will in turn
>> �  � correspond to an FIR filter that you can run before or after
>> �  � filter.
>     Here�s an exercise that might prove interesting:
>     Write out the Z-transform for an ideal comb filter. Then convert
>     this to an FIR filter without any modification.
>     My question is this: Is the math perfect enough that you�d end up
>     with a single delay tap? I mean, that�s what a comb filter is, so I
>     wonder whether the Z-transform to FIR would actually guide you to
>     the simplest implementation. Granted, the FIR would probably be
>     equivalent to a string of individual Z-1 delays, but they�re
>     equivalent to a single, long delay so long as nothing taps the
>     intermediate samples.
>     I have a suspicion that things wouldn�t quite work out so perfectly,
>     and there�s be lots of taps, each with their own weight, and it
>     wouldn�t come out looking like the simple single-delay-plus-mixer
>     circuit.
>     Has anyone gone through the exercise to see how it turns out?
>     Brian
>     _______________________________________________
>     Synth-diy mailing list
>     [4]Synth-diy at synth-diy.org
>     [5]http://synth-diy.org/mailman/listinfo/synth-diy
>
> References
>
>   1. https://lpaste.net/6557071818560110592
>   2. mailto:rsdio at audiobanshee.com
>   3. mailto:coreyker at gmail.com
>   4. mailto:Synth-diy at synth-diy.org
>   5. http://synth-diy.org/mailman/listinfo/synth-diy
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at synth-diy.org
> http://synth-diy.org/mailman/listinfo/synth-diy

```