Help with an exercise about filters

Mar 3, 2011 at 11:16pm

Help with an exercise about filters

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
#55318
Mar 3, 2011 at 11:39pm

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

#199108
Mar 4, 2011 at 12:11pm

Thank you so much!

#199109
Mar 13, 2011 at 9:17am

@n00b_meister

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

I am having problems making your biquad work, I have tried many different things. I made a patch that uses your biquad patch and compares it to max msp’s biquad.

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

Thanks

Attachments:
  1. biquadIssue.png
#199110
Mar 13, 2011 at 3:43pm

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

#199111
Mar 14, 2011 at 3:48am

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. –
#199112
Mar 14, 2011 at 6:47am

[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.

#199113
Mar 15, 2011 at 1:51am

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.

#199114

You must be logged in to reply to this topic.