New answers tagged

0

This works, but I'm not sure why! The initial conditions are the result of multiplying Z (I don't understand Z's purpose, and why lfiltic() didn't work at all) with the last couple of values from the previous result. Note those last two elements are in reverse order, which maybe says something. Bparam, Aparam = signal.iirfilter(2, 0.020, btype = 'lowpass',...


2

Filtering a data block usually results in more data than fits in the size of the block. If you throw away this added data, that will produce artifacts across blocks. For FIR filters, you need to pad each chunk or block with at least the length of the impulse response of your filter before filtering (>= N+M-1). Then use overlap-add or overlap-save (FFT ...


0

In order to filter a discrete-time signal with a linear and time-invariant (LTI) filter, you need to implement a difference equation: $$y[n]=-a_1y[n-1]-a_2y[n-2]-\ldots -a_Ny[n-N]+\\+b_0x[n]+b_1x[n-1]+\ldots+b_Nx[n-N]\tag{1}$$ where $x[n]$ is the input sequence, $y[n]$ is the output sequence, and $a_i$ and $b_i$ are the filter coefficients, which determine ...


0

What you need to do is find a digital filter $H(z)$ that behaves similar to the $H(s)$ of your Butterworth filter. That is, you need to read about IIR implementation. There are several methods described in signal processing books about this subject. I recommend you to check for example "Essentials of Digital Signal Processing" from Lathi and Green. Two of ...


0

You should use Cascaded Second-Order Sections with fraction saving. The code below assumes 16-bit words and that the coefficients are s1.14 format (sometimes called "Q14" format) and are integers scaled up by a factor of $2^{14}$, meaning that the original coefficients must have a magnitude less than 2. or $-2 < a_1 < +2$ because the s1.14 words must ...


4

Limited numerical precision. The higher the sample rate, the closer the poles move to the unit circle, the closer to the unit circle, the less stable the filter is. There are different implementation methods that are better than others: design as poles, and zeros and not as transfer function, use cascaded second order sections, use correct section ordering, ...


0

Are you sure you feed the input of the DAC correctly? It seems to be your problem as I don't see the noise on the DAC output. What's the expected data format for the DAC? I assumed it a signed integer? Have you tried connecting the DAC to a sine wave look-up table to make sure your DAC is properly interfaced first?


1

See the documentation at https://www.mathworks.com/help/signal/ref/lowpass.html and in particular the "Steepness" parameter: You didn't specify a steepness, so it is just using the default value of 0.85 which is a transition width of 15% of $(f_{nyquist}-f_{pass})$, or 15% of (10MHz-100KHz) = 1.485 MHz. You see this directly with the shape of your post-...


Top 50 recent answers are included