What are the units for the rolloff parameter for the Elliptic filter in the DSPFilter library?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I am trying to make a lowpass elliptic filter. My signal is sampled at 10 Hz. I want to start the cutoff at .5 Hz. I want it to be 80dB down at 1 Hz. I am working on Linux, so I did not build all the demo code. I tried to put 80 in for the rolloff parameter. That did not work. It has to be a much smaller number. Does this code work?

Thank you.

Post

rthornthwaite wrote: Fri Jun 09, 2023 8:32 pm I am trying to make a lowpass elliptic filter. My signal is sampled at 10 Hz. I want to start the cutoff at .5 Hz. I want it to be 80dB down at 1 Hz. I am working on Linux, so I did not build all the demo code. I tried to put 80 in for the rolloff parameter. That did not work. It has to be a much smaller number. Does this code work?

Thank you.
On Matlab, something like :
elllpf.png
If you don't have Matlab in hands, to tweak it suitable for you, read the function description and then adjust the parameters in example at https://se.mathworks.com/help/signal/ref/ellip.html (run the example there and edit).
You do not have the required permissions to view the files attached to this post.

Post

rthornthwaite wrote: Fri Jun 09, 2023 8:32 pm I am trying to make a lowpass elliptic filter. My signal is sampled at 10 Hz. I want to start the cutoff at .5 Hz. I want it to be 80dB down at 1 Hz. I am working on Linux, so I did not build all the demo code. I tried to put 80 in for the rolloff parameter. That did not work. It has to be a much smaller number. Does this code work?
Do you mean https://github.com/vinniefalco/DSPFilters?

There seems to be an open ticket with people wondering what the parameters are supposed to mean exactly...

Post

By quick look at the DSPFilter source code, it might be transition width value in question.

Transition width = Width from the edge of the passband to the edge of the stopband.

https://ccrma.stanford.edu/~jos/sasp/Lo ... tions.html

Post

AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
juha_p wrote: Sat Jun 10, 2023 4:59 am
On Matlab, something like :

elllpf.png

If you don't have Matlab in hands, to tweak it suitable for you, read the function description and then adjust the parameters in example at https://se.mathworks.com/help/signal/ref/ellip.html (https://se.mathworks.com/help/signal/ref/ellip.html) (run the example there and edit).
I have Matlab, but I am a beginner with it. I did design the filter with Matlab. I need C++ code to implement it in my application. I read that it may be possible to have Matlab generate the C++ code. I am looking into how to use Matlab to generate the C++ code.
Last edited by rthornthwaite on Mon Jun 12, 2023 4:30 pm, edited 1 time in total.

Post

AUTO-ADMIN: Non-MP3, WAV, OGG, SoundCloud, YouTube, Vimeo, Twitter and Facebook links in this post have been protected automatically. Once the member reaches 5 posts the links will function as normal.
juha_p wrote: Sat Jun 10, 2023 12:10 pm By quick look at the DSPFilter source code (https://github.com/vinniefalco/DSPFilters/blob/master/shared/DSPFilters/source/Param.cpp), it might be transition width value in question.

Transition width = Width from the edge of the passband to the edge of the stopband.

https://ccrma.stanford.edu/~jos/sasp/Lo ... tions.html (https://ccrma.stanford.edu/~jos/sasp/Lowpass_Filter_Design_Specifications.html)
The parameter I am having trouble with is "rolloff." I found this definition: The rolloff rate is the filter output change rate versus frequency. It is expressed as a loss per decade (a ten-times increase in frequency) or per octave (a two-time increase in frequency. I want the filter to be 80 dB down, going from .5 Hz to 1 Hz. So that would be 80 dB per octave. The transition width is 1 octave, but that is only meaningful when we specify what the attenuation should be over that width.

Post

rthornthwaite wrote: Mon Jun 12, 2023 2:55 pm The parameter I am having trouble with is "rolloff." I found this definition: The rolloff rate is the filter output change rate versus frequency. It is expressed as a loss per decade (a ten-times increase in frequency) or per octave (a two-time increase in frequency. I want the filter to be 80 dB down, going from .5 Hz to 1 Hz. So that would be 80 dB per octave. The transition width is 1 octave, but that is only meaningful when we specify what the attenuation should be over that width.
Aren't transition width units in Hz (or rad/s ?) rather than in octaves?
transition-width i.2.1.jpeg
Also, if you set rolloff = 0.5 (Hz) then is the result OK?
You do not have the required permissions to view the files attached to this post.

Post

juha_p wrote: Mon Jun 12, 2023 3:52 pm Aren't transition width units in Hz (or rad/s ?) rather than in octaves?
Also, if you set rolloff = 0.5 (Hz) then is the result OK?
For a given cutoff you can convert transition width in Hz to octaves and vice versa. For an analog filter, if you scale the cutoff without changing anything else, the transition width stays the same in terms of octaves. For a digital (BLT) filter frequency warping applies as usual, so the fixed transition bandwidth in octaves only really holds approximately at low frequencies.

The thing to keep in mind though is that for a given order the transition bandwidth is a function of the passband and stopband ripple factors. If you want to specify all three, you typically have to try different orders until you find one that satisfies the requirements.

I really wish I could help more with this... but elliptic filters are a bit complicated and I've mostly forgotten the details of how to design them. Vadim has a treatment in The Art of VA Filter Design if I recall correctly. Alternatively if you can get Matlab to decompose a design into biquads (for a numerically stable implementation), then that's an option too.. but I never bothered learning Matlab.

Post

mystran wrote: Mon Jun 12, 2023 6:26 pm
...

The thing to keep in mind though is that for a given order the transition bandwidth is a function of the passband and stopband ripple factors. If you want to specify all three, you typically have to try different orders until you find one that satisfies the requirements.

I really wish I could help more with this... but elliptic filters are a bit complicated and I've mostly forgotten the details of how to design them. Vadim has a treatment in The Art of VA Filter Design if I recall correctly. Alternatively if you can get Matlab to decompose a design into biquads (for a numerically stable implementation), then that's an option too.. but I never bothered learning Matlab.
Yes, order and ripple settings matters.

Regarding design of elliptic filters, Sophocles J. Orfanidis gives some details in his : Lecture Notes on Elliptic Filter Design

Other reading regarding those design parameter's: M. Vlcek and R. Unbehauen : Degree, ripple, and transition width of elliptic filters

Post Reply

Return to “DSP and Plugin Development”