endolith
  • Member for 10 years, 5 months
  • Last seen this week
Why does a higher sampling frequency mess up my bandpass filter?
Accepted answer
3 votes

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

View answer
Why FFT of a rectangular pulse has imaginary part while the sinc function is real?
3 votes

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

View answer
Signal filtering using Python
3 votes

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

View answer
Python different autocorrelation with FFT and non-FFT
Accepted answer
3 votes

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

View answer
Choosing the right overlap for a window function
3 votes

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

View answer
Parseval's theorem - Average Power
3 votes

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

View answer
Differences between Python and MATLAB filtfilt function
Accepted answer
3 votes

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

View answer
Making an EQ from cascading filters
Accepted answer
3 votes

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

View answer
similar tools for MATLAB ?
3 votes

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

View answer
Deconvolution in Python
3 votes

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

View answer
Harmonic errors in acoustic instruments
Accepted answer
3 votes

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

View answer
What's wrong with this code for tomographic reconstruction by the Fourier method?
3 votes

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

View answer
Fast approximate optical flow / image shift
3 votes

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

View answer
Inverse polyphonic chord recognition
3 votes

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

View answer
Sine Wave "Lobes" (Basics, and probably a dumb question)
2 votes

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

View answer
How convert Given DBFS into DB in iOS?
2 votes

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

View answer
Can the Hanning Window be represented in the time domain
Accepted answer
2 votes

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

View answer
Displaying Cosine Signal in Python
Accepted answer
2 votes

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

View answer
How to go from wav file to spectrogram back to wav file in python?
Accepted answer
2 votes

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

View answer
DSP Concepts Visually Explained
2 votes

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

View answer
Is it accurate to say in digital audio that, when a fader is down, then its value is "-$\infty$"?
2 votes

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

View answer
Decreasing Sample Rate in DFT (FFT) for Audio Analysis
2 votes

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

View answer
Going from digital to analog filters
2 votes

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

View answer
Python butter filter: choosing between analog and digital filter types
Accepted answer
2 votes

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

View answer
How to simplify the Fourier Series Using an Approximation?
Accepted answer
2 votes

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

View answer
Calculate Max Number Of Harmonics for given Sample Rate?
Accepted answer
2 votes

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

View answer
Low analog lowpass + ADC vs High analog lowpass + ADC + low digital lowpass
Accepted answer
2 votes

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

View answer
Matching masked images
Accepted answer
2 votes

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

View answer
BandPass Signal Vs PassBand Signal
2 votes

what is the difference between Bandpass Signal and a Passband Signal ? There are several kinds of filters, with names that describe their function: Low-pass High-pass Band-pass Band-stop All-pass ......

View answer
Cut off frequency for low pass filter
2 votes

The butter command expects a normalized frequency from 0 to 1, where 1 is the Nyquist frequency. In other words, Wn is in half-cycles per sample. So you just divide your desired frequency (1 cycle / ...

View answer