# Tag Info

## New answers tagged filter-design

1

Half average length. What is it? Primarily something the author made up. They design a lowpass more or less as a weighted moving average filter. They simply use the window itself as the impulse response of the filter. That's NOT the same as designing an ideal low pass filter at the cutoff frequency you want and then windowing it down to the filter order. ...

0

The minimal specification for a FIR lowpass filter designed by the Parks McClellan algorithm is the passband edge, the stopband edge, and the filter order. You don't need to specify passband and stopband ripples; they are the result of the design process. What you can do is specify passband and stopband error weights, which let you specify the relation ...

1

HINT: How many zeros of $H(e^{j\omega})$ do you count? Does that say anything about the (minimum) order of the corresponding polynomial?

2

All real-time filtering (as opposed to post processing) wirh FIR and IIR filters will have start up transitions based on the state of the filter at start up. For optimum rejection of AC noise , Instead of a Butterworth Filter consider using an 2nd order IIR notch filter with the notch set at your AC frequency (such as 50 Hz). A design for this is further ...

1

As mentioned in a comment, I would probably try to re-design the filter at the new sampling rate. Take equidistant samples of the magnitude of the existing filter between DC and the new Nyquist frequency as a desired response. Since you want to make sure that the new filter has zeros at integer multiples of $60$ Hertz, split your new filter response into two ...

7

You can apply a so-called all-pass transformation to a discrete-time low-pass prototype filter in order to convert it to other standard filters (such as high-pass, band-pass, and band-stop). This is accomplished by transforming the complex variable $z$ in the transfer function of the prototype filter by a function $G(z)$ which satisfies $|G(e^{j\omega})|=1$, ...

1

This is meant as a stepping stone up to Dan's answer. The units for frequency at the sample level are radians per sample. You've got: $$400 \frac{cycles}{second} \cdot 2 \pi \frac{radians}{cycle} / 8000 \frac{samples}{second} = \frac{\pi}{10} \frac{radians}{sample}$$ That is your target $\omega_t$. Sound is a real valued signal, so you can model it like ...

1

Bottom Line: $$A <1$$ $$B =2\cos(\omega_n)$$ Where $\omega_n$ is the normalized angular frequency of the desired notch location (in this case for the OP with a sampling rate of 8KHz and notch at 400 Hz this would be $\omega_n = 2\pi400/8000 = \pi/10$), resulting in $B \approx 1.902$ and $A$ is the frequency notch bandwidth parameter; the closer $A$ is to ...

0

If all you want to do is simply check that the output of the matched filter is correct, do it without noise. The autocorrelation should have a distinct shape that you can look up anywhere online. It is sinc-like and will have a general shape like this The pulse width and the bandwidth of the chirp will change where the nulls are located and the width of the ...

1

In the absence of noise, the output of the matched filter is exactly the autocorrelation function of the input signal, delayed in time so that the peak autocorrelation is at the chosen sampling time (cf. the first part of this answer on this forum). I don't recall off the top of my head what the autocorrelation function of a linear FM chirp signal is, but ...

1

If your routine works correctly for converting positive numbers, you could just use it to convert a negative number by first adding the value of the sign bit (MSB) to the negative number (which must make it positive if it is not out of range), then convert the resulting positive number, and finally add the sign bit. Example: convert the number $-0.7$ to Q3.9 ...

1

You could have added to your question why you doubt the correctness of those numbers. Anyway, the group delay of a moving average is indeed constant. It's just the parameter 'window size' that is off by one. The window size $N$ is the number of taps of the moving average filter, and the group delay is related to the window size by $$\tau_g=\frac{N-1}{2}$$ ...

0

The prototype filter is not uniquely defined by the two band edges of the filter to be designed. So you have to choose one of the two edge frequencies of the prototype filter. E.g., if you choose $\omega'_p$, you can compute the value of $\alpha$ according to $$\alpha=\frac{\sin[(\omega'_p-\omega_p)/2]}{\sin[(\omega'_p+\omega_p)/2]}\tag{1}$$ where $\omega_p$ ...

2

This is just an empirical formula found by Kaiser for determining the necessary filter length for a given transition width. That formula is given as Equation $(7.30)$ on page $332$: $$M=\frac{A_s-7.95}{2.285\,\Delta\omega}+1\tag{1}$$ I think that Kaiser came up with a formula for determining the filter order (hence without the $+1$ in the equation), and the ...

1

A true moving average would have unity gain coefficients but also be divided by the total number of samples (as per the definition of average). This is trivial since it is just a scaling factor, but if the OP divides the output of the moving average by the total number of samples in the filter then the magnitude response will be normalized to 0 on a dB scale,...

0

Yes. The number of taps or coefficients in a FIR filter (or window length as you call it) tell the order of the filter. A more general way to see it, to avoid confusions, is to think of the order as the largest delay in the filter. For example, consider the following naive reverb: $$y[n] = a x[n] + (1 - a) x[n-D]$$ Even though there are only two (visible) ...

1

Don't quantize the numerator and denominator coefficients of the total transfer function. Use the coefficients of the second-order sections - sos in Matlab - and quantize those. You will usually implement an IIR filter using second-order sections, especially in a fixed-point implementation. The first thing to do is to scale the coefficients of the second-...

1

From the code you can see that they compute the maximum passband ripple by computing the minimum value of the filter's magnitude response in the passband. Similarly, they compute the maximum value of the magnitude response in the stopband, corresponding to the maximum stopband ripple.

2

You have to check the next derivative, because the first one is zero anyway at $\omega=0$. The second derivative is $$3\omega^2+2\zeta^2-1\Big|_{\omega=0}=2\zeta^2-1\tag{1}$$ which can be made zero by choosing $\zeta=1/\sqrt{2}$.

3

You just need to evaluate the transfer function on the unit circle at the frequency of interest: $$H(e^{j\omega_0})=\frac{\displaystyle\sum_{k=0}^Nb_ke^{-jk\omega_0}}{\displaystyle\sum_{k=0}^Na_ke^{-jk\omega_0}}\tag{1}$$ and take the magnitude. For the special values $\omega_0=0$ and $\omega_0=\pi$, Eq. $(1)$ simplifies to $$H(e^{j0})=\frac{\displaystyle\... 2 Your problem is here, as Yiftah also pointed out: % Analog filter design: [b,a] = afd_butt(Wp,Ws,Rp,As) freqz(b,a) The a and b are not vectors of IIR filter coefficients or z-domain polynomials, they are s-domain polynomials. The code above uses the analog prototypes to calculate the s-domain polynomials. The name of the section also hints at it: 8.3. ... 3 You should use freqs instead of freqz. 0 welcome. As MMSE estimators are unbiased, try reducing Cramér–Rao bound and maybe your MMSE equalizer can achieve a better performance. Note that in general the MMSE estimator is known to be asymptotically efficient. Note also that you must specify criteria before say something is "optimal". Even so, it is usually not easy to prove the optimality. 2 Assuming that you understand the left-hand side of Eq. (8.47), for understanding the right-hand side you need to know that -1=e^{j\pi}, and that e^{j2k\pi}=1. So in order to obtain all 2N roots of (-1)^{\frac{1}{2N}} you rewrite -1 as$$-1=e^{j\pi}e^{j2\pi k}\tag{1}$$from which you get$$(-1)^{\frac{1}{2N}}=e^{j\frac{\pi}{2N}}e^{j\frac{2\pi k}{...

Top 50 recent answers are included