Phase shifter issues

Working on a simple 4-stage phaser plugin. The heart of the effect is a cascade of four allpass filters modulated by an LFO. So I essentially need to recalculate the filter coefficients after a number of samples determined by the plugin’s rate parameter. The coefficients depend on each filter’s break frequency (pi/2 phase response). I can load my plugin into my DAW but I am not hearing an effect. I’m using first order allpass filters placed in a ProcessorChain. I want to leverage the DSP module, so I suspect the issue has to do with filter updates not occurring due to block processing. I’ve done this before on an embedded system in C without issues, but that involved sample-wise processing.

I’ve been looking at the dsp::IIR::Coefficients documentation and it seems relatively vague as to what the “frequency” parameter refers to for the makeFirstOrderAllPass method. So:

  1. Just to confirm, is the makeFirstOrderAllPass frequency parameter indeed the break frequency?

  2. Does anyone have suggestions for grabbing LFO samples at the plugin-defined rate when processing on blocks of audio instead of samples? As of right now, I’m attempting to implement the LFO according to the “Modulating the signal with an LFO” section of Tutorial: Introduction to DSP.

Apologies if these are both fairly basic questions, I am still learning the framework. Thanks in advance for any help!

Focus on efficient sample-by-sample processing for your filters. You will need to update your LFO on this level anyway. If you rely on incoming blocks you will also not know in advance how much samples they contain, so a block approach will never give you predictable results and very likely result in audio glitches.

Well, what could that frequency parameter mean otherwise ?

Anyway, for a phaser audio effect, I suggest that you forget about the block based approach as well, and that you code you own filter so you can handle properly modulation, feedback and everything else :wink:

Haha just wanted to confirm I wasn’t crazy!

For some reason I thought the sample-wise processing might be too inefficient but I will definitely give this a crack! Thanks for the suggestions!

For a Phaser Effect, you should mix the Allpass output to the original signal, only this way you get the desired spectral notches.

1 Like