# What does nonnegative zero-phase response mean?

I am not exactly sure what nonnegative zero-phase response means. If a filter is zero-phase (i.e. symmetric and non-causal), then what does nonnegative imply? And what are the conditions to satisfy it?

Context: This is an error I get in Matlab when trying to design min-phase filters: Error using firminphase>checknonnegative (line 79) The filter has to have a nonnegative zero-phase response.

Error in firminphase (line 38) checknonnegative(b);

Error in firgr>genfilter (line 323) hRet = firminphase(hRet, s.zero, 'angles');

• please provide a source or reference. The term doesn't make much sense without context Nov 30, 2020 at 22:07
• Sorry for the confusion. This is actually an error I get in Matlab: Dec 1, 2020 at 14:41
• dsprelated.com/freebooks/filters/… Jun 26, 2023 at 7:51

What they mean here is that the real-valued amplitude function of the linear phase FIR filter that you provide to the function must be non-negative, because it is interpreted as the desired squared magnitude of the minimum-phase filter. This amplitude function is referred to as zero-phase response, which is the frequency response of the filter when the coefficients are shifted such that they are centered around the origin, i.e., $$b[n]=b[-n]$$ is satisfied. Note that the filter length must be odd.
If $$N$$ is the (odd) filter length, the zero-phase response is given by
$$B_{zp}(e^{j\omega})=B(e^{j\omega})e^{j\omega(N-1)/2}$$
where $$B(e^{j\omega})$$ is the frequency response of the causal filter.
• 1. Since firminphase MATLAB function must satisfy none-negative zero-phase. You mean the firminphase function can only return minphase portion of just linear phase system? if not explain more please. If yes, why? 2.Exactly what is meaning zero-phase response. I understood that shifting over origine. but that is effects positive or negativeness, doesn't it?! Jun 26, 2023 at 7:33
• @mohammadsdtmnd: A zero-phase response is the response of a linear-phase filter with its impulse response shifted such that it is centered at the origin. But you can just use the filter coefficients of a linear phase filter as input to firminphase, as long as the corresponding (zero-phase) response is non-negative. See the example here, where they use a constrained design to avoid negative values of the zero-phase response. Jun 26, 2023 at 8:07