# Tag Info

6

This is achievable with two parallel all pass filters. The two all pass filters synthesize an odd ordered low pass filter whose pass band extends from -90º to +90º in the z-domain. (I will discuss this below). $$G_{lowpass}(z) = \frac{A_0(z)+z^{-1}A_1(z)}{2}$$ The low pass filter is then rotated by +90º so that its pass band extends from 0º to 180º, which ...

5

I have insufficient reputation to answer in the comments, so here goes: I believe Olli calculated his coefficients using some kind of genetic algorithm (I don't know the details). All I did was plot (from Olli's coefficients) the resulting pole/zero positions in the z-plane, and then take the logarithm to transform into the s-plane. Olli's poles and ...

4

For the Karplus-Strong algorithm, your primary concern is for phase delay, $$\tau_\phi(\omega) \ = \ - \frac{\phi(\omega)}{\omega}$$ rather than group delay. $$\tau_g(\omega) \ = \ - \frac{d \phi(\omega)}{d \omega}$$ where $$\phi(\omega) \ \triangleq \ \arg \left\{ H(e^{j \omega}) \right\}$$ and $H(z)$ is the transfer function of your filter, and $$... 3 Sort of. The inverse of an allpass filter is also an allpass filter and can simply be calculated by time flipping the impulse response. However that makes the filter non-causal. So you need to add bulk delay to make it causal again. As long as you don't need to do real time processing, that's typically not a problem. EDIT: add a specific example. The key ... 3 The Hibert transform will produce a signal with 90 degree phase shift. Look in Numpy documentation at scipy.signal.hilbert as a start. I'm not sure what you are actually trying to do, but you mentioned 90 degree phase shift and radio in the same post, so you may find the following article of use: http://home.comcast.net/~szemengtan/LinearSystems/hilbert.... 3 If I see it correctly, your transfer function is$$H(z)=\frac{1-\frac{1}{2}z^{-1}}{z^{-1}}=z-\frac{1}{2}$$This system is not a minimum-phase system because its pole is at infinity (as you've already pointed out). You could use a trivial all-pass filter with impulse response h[n]=\delta[n-1], i.e. a simple delay by one sample to change your original (non-... 3 As I mentioned in my comment, you're right that the unit of group delay of a discrete-time system is samples. And \Omega is indeed the normalized frequency in radians. The problem is that your final formula for the group delay of a first-order allpass filter is wrong (I didn't check the original formula). If you have an allpass system$$H(z)=\frac{a+z^{-...

3

The allpass part must have its zeros outside the unit circle, so it gets the zeros of your system, with the corresponding poles inside the unit circle. You get the correct pole locations by simply swapping the coefficients of the numerator polynomial: $$H_a(z)=\frac{2+3.125z^{-2}}{3.125+2z^{-2}}\tag{1}$$ The minimum phase part is obtained by taking the ...

3

The dip at Nyquist has to do with the fact that you didn't assign the value $0$ to the desired phase at Nyquist. You correctly assigned $0$ to the phase at DC, but you have to do the same at Nyquist, because a filter with real-valued coefficients has a real-valued frequency response at DC and Nyquist. So you just need 127 random numbers, not 128. But the ...

3

The given transfer function has a specific form. With the denominator polynomial $A(z)=2+bz^{-2}$, you can write the transfer function as $$H(z)=\frac{z^{-2}}{2}\frac{A\left(\frac{1}{z}\right)}{A(z)}\tag{1}$$ Since for $z=e^{j\omega}$ (i.e., on the unit circle, where we evaluate the frequency response), we have $|A(z)|=|A(z^{-1})|$, the magnitude of $H(e^{... 3 Just adding to the answer. The sign for recombining L/R filter alternates, so it's '-' for second order '+' for 4th order and so forth. The algebra is isn't all that pleasant so I will only go through the 2nd order. A second order L/R lowpass is simply the cascade of two first order Butterworth lowpass. The first order butterworths are $$L = \frac{1}{1+jx}, ... 2 First of all make sure that the magnitude of a_M is strictly less than 1; this is necessary for the filter's stability. Second, you use several unnecessary variables. This is no serious problem, but it makes it harder to see what's going on. For M=1 a simple pseudo-code would be v = x - aM * v_old; y = v * b + v_old; v_old = v; The important thing is ... 2 Here is a visual answer why it is not working. The overlap is not even symmetrical in the last step so the scheme can't work. Even if you make it symmetrical by making the filter zero-delay, the amount of stuff that gets summed together varies by time, so it can't be right. 2 First, observe that it's sufficient to show the property for a first-order all-pass filter, because any higher order all-pass filter can be written as a cascade of first-order all-pass sections. And if$$|G_i(z)|<1\quad\text{for}\quad |z|>1$$then also$$\left|\prod_iG_i(z)\right|<1\quad\text{for}\quad |z|>1$$must be satisfied. Now derive ... 2 Let me provide the same answer as provided by @msm, First of all I would like to replace the lattice with the following block diagram : In which I would like to introduce two new variables v[n] and w[n] to simplify the derivation. Let's use the \mathcal{Z}-transform approach which yields the easiest solution: From the diagram it's obvious that:$$ Y(z)... 2 This is called a lattice structure implementation of all-pass filters.$k_1$and$-k_1$are scalar gains. The input to the delay element is $$a[n]=x[n]-k_1a[n-1]$$ taking the$z-transform, the transfer function is $$A(z)(1+k_1z^{-1})=X(z)\Rightarrow A(z)=\frac{X(z)}{1+k_1z^{-1}}$$ and the output is \begin{align} y[n]&=k_1a[n]+a[n-1]\\ \end{align} ... 2 In an all-pass filter we should have $$H(z)H^*(1/z^*)=c^2$$ which means that the poles and zeros of the systemH^*(1/z^*)$cancel the zeros and poles of$H(z)$. As a result, an all-pass filter has conjugate-reciprocal pole-zero pairs. For this system: $$H^*(1/z^*)=\frac{4z^2+1}{-z^2+4}$$ So $$H(z)H^*(1/z^*)\neq c^2$$ You can also see that the poles ... 2 I did use Differential Evolution to calculate the coefficients. But you can re-design the filter pair easily using the HIIR library by Laurent de Soras (its source code will automatically unzip to a subdirectory hiir). You can use this C++ HilbertDesign.cpp source and compile with g++ using the compile-command quoted on the first line: // -*- compile-... 2 It's the same issue as other high-order filters being factored down to the poles and zeros and implemented with cascaded low-order filters. We'll assume all of your original coefficients are real. The Fundamental Theorem of Algebra says that every polynomial with real coefficients can be factored to first-order monomials with real roots and irreducible ... 2 This depends a bit how rigorous you define "allpass" filter. You can show that any pole can be turned into an allpass filter if, and ONLY if, it you pair it with a zero at the inverse location. A zero at the inverse location is the only way to achieve$|H(\omega)|^2 = 1$for all$\omega$. Poles can be complex or real. Complex poles result in second order ... 2 D'oh. This turned out to be pretty obvious, and I should have gotten it from reading more closely. I would have deleted this out of shame, but instead will share the correction in hopes it saves someone else the same headache. The controlling equations for the LR2 high and low pass transfer functions are correct, but one of the signals needs to be ... 2 I would like to add to the previous answers that the difference between a second-order highpass and a second-order lowpass filter is generally NOT an allpass filter. The resulting transfer function $$H(s)=\frac{s^2-\omega_0^2}{s^2+\frac{\omega_0}{Q}s+\omega_0^2}\tag{1}$$ has two zeros at$s_0=\pm\omega_0$and two poles which are either real-valued (for$Q\le\...

1

I am not sure how one would avoid complex math or why one would want to given the simplification complex math provides (an oxymoron due to poor naming or perhaps to scare those that don't know yet how easy it is away) but perhaps the graphical explanation can help provide further intuitive insight. First some necessary background: $z$ is the domain of all ...

1

First of all, your filter coefficients are given by b = g * [1, b1, b2] a = [1,a1,a2] And second, I believe that it is the phase delay that you're interested in, not the group delay. The phase delay at frequency $\omega_0>0$ is given by $$\tau_p(\omega_0)=-\frac{\phi(\omega_0)}{\omega_0}\tag{1}$$ where $\phi(\omega)$ is the (unwrapped) phase of the ...

1

Pick two different frequencies slightly above and below your target frequency. The choice depends on what numerical precision you have available and what your sample rate is. Calculate the z-transform at both frequencies Calculate the phase at both points, make sure to check for "phase wrapping" Subtract the phases and divide by the frequency difference ...

1

Referring to: https://www.dsprelated.com/freebooks/filters/Allpass_Filters.html The answer is sort of, but there are some special cases to keep in mind. Multiplying by a unit complex number (I.e. a phase shift) would be an all pass filter, but I would not consider it a first order filter. You might call it a zero order, but it’s really just a scalar. ...

1

Hint: Write the transfer with a general coefficient $a$ (instead of the value $0.8$) in the numerator as well as in the denominator. Compute the magnitude of the numerator for $z=e^{j\omega}$. Compute the magnitude of the denominator for $z=e^{j\omega}$. Show that both magnitudes are equal, regardless of the value of the coefficient $a$, hence $H(e^{j\omega}... 1 A feedback loop like this (with enough phase diversity) will be stable if the magnitude of the loop gain is less than unity. In this specific example, it's really simple: make sure your feedback coefficient needs to be less than 1. So it's$|z|<1$, x and y don't really matter. 1 Since you don't say what response you're actually getting from Matlab, this is all guesswork. So let's do the basics: A little formula juggling.$\begin{align}A_0(z)&=1\\ A_1(z)&=\frac{-a+z^{-1}}{1-az^{-1}}\\[4em] H_{LP}(z)&=A_0(z)+A_1(z)\\ &= 1 + \frac{-a+z^{-1}}{1-az^{-1}}\\ &= \frac{{1-az^{-1}}-a+z^{-1}}{1-az^{-1}}\\ &=... 1 There are no phase jumps. The discontinuities in the phase plot result from the computation of the principal value of the phase, which requires the phase to be in the range[-\pi,\pi)\$. But this is just a convention and has nothing to do with the physical system. Apart from issues with the principal value, the phase of allpass systems does not jump. Instead,...

Only top voted, non community-wiki answers of a minimum length are eligible