New answers tagged

2

Fixed point processing is very difficult. Floating point is A LOT easier. The best algorithm and scaling approach depends a lot on your specific filter and the statistics of your signal. There is no "one size fits all" solution. Cascaded second order sections are almost always the way to go. Primarily they guarantee that your coefficients values are bounded ...


1

I did not read carefully through the whole question as I don't have time now, but have you tried some form of robust peak detection? See e.g., https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.find_peaks.html Then you can set parameters such as the minimum (and maximum) distance, the prominence, the minimal height. If you look for minima ...


0

Hinted by the answer from @chipaudette I made a Python implementation using the s-domain transfer function (https://en.wikipedia.org/wiki/A-weighting). # python 3.7 import scipy.signal as signal import math as math import matplotlib.pyplot as plt import array as arr # for discretization sr = 48000.0 # enter the zeros, poles and scaling as in s-domain ...


3

First of all, it's not correct to say "poles should (always) be inside the unit circle for an LTI system to be stable" ; unless it's implied that system is also causal. Otherwise, if the system is noncausal, then its poles should be outside of unit circle for the system being stable. For IIR systems that are described by LCCDEs causality must be externally ...


0

From the difference equation alone you cannot tell if a system is causal or not. For example, the difference equation $$y[n]=-a_1y[n-1]-a_2y[n-2]+b_0x[n]\tag{1}$$ can be used to describe three different systems. The first one is a causal system, as suggested by the form given in $(1)$. However, rewriting $(1)$ as $$y[n-2]=-\frac{a_1}{a_2}y[n-1]-\frac{1}{...


0

Substitute $m = n+K$, i.e., $n=m-K$. This gives $$y[m-K] = -a_1 y[m-K+1] - \ldots - a_{K-1} y[m-1] - a_K y[m] + b_0 x[m-K] + b_1 x[m-K-1] + \ldots+ b_L x[m-K-L].$$ Rearranging gives $$ y[m] = -\frac{a_{K-1}}{a_K} y[m-1] - \frac{a_{K-2}}{a_K} y[m-2]-\ldots-\frac{a_1}{a_K}y[m-K+1] - \frac{1}{a_K}y[m-K] + \frac{b_0}{a_K}x[m-K] + \ldots + \frac{b_L}{a_K}x[m-K-L]....


2

Much depends on what you want to deduce from your data. In general, if your sample rate is not uniform, your measurements should be accurately time stamped. The nearer to an average of 1/10 a second your sample intervals are the better. A typical hueristic used in Engineering is the 1/10 rule, so if your samples are within 1/100 of a second of 1/10 ...


1

There is no reasonable way to explicitly choose the number of taps before and after the peak. The reason is simple: the arbitrary magnitude response design results in a linear phase, and, consequently, the impulse response is symmetrical. If you specify a desired complex frequency response in terms of magnitude and phase, the location of the peak is an ...


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


2

Apart from the method operating on the cepstrum suggested in hotpaw2's answer, there is the obvious way of reflecting the zeros outside the unit circle into the unit circle by keeping their angle unchanged and inverting their magnitude. So each zero $z_0$ with $|z_0|>1$ needs to be replaced by $1/z_0^*$, where $*$ denotes complex conjugation. You also ...


3

I've seen Julius' MATLAB code and I know what it does. Essentially, given an LTI filter with impulse response, $h[n]$, and frequency response: $$\begin{align} H(e^{j \omega}) &\triangleq \Big| H(e^{j \omega}) \Big| \, e^{j \phi(\omega) } \\ &= \sum\limits_{n=-\infty}^{\infty} h[n] \, e^{-j \omega n} \end{align}$$ Then $\Big| H(e^{j \omega}) \Big| ...


1

mps, a matlab/octave script using Cepstral methods to estimate a minimum phase form for a spectrum is here: https://ccrma.stanford.edu/~jos/filters/Matlab_listing_mps_m_test.html#sec:tmps explanation on same (JOS) site: https://ccrma.stanford.edu/~jos/filters/Conversion_Minimum_Phase.html


Top 50 recent answers are included