Author Topic: How to build a band pass filter out of the IT filter  (Read 264 times)

Offline Eddy67716

  • Shy artist
  • Posts: 6
  • Operating System: Windows 10
How to build a band pass filter out of the IT filter
« on: August 01, 2022, 03:55:11 »
I have built a Java implementation of the Impulse Tracker filter using the OpenMPT source code and this link: https://wiki.multimedia.cx/index.php/Impulse_Tracker#Resonant_filters

I am trying to build a filter with similar filter abilites as the SID filters like low pass, high pass, band pass and band limiting; but also with the ability to cascade the filters for up to 16 poles filtering.

I now need to figure out how to make a band bass filter but I have no Idea how.

I've coded a very basic one that doesn't work very well and that is the one I want to improve.

How would I compute the coefficiencies and combine the low and high pass filters for both band pass and band limiting

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,515
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: How to build a band pass filter out of the IT filter
« Reply #1 on: August 01, 2022, 20:40:37 »
In the end, the IT resonant filter is just a more-or-less standard IIR filter (implemented in direct form II), though the coefficients are custom and there is some clamping of the signal going on as well. You could have a look into the classic RBJ audio EQ cookbook to see if you can construct a bandpass using the same given inputs and coefficients as the IT filter algorithm provides. If that's not possible, I guess you can always go for poor man's bandpass by manually cascading an IT lowpass and highpass filter. From a quick look you are adding the results of the two filters instead of cascading them?
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Offline Exhale

  • Workaholic artist
  • ***
  • Posts: 289
    • http://www.exhale7.110mb.com
Re: How to build a band pass filter out of the IT filter
« Reply #2 on: August 04, 2022, 01:32:40 »
I admit I didnt think bandpass was possible in stock ompt, but this has got me intrigued - I looked up how to do bandpass on IIR and this is the first result that came up https://www.dsprelated.com/showarticle/1257.php
... which, I am going to be honest, to my untechnical mind just scared me.
Could you give an example of how we could cascade in OMPT? My first guess (probably wrong, please feel free to tell me how stupid I am being) is to make two clone instruments, phase inverted and then have them play at the same time (testing the theory as I go) then match the resonance, have one highpass and one lowpass and play with the cutoff...
It seems to do an interesting sweep - I will attach an example I played with (drawn sample, phase inverted)- but I very much doubt this is the answer.
Saga, if you could give a basic example, I would also be very interested in learning this.
___________________
The turtle moves!

Offline Saga Musix

  • OpenMPT Developers
  • *****
  • Posts: 7,515
  • aka Jojo
    • Download music, samples, VST plugins: Saga Musix Website
  • Operating System: Windows 10 x64
Re: How to build a band pass filter out of the IT filter
« Reply #3 on: August 04, 2022, 07:21:30 »
You can't cascade filters in OpenMPT, at least not without rendering the result of the first filter to a new sample first. Cascading means applying filters in series, cloning an instrument implies they are applied in parallel instead. The only thing you can do with phase inversion is turning a lowpass into a highpass filter and vice versa
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.