0
$\begingroup$

Here's response of FIR design:

enter image description here

which shows SPL 0dB and here's a wave file exported from ( DRC ) FIR design software: FIR48kHz.wav.

Audio software (internally uses FFTW routines) where this filter is then used/measured reports +2 dB peak gain for full range 0-24kHz filter and +4dB for reduced range 0-20kHz filter (software measures max peak for the filter only).

Audacity's "mark sounds" tool reports the file have short sound area from 0.02s to 0.04s?

enter image description here

Could it be that phase change effects to the magnitude response at some location not seen in plot (i.e, there's something left below 20Hz or above 20kHz).

$\endgroup$
3
  • $\begingroup$ Are you sure your filter is a finite impulse response (FIR) filter? The recursive and nonrecursive FIR filters I've seen all have a linear phase response. $\endgroup$ Commented Mar 24, 2023 at 11:27
  • $\begingroup$ @RichardLyons, by DRC software it is: "DRC generates just the FIR correction filters, which can be used with a real time or offline convolver to provide real time or offline correction." $\endgroup$
    – Juha P
    Commented Mar 24, 2023 at 12:39
  • $\begingroup$ You can modify phase without changing magnitude over a percentage of the bandwidth with an FIR filter (such as from DC to 90% for example). The FIR "all pass" filters cannot be all pass from DC to Nyquist, but can in many cases by sufficient for most of that bandwidth. $\endgroup$ Commented Mar 24, 2023 at 22:25

4 Answers 4

2
$\begingroup$

It is possible to manipulate phase while maintaining constant amplitude over a portion of the Nyquist bandwidth with an FIR filter, but not over the full Nyquist bandwidth (DC to $f_s/2$ where $f_s$ is the sampling rate). A subset of FIR filters are linear phase which are composed of symmetric or antisymmetric coefficients. Under any other condition the phase can be non-linear, and we can then intuitively see that it would be feasible to manipulate the phase within the passband of the filter, while the amplitude within that passband remain flat (within a ripple constraint).

In most applications, this is sufficient since the percentage of bandwidth can typically be 85% or 90% depending on the allowable filter complexity. This won't provide an exact match but the error can be minimized based on the target response and filter length used.

The approach I would use to do this is a least squares solution based on the desired frequency response and has been detailed by our own MattL including example MATLAB code at his blog post copied here:

https://mattsdsp.blogspot.com/2022/10/fir-filters-with-prescribed-magnitude.html

$\endgroup$
1
$\begingroup$

FIR filters: is it possible to manipulate phase without change in magnitude response

Technically speaking: "not really". A filter whose transfer function has unity magnitude for all frequency is called an allpass. It can be shown that for any allpass the zeros must be inverse of the poles.

Since an FIR filter has all it's poles at $z= 0$ an FIR allpass would have to have all it's zeros at $z = \infty$ which is equivalent (roughly speaking) to have no zeros at all. The only transfer functions that can be created this away are

$$H(z) = \frac{1}{z^n}$$

which turns out to be an n-sample delay. So any FIR allpass would need to be a linear (or zero) phase delay. That's not what you have here.

It's hard to tell what's going in your picture. It would help if the phase could be unwrapped but this doesn't look like the transfer function of an actual filter. The magnitude is ruler flat which points towards allpass filter, BUT the phase of an allpass filter has some serious constraints: it is monotonically decreasing, and the phase is 0 at DC and $-N\cdot \pi$ at Nyquist where N is the filter order. That's not what you have here either.

It's possible that something non-flat happens below 20 Hz and 20 kHz but that would result in some sort of magnitude ripple in the pass band. You can always force a specific transfer function on an FFT grid and do an inverse FFT, but that typically results in a "strange" impulse response and it would be flat in the pass band. It only looks this way if you apply the same FFT that you used to design it.

$\endgroup$
0
$\begingroup$

Of course it is possible to do some manipulation of phase.

An FIR filter has all of its poles located at $z=0$ (as stable as they can be) but the zeros may be located all inside the unit circle (a minimum phase filter) or all outside the unit circle (a maximum phase filter) or some set of zeros inside or outside (which would be somewhere in between minimum and maximum phase). The relationship between inside or outside is the reciprocal function ($z \leftarrow \frac1z$).

All of these FIR filters have exactly the same magnitude frequency response everywhere at all frequencies..

$\endgroup$
0
$\begingroup$

Couldn't you have a variable length delay register to shift the phase of a signal? Essentially just an N sample long FIR filter with all coefficients equal to 1 where the group delay is tuned to achieve the desired phase shift?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.