New answers tagged

0

However, {f~n} has a time shift comparing to the origin signal, and their amplitudes also have a deviation. Any causal system has a non-zero group delay. That's to be expected from systems theory! So, yes, you've got a shift. And, unless your ${h_n}$ is a linear-phase filter, that delay isn't even constant for different frequencies. This has nothing ...


2

The impulse response of a linear phase FIR filter is odd or even symmetrical. This has as a consequence that if $z_0$ is a zero, $1/z_0^*$ must also be a zero. If in addition to the linear phase property you also have real-valued coefficients, complex zeros always occur in complex conjugate pairs. So if a real-valued linear phase filter has a complex root $...


1

Direct-Form II is the canonical structure to implement an LCCDE, using minimum number of delay elements and multiplications. The input $x[n]$ is placed on the left, and the output $y[n]$ is on the right, complying with the signal processing conventions. DF-II structure, implements the poles (IIR part) before the zeros (FIR part), however this may be ...


0

Is there a way to use a Kalman Filter to improve these measurements if I have no physical rule... No. Kalman filters add value by using a model of a process to refine an estimate of the states of that process. If you don't have a model, and you don't have enough data to develop a model, then you can't get there from here.


0

Nyquist says that you can send up to twice as many pulses (symbols) per second as the channel bandwidth $B$ with zero ISI, so you need $R_s \leq 2B$. That is all there is to it. The sinc pulse has zero excess bandwidth so the bandwidth of the signal is equal to the symbol rate, $B_s = R_s$. About sampling, Nyquist says that you need to sample at least twice ...


4

Their numbers work out right if you do the stated decimation before the stage, and you pay attention to the fact that decimations are cumulative. So stage one operates at 1/3 of the input rate, stage two operates at 1/6, stage three operates at 1/12, and stage four operates at 1/48. If you scale the adds and multiplies by those numbers, then their stated ...


1

For part 3, there is an old trick dating from the time where computing was expensive. If you have a smoothed version $I_\sigma$ of a picture $I$, you can get a crude yet simple approximation of a Laplacian from $I -I_\sigma$, illustrated here with the Gaussian: It is indeed generalized in many unsharp filters, with other weights, or in multirate/multiscale ...


0

It's part of a feedback loop -- presumably setting the sample rate in some real-time audio thingie, since I see keywords in the code like 'resample' and 'jack' and 'PLAY'. // Run loop filter and set resample ratio. So, this tells you what it does! Elsewhere in the code, err is computed as the timing error between the input stream and the output stream. So, ...


0

I would handle this as a chain of FIR filters with decimation to get much lower tap count FIR filters that don't need to be nearly as steep in the early stages. Maybe using Blackman-Harris windowed filters for the first two stages (for superior alias fold-in rejection). Then a Kaiser windowed filter for the 3 stage to get a flatter top and a sharper roll-off....


2

I believe I have actually found an answer myself after even more research ;) The crucial piece of information is the following: The filter function H(z) shown in many models is not the actual Noise Filter Function. Usually the noise filter should be some kind of high pass and I used this directly as H(z) erroneously. Instead, the noise is shaped by the noise ...


2

Typically this requires a trade off between CPU efficiency and latency. Frame based signal processing incurs at least one frame of latency and it you are planning to play live through the effect, you need to keep this quite low otherwise it get's distracting. On the other hand, frame-based processing is way more efficient than sample by sample processing, ...


0

This looks correct; obviously you need to simplify to obtain a transfer function with polynomials as numerator and denominator. Partial fraction expansion then leads to a form that can be directly transformed to the time domain. The only thing that might be wrong is the minus sign between the two exponentials.


4

Or another way, visually, with the plot of the magnitude response of your filter shown below you see that it goes to zero at $\pi/2$. So what you could do is use the relationship between the angular frequency $\omega$ in [radians/sample] and the relative frequency $f$ in [cycles/sample] $$ \omega = 2\pi f = 2\pi \left(\frac FF_s\right) $$ Then compute $F_s$ ...


3

The general approach would be to find the zeros of the filter's transfer function. If you do things right it will turn out that there are two complex conjugate zeros on the unit circle at $\pm j$, i.e., at half the Nyquist frequency. Now you need to choose the sampling frequency such that $80$ Hertz corresponds to half the Nyquist frequency.


2

