As others said in the comments, this looks like numerical error. 3rd-order filters are not typically prone to this, but the higher your sampling frequency, the closer the poles move to +1: You might ...

To get a purely real output, your signal needs to be "DFT-even" symmetrical, which basically means it has one extra sample at the beginning. For instance: [0, 1, 2, 2, 1, 0] is "normal" even ...

Hey I've been meaning to write this program, too. :D The way you use the initial conditions is to just pass them from one stage to the next. Also lfilter returns (y, zf), not (zf, y). So it ...

By converting to np.int16, you're hitting integer overflow and wrapping the values around. I assume this is not intentional, since the output looks much more sane without it. int16 is limited to ...

I tried my best but I couldn't find a resource that would list the "good" overlap factors for common and less common windows. Here's a list of window functions and overlap factors that have constant ...

It's possible to calculate average power (proportional to RMS amplitude) with the rfft, but it's more complicated because the DC and Nyquist bins are not doubled in the full fft (and the Nyquist bin ...

It works for me: from scipy.io import loadmat from scipy.signal import butter, filtfilt from matplotlib.pyplot import plot signaldata = loadmat('signaldata.mat') input_signal = signaldata['...

1) Can I just casacade the filters : input signal -> processed through f1 -> ... -> processed through fn -> output signal ? Yep, that's how you do it. 2) Given that filters are not perfect, ...

I've been using NumPy/SciPy for everything. It doesn't have as many functions/features as Matlab, but the Python language is much nicer to work with, and it's free and open-source, so it's getting ...

The function is based on Matlab's deconv, so reading that page should help understand it. Here's a docstring I wrote for SciPy's deconvolve, but haven't submitted yet because I'm not sure it's 100% ...

how much error is typical and what is the relationship between the degree of error and the harmonic number I think that's hard to answer. Do you want to include contrived weird instruments with ...

I don't know exactly where the problem is, but the slice theorem means that these two special cases should be true: fft2(target) = fft(sinogram) fft2(target)[:,0] = fft(sinogram) So ...

This might be a slow terrible solution, but you could do a FFT-based cross-correlation of subsequent frames and then find the peak to identify the offset between frames. Maybe only do it on a small ...

Are there any kind of spectral characteristics (from an STFT) ... this is a single note not a chord, etc.) Well, for this, the STFT will only contain a fundamental frequency component and other ...

You're just seeing the amplitude of the individual samples, not the wave that travels between them. If you generate a high-frequency sine wave, you will see that the samples don't necessarily go ...

dBFS is a digital signal measurement, relative to full-scale. dBSPL is a sound pressure level measurement, relative to 20 μPa RMS air pressure. dB(A) is shorthand for "dBSPL A-weighted", which is the ...

So what you mean is that you want the continuous-time Hann window instead of the discrete-time window? $$w_{Hann}(t) = 1 - \cos \left(2\pi \frac{t}{T} \right)$$ is not correct, since it goes to 0 ...

signal.windows.cosine is a window function, not a signal, as it says in the docstring: Return a window with a simple cosine shape. You want something like numpy.cos(2*pi*f*t).

You need to keep the phase information, which isn't included in a spectrogram. "Spectrogram" is just the magnitude of the STFT output. So this is conceptually the same as STFT ↔ ISTFT, which is ...

Here are some animations I tried to make to demonstrate Fourier transforms and how phase and complex exponentials work:

Maybe a table of decibels vs multiplication factors will help: \begin{array} {|r|r|r|} \hline +12\ \textrm{dB} & 4× & \textrm{amplification}\\ \hline +6\ \textrm{dB} & 2× & \textrm{...

I've read that to increase frequency resolution of FFT results one should dicrease sampling rate and increase window size (number of samples). To increase frequency resolution, you increase the ...

As far as I understand, the sources generally have equations readily available for simple circuits, and rely mostly on theory of parallel and serial filters to derive larger circuits — is this correct?...

Isn't running this filter offline in python automatically assume that it's digital? butter() doesn't filter your signal, it just designs the filter. It can design an analog filter or a digital ...

Sounds like bandlimited synthesis. with the added ability to change the lowpass cutoff frequency of the signal dynamically. That makes it even more complicated. The simplest way to do this right ...

No, you don't just multiply by 2, you multiply by every integer. You can have a 2nd harmonic, a 3rd harmonic, 4th, etc. (Only multiplying by 2s would tell you the number of octaves, not the number ...

I'm curious whether there is any difference between this strategy and, say, setting the lowpass to something really high like 250Hz and sampling at 500Hz, then once digitized and doing analysis, ...

Ok, here's the simple method illustrated in Python: # Correlation is convolution with one input reversed corr = fftconvolve(img1, img2[::-1, ::-1]) # Get coordinates of peak in x, y pixels peak = ...