If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Linkwitz Crossfeed for headphone use
6 posts
• Page 1 of 1
Linkwitz Crossfeed for headphone use
Did not find this filter listed here so, attached is a schematic which tries to implement this paper by using (maybe) not so common coefficient calculation method. Coefficients are packed to degree 7 polynomials and then restored for processing by sample rate in use. For sake of less coding needed, one could turn these polynomials to use some other form.
Restoring accuracy is R^2=1 (OOCalc) and if accuracy isn't important (say R^2=~0.99999999.... is enough), coefficients for HSF and half of LPF could be restored by using simple linear interpolation equations (a*x+c).
This should be much faster way than what normal calculation method would be (I have tested only few calculations of coefficients using GCC and found out that calculation of one degree 7 polynomial takes about 1/3 of the time what it would take from a std::sin() call.
Q: Should there be some added delay somewhere?
Q: How to test/compare execution speed inside FS
Q: Is my Ruby code portable for DSP code component (now that it don't need condition checking)?
EDIT: Here are alternative coefficients (R^2 = ~0.999999999) for HSF filter implementation :
Restoring accuracy is R^2=1 (OOCalc) and if accuracy isn't important (say R^2=~0.99999999.... is enough), coefficients for HSF and half of LPF could be restored by using simple linear interpolation equations (a*x+c).
This should be much faster way than what normal calculation method would be (I have tested only few calculations of coefficients using GCC and found out that calculation of one degree 7 polynomial takes about 1/3 of the time what it would take from a std::sin() call.
Q: Should there be some added delay somewhere?
Q: How to test/compare execution speed inside FS
Q: Is my Ruby code portable for DSP code component (now that it don't need condition checking)?
EDIT: Here are alternative coefficients (R^2 = ~0.999999999) for HSF filter implementation :
- Code: Select all
a0 = 0.000454764819267 * x + 1.10825501598154;
a1 = -0.000454764819267 * x + 1.13578189262244;
b0 = 0.000572514987365 * x + 1.10469131204669;
b1 = -0.000572514987365 * x + 1.13934559655723;
- Attachments
-
- Linkwitz-Crossfeed_0.1.fsm
- (2.06 KiB) Downloaded 1021 times
Last edited by juha_tp on Thu Jun 11, 2020 11:43 am, edited 2 times in total.
- juha_tp
- Posts: 60
- Joined: Fri Nov 09, 2018 10:37 pm
Re: Linkwitz-Riley Crossfeed for headphone use
This could be a solution looking for a problem. Keep in mind Linkwitz wrote that paper in the early '60s, when exaggerated-panning ping-pong stereo was all the rage; very few recordings are mixed that way anymore - with sounds panned hard left or right.
Website for the plugins : http://kbrownsynthplugins.weebly.com/
- k brown
- Posts: 1198
- Joined: Tue Aug 16, 2016 7:10 pm
- Location: San Francisco, CA USA
Re: Linkwitz-Riley Crossfeed for headphone use
I would not worry about calculating the coefficients this or that way - it is done only once, after all.
The DSP part is not very CPU demanding as it is but if you want to make it leaner I would suggest a TDF2 topology instead of the direct form in your schematic. Various filter forms are explained here. Further optimization would be possible going assembly.
One more thing: recursive filters need some sort of denormal prevention, refer to viewtopic.php?f=4&t=2808&p=14873
The DSP part is not very CPU demanding as it is but if you want to make it leaner I would suggest a TDF2 topology instead of the direct form in your schematic. Various filter forms are explained here. Further optimization would be possible going assembly.
One more thing: recursive filters need some sort of denormal prevention, refer to viewtopic.php?f=4&t=2808&p=14873
-
martinvicanek - Posts: 1328
- Joined: Sat Jun 22, 2013 8:28 pm
Re: Linkwitz-Riley Crossfeed for headphone use
k brown wrote:This could be a solution looking for a problem. Keep in mind Linkwitz wrote that paper in the early '60s, when exaggerated-panning ping-pong stereo was all the rage; very few recordings are mixed that way anymore - with sounds panned hard left or right.
Yes, it's old paper but, lots of people still listen those old recordings... .
martinvicanek wrote:I would not worry about calculating the coefficients this or that way - it is done only once, after all.
...
Good to know, I thought that streamin type input in DSP code means that ruby code is looped continuously so that sample rate change becomes noticed? BTW, how is that sample rate taken in to ruby component since coding x= @fs results 'NoMethodError' (target is VST)?
Would it be different if all that math in Ruby box is done in DSP code component?
Also, I'm just testing this method to calculate coefficients because of it might help using matched response filters at same speed or even faster than common filters (as like RBJ and MZT) even when parametrized in real time.
- juha_tp
- Posts: 60
- Joined: Fri Nov 09, 2018 10:37 pm
Re: Linkwitz-Riley Crossfeed for headphone use
juha_tp wrote:I thought that streamin type input in DSP code means that ruby code is looped continuously so that sample rate change becomes noticed?
"Green" and Ruby components recalculate only when events are received at their inputs (i.e. from the left-hand side). In this case (and given also the advice below), the Ruby will recalculate only at the following times...
- When the VST host or soundcard reports a change of sample-rate.
- When the schematic or plugin is loaded.
- When the Ruby code is edited.
juha_tp wrote:how is that sample rate taken in to ruby component
There are three ways...
- When, as here, there is only a single Ruby input, its value can be obtained from @in.
- Multiple inputs are held in an array, accessed as @ins[0], @ins[1], @ins[2], etc...
- R-click the input, and select "N" from the context menu - you can now give the input a name (the name must contain only alphabet, number, and underscore characters, and must begin with an alphabet character). You can then access its value using @name. NB: Once in "naming mode", you can TAB through the inputs (and outputs) to name many in one editing session. Each input/output must have a unique name, of course!
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Don't stagnate, mutate to create!
-
trogluddite - Posts: 1730
- Joined: Fri Oct 22, 2010 12:46 am
- Location: Yorkshire, UK
6 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 112 guests