Hot answers tagged

5

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º, ...


4

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 ...


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

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 ...


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: $$ ...


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 system $H^*(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

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 ...


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

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-...


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,...


1

I refer to the following structure of a phaser (from this article): Let's call the depth factor $a$, and the feedback factor $f$ ($|f|<1$). I assume that there are $2N$ first order allpass filters, each with transfer function $$A_0(z)=\frac{z^{-1}-b}{1-bz^{-1}},\quad |b|<1\tag{1}$$ The allpass frequency response is obtained by evaluating (1) on the ...


1

What they mean by a delay of $n$ degrees is simply in reference to the periodicity of the chirps. A period consists of the chirp sound plus an interval of silence. Let the period be $T$. If another chirp starts in the middle of the period of the first chirp, i.e. there is an offset of $T/2$, then the authors refer to this as a delay of 180 degrees. So the ...


1

Given that you have limited number of samples, you can perform a Discrete Fourier Transform and represent your sound in frequency domain (frequencies and phases). After that if you want to apply a delay of D degrees you can simply use the known Fourier transform below: $$ F\left \{ f(t-\theta) \right \} \rightarrow \hat{f}(w) \times e^{jw\theta} $$ ...


1

Assuming by "negative dispersion" you mean that lower frequencies travel faster, don't try to invert the phase, this will be like trying to have a time-traveling dispersion filter. Rather, design an allpass filter with phase delay that increases (rather than decreases) with frequency. If you're doing a 1st-order allpass, for example, D1(z) = (-0.9 + z^-1)/...


1

Maybe you'd be better off using Bessel-Thompson filters. Maybe one could find an all-pass that approximately corrects a Butterworth filter, but it looks rather hard.


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