11

See How many taps does an FIR filter need? In your case you'd need more than 1000 taps depending on the allowable ripple, as your cut-off frequency is less than fs/500. Alternatives : use an IIR, a simple order-1 DC removal filter could work great Average your signal and subtract the average in order to remove the DC Rick Lyons proposes a clever ...


5

Since this is an FIR, the group delay is D=(N-1)/2=20 samples. No, since this is a linear phase (i.e. symmetric or anti-symmetric) filter, the group delay is half the length! (being a FIR isn't sufficient.) The issue is that I get too peaks in the cross correlation, one at zero lag and another at 20 lag. Write down the formula for auto-correlation at ...


5

Here is the same experiment done in my blog: https://poweidsplearningpath.blogspot.com/2020/04/chapter-51-meaning-of-general-linear.html First, there is a tiny mistake in the question. Not all FIR filters have the properties of Linear Phase. Only the four types of FIR possess the properties. 1 By contrast, all of the IIR filters are not linear phases. For ...


4

Axel Mancino's answer is correct for causal filters. In general, FIR filters have poles at either $z=0$ or $|z|\rightarrow\infty$, or both. Take as an example a fourth-order causal FIR filter: $$H_1(z)=a+bz^{-1}+cz^{-2}+dz^{-3}+ez^{-4}\tag{1}$$ Clearly, $H_1(z)$ has all its poles at $z=0$. An anti-causal FIR filter such as $$H_2(z)=az^4+bz^3+cz^2+dz+e\...


4

You're right, there usually is a better IIR filter (if you have enough data). The discrete-time Wiener filter is not "by definition" FIR. It is common to constrain the filter to the FIR case because it's often more straightforward to implement, and because such a filter can be made adaptive more easily. Also, in practice you often want to consider only a ...


4

There are many good answers here. I will try to take the reverse approach in order to explain in very simple words what is necessary in order to keep the output's shape same as input's, and what exactly distorts the shape. You can keep this for intuition of Phase response not for exactness of mathematics. Interpretation of Phase response : Negative of ...


4

Two examples: Audio: The human ear isn't very sensitive to nonlinear phase (probably because the world filters sound with nonlinear phase filters). It is, however, sensitive to percussive sounds that "pre-ring"*; i.e., that start making sound before the main "bang". So for high-fi audio, one often wants to use minimum phase filters (which tend to have ...


4

$$1 - e^{-4j\omega} = e^{-2j\omega}(e^{2j\omega} - e^{-2j\omega}) \tag{1}$$ Now, $$ \sin(2\omega) = \frac{e^{2j\omega} - e^{-2j\omega}}{2j} \tag{2}$$ Equation 2 is a consequence of Euler's formula. Multiply and divide by $2j$ in (1) and use the identity (2) in equation 1 we have: $$1 - e^{-4j\omega} = 2je^{-2j\omega}\sin(2\omega) \tag{3}$$ Now $j = e^{...


4

The Invertible FIR Filter A constraint based on the first coefficient alone is developed as follows: From Cauchy's argument principle any FIR filter that meets the following constraint will be invertible (including marginal invertibility, change $\le$ to $<$ otherwise): $$\max\left(\arg \left( H(e^{j\omega}) \right)\right)-\min\left(\arg \left( H(e^{j\...


3

If your signal was a windowed complex exponential, then the maximum of the magnitude of its discrete-time Fourier transform (DTFT) would equal the frequency of the complex exponential: $$x[n]=\begin{cases}e^{jn\omega_0},\quad&n\in[0,N-1]\\0,\quad& \textrm{otherwise}\end{cases}\tag{1}$$ The DTFT of $(1)$ is easily computed from the convolution of ...


3

In order for H(z) to be a linear phase filter, it must zeros both on the inside of the unit circle and at the complementary locations (1/z) which are outside the unit circle. Therefore a linear phase circle has no stable causal inverse (since this would necessitate poles outside of the unit circle.) Note that a linear phase filter can be decomposed into ...


3

In general, there is no such requirement for notch filters that $H(e^{j0})=H(e^{j\pi})$ must be satisfied. You could definitely have a notch filter with $H(e^{j0})\neq H(e^{j\pi})$. Having the same gain at DC and at Nyquist is just a practical definition, and if you have a sufficient number of degrees of freedom (i.e., filter coefficients) you might as well ...


3

Allpass filters are very helpful in automotive mainly for getting the imaging dialed in. You often need to time align the contributions of different driver groups (left, center , right) at a specific listening position. Due to the complicated acoustics of the cabin. the delays are often dependent on frequency and so all passes can be very helpful in ...


3

Your confusion is understandable. If you consider the definition of linear phase FIR filter and the associated symmetry conditions on their impulse responses, then you can arrive the conclusion that the first two cases $$ h_1[n] = [0,0,0,1,0] $$ and $$ h_2[n] = [0,0,0,0,1,0,0,0,0,0,1] $$ are non-symmetric. However, as you use zeros and ones in those ...


3

The reason for this is that the maths centres on a false assumption: We know that the zeroes need to be complex conjugates Do the zeros need to be complex conjugates? Can they not be 2 real zeros? I sympathise here because I also read this book and the maths portion ended up utterly confusing me because of very odd methods. A more general method would ...


3

Question : How is the gain close to unity in the vicinity of 60Hz? Answer : It's not. Your $\omega_1$ mapping is not correct. Digital frequency $\omega \in [-\pi, \pi]$ in a filter response $H(e^{j\omega})$ is mapped to continuous frequency as follows :$$ f = \frac{\omega}{\pi} .\frac{f_s}{2}$$ $$\omega \in [-\pi, \pi] \rightarrow [-\frac{f_s}{2}, \...


2

From the mathworks documentation of the function envelope(): The filter is created by windowing an ideal brick-wall filter with a Kaiser window of length fl and shape parameter $\beta = 8$. So without hacking the function you can't directly get the filter coefficients, but you can easily find them yourself by just doing what they do, i.e., windowing the ...


2

For linear phase FIR filters, each zero at z = z0 will have a matching reciprocal zero at z = 1/zo. And for real-valued coefficients each zero at z = zo will have a matching conjugate zero at z = *zo. Thus for linear phase real-valued coefficients, when you place one zero on the z-plane you determine the location of the other three zeros.


2

This is what I would try: Ignore the $n(t)$ and $i(t)$ since you know nothing about them. I am assuming that $x$ is complex and the rest of the variables are all real. Take the complex natural log of both sides: $$ \ln \left( | x(t) | \right) + j \arg( x(t) ) = \ln(A) + j ( a t^2 + b t + c ) $$ Separate the real and imaginary parts. Using the imaginary ...


2

Without understanding more detailed results on what i(t) is, one solution is to estimate either the phase or frequency first, and then pass that result through a filter. An approach to do the frequency estimation digitally directly on the I (real) and Q (imaginary) samples of x(t) is the cross product frequency discriminator. After hard limiting x(t) to ...


2

If it's a linear phase FIR filter, then the inputs signals will be shifted (delayed) by an amount of group delay at the output. For a linear phase FIR filter of length $L = 2K+1$ the group delay will be $N = K$ samples. For even length $L = 2K$ FIR filters it will be at $N = (L-1)/2$ ; half-sample position. For non-linear phase FIR filters, group delay ...


2

Since you are seeing your filter coefficients and much larger than your signal, this is indicative that you have a very large "impulse" at the start of your signal. The coefficients of your filter is the impulse response for the filter, so that is exactly what you are seeing: the response to an impulse. Review the start of your time domain data for a very ...


2

You can describe a frequency response in terms of its real-valued amplitude and its phase: $$H(f)=A(f)e^{j\phi(f)}\tag{1}$$ Note that $A(f)$ is not the magnitude, but a bipolar amplitude function. Equivalently, you can express $H(f)$ in terms of its magnitude and its phase: $$H(f)=M(f)e^{j\tilde{\phi}(f)}\tag{2}$$ Now we have $M(f)=|A(f)|\ge 0$, and, ...


2

Inverting a channel can only be done when the channel is a minimum phase system (trailing echos only). A minimum phase system is characterized as having all zeros in the left half plane (for the s plane, or equivalently in a sampled system and the z plane all zeros inside the unit circle). Inverting such a channel results in poles where every zero exists, ...


2

As I said in a comment, no padding is necessary. A simple FIR implementation might look like (it is assumed that the filter kernel h[] has already been implemented) float y[N+M-1]; //set y[] to zero for(int i=0;i<N;i++){ //N - signal length for(int j=0;j<M;j++){ //M - filter kernel length (usually much shorter than N y[i+j] = y[i+j]+x[i]*h[j]; /...


2

To answer your last question, the impulse response having infinite length affects the output length in every possible way. In general, the output sequence of an IIR filter has an infinite length, even for a finite length input sequence. Of course, for stable filters and finite-length input sequences, the magnitude of the output samples decreases, and the ...


2

This could be homework, so I'll only give you a few hints to help you solve the problem yourself. Remember that a ZF equalizer just inverts the channel, so if $D(z)$ is the equalizer's transfer function, what must be the result of the product $C(z)D(z)=?$. From this equation you obtain $D(z)$, which is IIR. Let the coefficients of $D(z)$ be $d[n]$, i.e., $$...


2

I don't know if this is what you really want but, inspired by your 2nd attempt, I thought about the triangular window, which doesn't have to have the ends null (like Bartlett), but which has variable zeroes on the unit circle, depending on the taper, and I simply tried using h=[f, 1, f], with f=[0.5 : 0.1 : 10], and here are the results (normalized gain): ...


2

The problem might be solved already by the existing answers, but I thought I'd add my solution, which adds another degree of freedom resulting in a much closer match of the filters' magnitude responses. What I came up with is a simple system of four linear equations with the following conditions: unity gain at DC gain of the continuous-time (CT) filter at ...


2

The phase response is simply the phase angle you would get between the output and input for a tone at a given frequency $\omega$. Like the magnitude response it is therefore a function of frequency as each frequency can result in a different phase shift, so the result is $\phi(\omega)$. This post should now make more sense about what linear phase is and ...


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