Forums > MaxMSP

### Help with an exercise about filters

Mar 03 2011 | 11:16 pm

Hello.

I'm trying to create a filter kind of like a biquad for an exercise, using this formula – y[n] = a0 * x[n] + a1 * x[n-1] + a2 * x[n-2] – b1 * y[n-1] – b2 * y[n-2] with delays anda tape in and out, but i'm doing something wrong because it is not working. Can anyone help or point me in the right direction?

Thank you!

— Pasted Max Patch, click to expand. —

[attachment=155484,1880]

###### Attachments:
1. Picture1.png

Mar 03 2011 | 11:39 pm

I didn’t look at your patch, but there’s a detailed description of how to build a biquad in Max here (at 1:25), in my reply to this post

http://cycling74.com/forums/topic.php?id=31520

Brendan

Mar 04 2011 | 12:11 pm

Thank you so much!

Mar 13 2011 | 9:17 am

@n00b_meister

I followed the YouTube tutorial, thanks a lot. That was very helpful.

What am I doing wrong? Why do the spectrogram results look completely different?

Thanks

###### Attachments:

Mar 13 2011 | 3:43 pm

Hi

the tutorial I posted was a theoretical explanation; how the Max biquad implements delaytimes in the filter equation is something I don’t know. However, we do know that in practical terms the tapin~/out~ minimum delay time is restricted to the signal vector size as set in the DSP preferences. I demonstrated a theoretical delaytime of 1 sample (a delay of c. 0.022ms) an unfeasibly small amount. 8 samples gives c 0.18ms and 512 samples gives c 11.61ms. That’s as far as my maths goes I’m afraid. Clearly, different delay values fed into any filter equation will generate different results; I hope this helps

Brendan

Mar 14 2011 | 3:48 am

Thanks,

I recreated the biquad again, and used a vector size of 1 in the DSP options. It improved, but it’s still very inconsistent. I posted the patch.

Is there any way I can do this in max/msp without having to program the biquad in an external?

I am really looking forward for a real time solution to design filters like this. If max/msp isn’t the best option, do you know of other tools I can use?

``````
-- Pasted Max  Patch, click to expand. --

```
```
Mar 14 2011 | 6:47 am

[mxj~] might be your best option in Max. Although java is not very fashionable these days.
If you want to stay in MSP, and if you succeed with your idea, you could then embed the "sample-precision" DSP in a [poly~], to be able to work with other vector sizes in the main patch.
By the way, did you try to use the sample accurate [delay~] instead of tapin~/tapout~?
If you want to try out other tools, NI Reaktor’s Core layer is designed to do what you’re looking for.
Jean-Francois.

Mar 15 2011 | 1:51 am

I just tried to use delay~ with a delay size of 1 sample. The problem of using delay~ is that the IIR part of the filter creates a feedback loop and msp disables audio as soon as that happens. This is pointed out in delay~ help page.

http://www.cycling74.com/forums/topic.php?id=7387 in here they say the only way to get feedback with delay~ is to use send and receive or tapin~ tapout~.

The next thing I will try is your poly~ suggestion

I have Reaktor, thanks for that, I will try a little harder before I use Core layer.

Viewing 8 posts - 1 through 8 (of 8 total)

Forums > MaxMSP