signal-processing

Register SIGTEM handler only for parent process

Register SIGTEM handler only for parent process Question: I have the following program(this is replicated version of a complex program, but pretty much covers my problem statement). A SIGTERM handler is registered before spanning the new process. I am unable to find a way to restraint the child process from inheriting this handler. I want …

Total answers: 2

Python SIGINT not terminating calling shell

Python SIGINT not terminating calling shell Question: When running Python from a Linux shell (same behavior observed in both bash and ksh), and generating a SIGINT with a Ctl-C keypress, I have discovered behavior that I am unable to understand, and which has frustrated me considerably. When I press Ctl-C, the Python process appropriately terminates, …

Total answers: 3

Python equivalent of Matlab's resample()

Python equivalent of Matlab's resample() Question: Is there a python function that achieves resampling in the way MATLAB’s resample() does? I’ve looked into scikits.samplerate’s resample function but I’m not quite getting similar results. Asked By: Anand PA || Source Answers: There’s a blog ‘Audio Resampling in Python‘ about this. Both resampy and scipy.signal have a …

Total answers: 2

Get lag with cross-correlation?

Get lag with cross-correlation? Question: Let’s say have have two signals: import numpy dt = 0.001 t_steps = np.arange(0, 1, dt) a_sig = np.sin(2*np.pi*t_steps*4+5) b_sig = np.sin(2*np.pi*t_steps*4) I want to shift the first signal to match the second signal. I know this can be completed using cross-correlation, as evidenced by Matlab, but how do I …

Total answers: 3

How to get high and low envelope of a signal

How to get high and low envelope of a signal Question: I have quite a noisy data, and I am trying to work out a high and low envelope to the signal. It is kind of like this example in MATLAB in "Extracting Peak Envelope". Is there a similar function in Python that can do …

Total answers: 6

How to obtain sound envelope using python

How to obtain sound envelope using python Question: Hello I new with python and also with sound signal analysis. I am trying to get the envelope of a birth song (zebra finch). It has a very rapid signal fluctuations and I tried with different approach. For instance I tried to plot the signal and get …

Total answers: 2

Creating lowpass filter in SciPy – understanding methods and units

Creating lowpass filter in SciPy – understanding methods and units Question: I am trying to filter a noisy heart rate signal with python. Because heart rates should never be above about 220 beats per minute, I want to filter out all noise above 220 bpm. I converted 220/minute into 3.66666666 Hertz and then converted that …

Total answers: 1

Plotting power spectrum in python

Plotting power spectrum in python Question: I have an array with 301 values, which were gathered from a movie clip with 301 frames. This means 1 value from 1 frame. The movie clip is running at 30 fps, so is in fact 10 sec long Now I would like to get the power spectrum of …

Total answers: 5

calculate turning points / pivot points in trajectory (path)

calculate turning points / pivot points in trajectory (path) Question: I’m trying to come up with an algorithm that will determine turning points in a trajectory of x/y coordinates. The following figures illustrates what I mean: green indicates the starting point and red the final point of the trajectory (the entire trajectory consists of ~ …

Total answers: 5

Estimate Autocorrelation using Python

Estimate Autocorrelation using Python Question: I would like to perform Autocorrelation on the signal shown below. The time between two consecutive points is 2.5ms (or a repetition rate of 400Hz). This is the equation for estimating autoacrrelation that I would like to use (Taken from http://en.wikipedia.org/wiki/Autocorrelation, section Estimation): What is the simplest method of finding …

Total answers: 5