A few suggestions: I would do all filter design with poles and zeros, NOT with filter coefficient Implement everything as second order sections, with one complex pole pair per section. The zeros of a Butterworth filter are constant: they are at $z = 1, z= -1$. You don't need to explicitly calculate the $b$ coefficients of your filter. It's always $b = [1, 2 ...


1

Thanks to @Marcus Muller answer and comments in my question, I managed to solve th problem. As he pointed out: filtfilt is not the function you need. I saw that a hundred times: People use filtfilt because it has a name that reads a bit like it's the filtering operation they want, but it's not. You just need plain convolution. After fixing these ...


1

I would build a tensor of those matrices and use low rank or some thresholding methods on it. You may have a look for Tensor SVD.


3

Couple of things: You really can't print to the console in a high-speed context, especially not in audio callback functions. That printing has side effects, and it's slower than you think, I promise. This alone breaks "real-timedness": You can never guarantee how fast your printing is (or isn't). Ahhhh! You're re-designing the filter for every ...


1

The numerator and denominator of the total system are respectively the convolution of the numerators and the denominators of the filters to be cascaded. $$ b(n)=b_1(n)*b_2(n) $$ $$ a(n)=a_1(n)*a_2(n) $$ You can validate it by the following code in MATLAB b = conv(b1, b2); a = conv(a1, a2); sys1 = dfilt.df2t(b1, a1); sys2 = dfilt.df2t(b2, a2); sys = cascade(...


2

The 1st mentioned tutorial https://medium.com/@jud.dagnall/dynamic-range-compression-for-audio-with-ffmpeg-and-compand-621fe2b1a892 is a great introduction and the filter documentation also adds a few examples. http://www.ffmpeg.org/ffmpeg-filters.html#toc-compand Its very dependent on situation if your set up for near field or far field but generally its ...


1

Giles' answer applies to tapped delay-line digital filters. A more general answer is: The DC gain of a digital system is the sum of the system's impulse response.


3

The DC gain is simply the sum of filter taps or coefficients. This is the value of the frequency response at DC (i.e. $0\ \rm Hz$), or equivalently $$ H(0) = \sum_{n = 0}^{N - 1}h[n]\tag{1} $$ Because, for a digital FIR filter of length $N$ with impulse response given by Equation $(2)$ $$ \big\{h[n]\big\}, \quad\text{with}\quad 0\le n\le N -1\tag{2} $$ the ...


3

There are many approximations for the Laplacian Filter (See The Hypermedia Image Processing Reference - Laplacian/Laplacian of Gaussian): Indeed this is an High Pass Filter. Namely it will remove low frequencies (Specifically it will remove the DC Value, namely the output image will have mean value of 0).


1

I sadly don't have the reputation to comment on Fat32's answer, but let me try to answer directly instead: the frequency response of a digital filter is always relative to the processing sampling rate. So if you design a filter with cutoff at 100Hz and 1kHz sampling rate, then you are really designing for a normalized cutoff frequency $f/f_s$ of 1/10 and ...


3

It's a bad translation of step response, i.e., the filter's response to a unit step $u[n]$ at the input. Note that the step response is the convolution of the unit step with the filter's impulse response: $$s[n]=\big(u\star h\big)[n]=\sum_{k=0}^nh[k],\qquad n\ge 0\tag{1}$$ where I've assumed causality, i.e., $h[n]=0$ for $n<0$. From the given step ...


2

Is there an analogous procedure I can do to correct arbitrary phase responses in my signals? Arbitrary all-pass design is tricky since there are some extra constraints to be taken into account. FIR filters cannot be "ideal" all pass filters, since all pass filters have poles and zeroes which inverse of each others. FIR filters have all the poles ...


5

You can equalize magnitude and phase simultaneously by defining a desired complex frequency response $$D(\omega)=M(\omega)e^{j\phi(\omega)}\tag{1}$$ with magnitude $M(\omega)$ and phase $\phi(\omega)$ chosen such that they compensate for the given magnitude and phase distortions. An FIR filter approximating $(1)$ can be designed by using the following error ...


1

As far as I know there are no known tight upper and lower bounds, but there's a quite accurate empirical formula for estimating the required filter order $M$ given maximum passband and stopband deviations $\delta_1$ and $\delta_2$, and the width of the transition band $\Delta\omega$: $$M=\frac{-10\log_{10}(\delta_1\delta_2)-13}{2.324\;\Delta\omega}\tag{1}$$ ...


1

In practice you would make sure that your filters don't have very large gains, at least not over a large frequency range. The filter you're using in the given example has a maximum gain of almost $26$ dB (at DC), and the gain is no less than $12$ dB for any frequency. I.e., you're applying a flat gain of $12$ dB, and on top of that you boost a relatively ...


1

The output process is clearly zero-mean because the LTI system cannot add a mean to the zero-mean input process. The variance of the filtered process is given by $$E\{Y^2\}=\frac{N_0}{2}\int_{-\infty}^{\infty}|h(t)|^2dt\tag{1}$$ which results in $3A^2N_0/2$.


1

$G_0(e^{j\omega})$ and $H_0(e^{j\omega})$ are ideal low pass filters with passband $[0,\pi/2]$ and stopband $[\pi/2,\pi]$. $G_1(e^{j\omega})$ and $H_1(e^{j\omega})$ are ideal high pass filters that are complementary to the lowpass filters, i.e., their passbands coincide with the lowpass filters' stopbands and vice versa. Note that shifting the frequency axis ...


1

This is what happens when a signal is downsampled: you get a scaling of the frequency axis and the addition of shifted spectra (aliasing). The same happens to the lowpass filtered signal. The spectrum of the downsampled signals is given by Eq. $(4.77)$ in Oppenheim and Schafer's Discrete-time Signal Processing (3rd ed), which for downsampling factor $M=2$ ...


Top 50 recent answers are included