LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
7.83k stars 988 forks source link

Filter inconsistencies ( internal instruments and LADSPA fx ) #1276

Closed mikobuntu closed 9 years ago

mikobuntu commented 9 years ago

I have noticed this for a long time now and I'm unsure if this is a bug or just a standard that can't be helped...

e.g Apply a high pass filter to any instrument Triple_osc is a good example now play a sine note #A2 this corresponds to 110hz , now apply a setting of high pass 200hz even up to around 1000hz and we can still see a reading a good amount above -70db ( i believe this to be the noise threshold for human hearing, am i correct? )

I expect that whatever our filter is set to that "no audio whatsoever will pass below/above ( depending on filter choice ) this point.

This is the same behaviour for any LADSPA filters i have tried too.

I was beginning to think that maybe there was a problem with LMMS's Spectrum analyser, but i also have done various tests in Audacity and spek and houston i think there may be a problem.

I do understand that audio can have harmonics in higher frequencies ( should a single sine wave tho ? ), maybe there is some kind of aliasing going on here, im not too familiar with these things, So basically should there be any audio leaking through a filter ???

thanks Mikobuntu ;)

Spekular commented 9 years ago

I'm pretty sure the cutoff point of a filter is where it starts to decrease volume, and volume doesn't actually cutoff immediately, it's a gradual change (over frequency). Maybe this is why?

mikobuntu commented 9 years ago

@Spekular perhaps you are right, Im just thinking that if enough tracks were depending on filters to shred unwanted frequencies, and especially in the same range this could result in audible noise that would make for a muddy mix.

mikobuntu commented 9 years ago

hmmm for a better more audible test, i used a single sine wave freq 2093.00hz ( note #C7 ) with a long note ( 8bars, to dismiss the gradual change over freq ) My low pass on the triple_osc is set to 500hz and there is a very audible amount of high frequency passing through the filter at around -40db, you can go lower too with the lowpass filter and still get audio.

screenshot from 2014-11-07 21 02 06

Spekular commented 9 years ago

Ah, I didn't mean change over time, sorry. My wording was kinda bad. I mean that the filter might start at 1000hz but only cut off all sound at 800hz, gradually cutting off more as you near 800hz. So on a graph with frequency on the x axis and volume on the y axis, a filter is a downwards slope, not an immediate drop. Of course the rolloff/gradient isn't that large, but I hope this makes more sense than my last comment.

mikobuntu commented 9 years ago

@Spekular Oh yes i understand you now this could maybe be a way of avoiding clicks in the audio too. I think i will fire up a Renoise and work with the same sine as a sample and the same filter settings and analyse the rendered audio to compare. I will try a few other tests on various daws etc and report back when i get the chance.

mikobuntu commented 9 years ago

@Spekular seems you are totally correct !! On my initial test using Renoise with a 100hz sine ( created in audacity ) their filters, even with a fast ramp highpass ( butterworth 8n ) the behaviour is the same. i don't think i need to test this any further and i will close the issue out, but it was a good learning experience for me ;)

tresf commented 9 years ago

I believe what you are describing is resonant frequencies (resonance can usually be disabled in these types of plugins). Do you experience this with resonance cranked all the way down to zero (or as close to zero as the plugin allows)?

I believe resonant frequencies are an inherent part of the normal HPF/LPF electronic circuitry. Here's a snippet from allaboutcircuits.com (mostly over my head)

The inductors should block any high frequencies, while the capacitor should short out any high frequencies as well, both working together to allow only low frequency signals to reach the load
At first, this seems to be a good strategy, and eliminates the need for a series resistance. However, the more insightful student will recognize that any combination of capacitors and inductors together in a circuit is likely to cause resonant effects to happen at a certain frequency. Resonance, as we have seen before, can cause strange things to happen. Let's plot a SPICE analysis and see what happens over a wide frequency range: (Figure below)

diizy commented 9 years ago

On 11/07/2014 10:36 PM, Mikobuntu wrote:

I have noticed this for a long time now and I'm unsure if this is a bug or just a standard that can't be helped...

e.g Apply a high pass filter to any instrument Triple_osc is a good example now play a sine note #A2 this corresponds to 110hz , now apply a setting of high pass 200hz even up to around 1000hz and we can still see a reading a good amount above -70db ( i believe this to be the noise threshold for human hearing, am i correct? )

I expect that whatever our filter is set to that "no audio whatsoever will pass below/above ( depending on filter choice ) this point.

You expect wrong. You need to read up on rolloffs.