resolution and frequency display errors with filterdetail and plot~ object
Hi,
I'm trying to build a parametric eq that includes a magnitude and phase display using the plot~ object. However, I seem to be banging my head against two walls...
The first is that the filter display object does not seem to want to give me more than 16384 points. If I ask for 32768, it has no output... So, low frequency, high-Q filters don't have enough resolution at the output of the filterdetail object - particularly at high sampling rates.
The second is the frequency scaling of the plot~ object when in a log frequency display mode. It appears that the scaling is temperamental, but I can't seem to get it to behave properly.
If anyone has some advice on how to get around either of these (or tell me what I'm doing wrongly) - I'd appreciate the help!
thanks
- geoff
Hi Geoff,
Once list sizes climb above 256 items in Max the handling of those lists becomes challenging... every object responds differently. Both the filterdetail and plot~ objects are written such that they don't have any fixed size. However, internally the Max application represents argument lists using the C short
data type. This data type has a range of -32768 to 32767. Thus to preserve the needed power-of-two the effective maximum is 16384 as you discovered.
However, the objectionable display you are seeing will not be improved by increasing the number of points. These quantization problems you see in the domain can be resolved by turning off the data thinning attribute of the plot~ object which is discarding points.
In the patcher you provided I had no problem with domain not mapping to frequency correctly, but keeping the number of points to a power of two and ensuring that the plot~ and the filterdetail match is important. I also had no problem when switching sample rates.
I hope this helps!
Tim
Hi Tim,
Thanks very much for your help! Part of the solution lies in the data thinning (but still using 16k points). This is much better, however...
The frequency mapping seems to only be happy if I send
"definedomain 0. $1. log" (where $1 is the nyquist frequency coming in from the dspstate~ object...)
to the plot object, which makes the plot look a little weird, due to all the space at the bottom end of the scale.
If, for example, I change to the scale of the X-axis using
"definedomain 20. 20000. log,"
Then the frequency mapping falls apart.
So, it seems to me that, the "definedomain" of the plot~ object only changes the grid without re-mapping the data plot on that grid.
It's interesting that the plot on the filtergraph~ object behaves so nicely by comparison ... Maybe I should just go back to using that instead.
Thanks again!
-geoff
Hi Tim, Thank you for clarifying this about the filterdetail and plot~ objects.
I am having an issue with filterdetail. As you see from the attached patch (which is based on a crossover filter tutorial you posted), I cannot get the length of the IR that is output from filterdetail to have any length other then 256, irrespective of the value of numpoints in filterdetail. Is there any way to get the IRs to be longer? 256 is simply too short for capturing the low frequency character of many IRs I deal with.
Thank you for considering this question.
Hi Adam -- How are determining that it won't output more than 256? I just tried your patcher and I'm seeing a length of 16384 coming out of filterdetail
.
Cheers!
Thank you Tim. I figured out the problem. filterdetail was indeed outputting lists whose length is equal to numpoints but the output of zl.len was always 256 which made me think that the list is only that long. It then became clear to me that the issue is a limit of 256 in zl.len itself. Indeed I then learned in the help file for zl.len that it is limited by default to a length of 256 but can be changed to a length of up to 32,767 When I changed zl to "zl 32,767 len" I was able to get it to give the correct length for lists whose lengths does not exceed 32,767. Mystery solved.
Great! Glad you figured it out!
cheers