endolith
  • Member for 10 years, 5 months
  • Last seen this week
How do I implement cross-correlation to prove two audio files are similar?
67 votes

Cross-correlation and convolution are closely related. In short, to do convolution with FFTs, you zero-pad the input signals a and b (add zeros to the end of each. The zero padding should fill the ...

View answer
Common Filter Types for Audio Applications
Accepted answer
4 votes

a lowpass with variable cutoff frequency and resonance. RBJ has a cookbook on how to do this: https://www.w3.org/TR/audio-eq-cookbook/ Here the cutoff frequency is called w0, and the resonance is ...

View answer
Fourier series representation
6 votes

However what is conceptually wrong with using say an infinite sum of time shifted rect functions to represent it? There is nothing conceptually wrong with it. Fourier transforms decompose a signal ...

View answer
scipy.signal.spectrogram() - how to handle gaps in the timeseries data
1 votes

Well it's not just the gaps; your data is also non-uniformly sampled. Use index_col to use the time column as the index to your dataframe: df = pd.read_table('BD-10d4669.p.1', sep=' ...

View answer
scipy cross-correlation: interpretation
Accepted answer
1 votes

No, the output is len(x)*2-1 long, an odd number I don't understand the question The x axis is the delay in samples, and the y axis is the cross-correlation. The number of x samples is odd, and the ...

View answer
Getting error while performing upsampling of an audio signal processing using low pass filter in python
0 votes

Well the first problem is that nyq = fs/2, not 2*fs.

View answer
periodic noise detection in image's frequency domain
Accepted answer
1 votes

You should start with a simpler one-dimensional case first and then work your way up to two dimensions. If you slice one row of your graph paper: from matplotlib import image import matplotlib.pyplot ...

View answer
T1 Mapping in Python?
Accepted answer
0 votes

You are fitting a polynomial to a logarithmic decay curve, which is probably wrong. You probably want to fit a log curve to a log curve. You can use the naïve method of np.polyfit(log(x), y, 1) ...

View answer
(Radiation) Pulse detection and height characterization when pulses are stacked
3 votes

Can you use deconvolution to convert these decaying impulses back into impulses? Proof of concept: import numpy as np from scipy import signal import matplotlib.pyplot as plt impulses = np.zeros(150) ...

View answer
Memory efficient filtering with scipy.signal in Python
Accepted answer
0 votes

The way to do this is to break the signal up into chunks and process each one at a time. I asked in a comment if you could accept one-dimensional filtering, but I guess you can do bidirectional ...

View answer
Where do harmonics come from?
1 votes

Below, the result of a simulation where I have the sum of two sine-waves with frequencies 100 Hz and 201 Hz, respectively: $$ x(t) = > \sin(2 \pi 100 t) + \sin(2 \pi 201 t) $$ The signal is ...

View answer
How to implement an RF Mixer for chirp signal in python?
1 votes

Wouldn't mixing them give you a sum and difference frequency and you have to lowpass filter to get the difference frequency only? Also your chirps are the same frequency, just out of phase? So the ...

View answer
How to apply an anti-aliasing filter before downsampling
0 votes

If you're using scipy.signal and processing signals offline, then you can just use decimate which handles the filtering for you. It also does zero-phase filtering by default, which you probably want ...

View answer
Why use both a high pass and a low pass filter in a Butterworth implementation for noise reduction?
0 votes

You probably meant to reverse them: The LPF should be at 1100 Hz, and the HPF should be at 100 Hz. Then you're keeping everything between 100 Hz and 1100 Hz, and throwing away lower and higher ...

View answer
How to compute dBFS?
4 votes

All the standards define dBFS as an RMS measurement, relative to the RMS level of a full-scale sine wave, so the calculation is: value_dBFS = 20*log10(rms(signal) * sqrt(2)) = 20*log10(rms(signal)) + ...

View answer
Scipy fourier transform zero frequency spike (from DC offset) - de-meaning and hanning window have no effect
1 votes

It doesn't happen with a random signal. Your signal must have low frequency content around 0 Hz that shows up even after you've nulled out 0 Hz itself? import numpy as np from scipy import signal ...

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
Are IIR filters (and specifically Butterworth filter) causal?
Accepted answer
8 votes

Yes, Butterworth are IIR. The decay from an impulse technically lasts forever. Yes, all [implementable] IIR are causal. Yes, because of #1 and #2. Don't use signal.filtfilt. Use signal.lfilter. ...

View answer
Hilbert transform with scipy.signal
Accepted answer
1 votes

It looks like it's working fine, but your signal contains some content at DC and the Nyquist frequency. DC doesn't survive through the transform, and Nyquist gets altered. If you bandlimit it first, ...

View answer
Wav file scale factor
0 votes

WAV files in 32-bit WAVE_FORMAT_IEEE_FLOAT can handle any arbitrary value in the range $±3.4×10^{38}$. I created a tone in Ocenaudio and amplified it to 15.5, saved it and re-opened it, and it works ...

View answer
Why is the number of frequencies decomposed in scipy.signal.stft() equal to the hop size?
Accepted answer
1 votes

The number of frequencies 'measured' in the Fourier transform of each time frame is exactly equal to the hop size, The number of frequencies is not determined by the hop size, it's determined by the ...

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
Tetrahedral microphone array beamforming
0 votes

What are the equations for determining the delays between the channels per beam? It's pretty basic trigonometry: If A and B are microphones, and C is the object you're trying to record, then C's ...

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
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
filtfilt giving unexpected results
8 votes

So the issue is that your filter order is too high. There are 2 problems with this: SciPy has a bug that generates inaccurate filters at high orders. On any platform, higher-order filters cannot be ...

View answer
How do MATLAB and/or Python treat $2^n$ samples rule in FFT
1 votes

Python doesn't have an FFT, but it's provided by external libraries like NumPy, SciPy, pyFFTW, etc. None of these three libraries care what size the input is. It can process lengths that are power ...

View answer
If humans can only hear up to 20 kHz frequency sound, why is music audio sampled at 44.1 kHz?
Accepted answer
95 votes

The sampling rate of a real signal needs to be greater than twice the signal bandwidth. Audio practically starts at 0 Hz, so the highest frequency present in audio recorded at 44.1 kHz is 22.05 kHz (...

View answer
1
2 3 4 5