CPU optimization

DSP related issues, mathematics, processing and techniques
Post Reply
flowstone
Posts: 21
Joined: Fri Aug 27, 2010 10:53 pm

CPU optimization

Post by flowstone »

I'm looking for ways to decrease the CPU utilization of my schematic without (yet anyway) resorting to assembly level stuff. One of the sections has 5 EQ bands, each of which can be selected to be one of the biquad family. I put in the 4 that I use the most (adjustable Q HP, adjustable Q LP, parametric peak/dip, and bass shelf), plus a bypass. I packed the stereo signal before going in the EQ block, which helps, but having all those filters idling when nothing is going into them seems like an area for big improvement.

Is there a way I can "shut down" a code section when no signal is present? In this case, there is a multiplexer upstream (driven by the filter selection) that sends the packed stream to one of the five choices (the four filters or the bypass route), so the unselected ones appear to be churning away, processing a non-existent signal. My first thought was to combine all the filters into one code block, which is easy with if/then/else branching, but I don't see how to mimic easily with masks.

Any suggestions for either method? Thanks in advance!
User avatar
admin
Site Admin
Posts: 231
Joined: Tue May 11, 2010 6:30 pm

Re: CPU optimization

Post by admin »

One option is to use a State Variable Filter. This is a single module that does all of the general filter types:

Bandpass, Hi-Pass, Low-Pass, Band Reject and Bypass

Here is an example: http://www.dsprobotics.com/support/viewtopic.php?f=11&t=95
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: CPU optimization

Post by trogluddite »

flowstone wrote:Is there a way I can "shut down" a code section when no signal is present?

Yes there is (come on Admin, wakey wakey)

As in SynthMaker, the CPU usage of a module will be shut down as long as its outputs are disconnected - but not it's inputs. Which does, admittedly sound rather counter-intuitive.
So the solution is to use a Selector primitive to select the appropriate filter output, rather than a multiplexer to select an input.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
flowstone
Posts: 21
Joined: Fri Aug 27, 2010 10:53 pm

Re: CPU optimization

Post by flowstone »

Thanks for the insight! It didn't occur to me to "unplug" the outputs. I'll definitely give it a try.

Sincerely,
Clayton
VPDannyMan
Posts: 118
Joined: Mon Jan 04, 2010 4:50 am

Re: CPU optimization

Post by VPDannyMan »

I bet we can get that CPU down a bit further too. If you can, post your schematic and we'll have a look..
Nice one Trog..
haha

edit:
Nevermind, I just noticed how old this post was.. haha
Post Reply