Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Python is a high-level interpreted general programming language. Python has popular numerical and scientific libraries/packages, most notably numpy and scipy. The scipy.signal package is a powerful signal processing software collection. This tag covers the use of numpy, scipy, and other Python ...

0
votes
0answers
19 views

Unexpected results from DTW comparing two MFCC feature vectors

I'm trying to compare two people's pronunciations of the same sentence: "no signal." I ran the following code on said pronunciations and the DTW distance output was 8.4. However, when I used one of ...
0
votes
0answers
20 views

How to use signal.lfilter?

I am processing EEG data(.tdsm) and i tried to implement the Ellipitic filter. But I can't manage to pass the signal through signal.lfilter, the end result doesnt seem correct because only the ...
0
votes
2answers
53 views

Shifting signal smaller than discrete step

I have a image that I need to shift with less than a pixel. My plan was to do a Fourier transform and multiply the signal with $e^{-aiu-biv}$ where $a, b$ are the shifts in x and y direction. This ...
0
votes
0answers
9 views

Readjusting the LSB encoded pixels in Edge Adaptive Steganography

I have two pixels generated using LSB encoding $(x_{i}^{'}, x_{i+1}^{'})$. However, there are chances that either one of them, or both, lie outside the range $[0, 255]$ or $|x_{i}^{'} - x_{i+1}^{'}| &...
-1
votes
0answers
38 views

IIR design with Yule-walker method (or equivalent) in Python

I would like to design an IIR from an impulse response (find optimal coefficients), and I want to do it with Python. With Matlab we can use the Yule-Walker method (yulewalk function in Matlab signal ...
0
votes
1answer
21 views

Resampling from variable to fixed-rate [on hold]

I have a sensor that reports its values with a variable rate. I save this information together with a ms timestamp. Later on I want to resample the variable rate to a fixed rate. Interpolation can be ...
1
vote
1answer
49 views

Sound Source Location

I have four microphones which I want to use to locate the direction of an audio source. Is there any Python module that implements an algorithm that, given the recordings of the four microphones, will ...
1
vote
2answers
58 views

Why is my DFT/FFT always 90° out of phase?

I'm doing an FFT using Python and Numpy on one machine, and C# on another. I'm using some dummy data that mimics how I'll eventually be gathering data from sensors in the C#/UWP application. The two ...
1
vote
1answer
52 views

Finding audio “tics” in stereo wav files using python

I have thousands of audio files that I want to "batch" process searching for audio tics. This is easily done using a DAW but that requires opening each file independently, searching for the tic (...
0
votes
0answers
5 views

what's gray level features and how to compute it with python

Hi I am a new one to computer vision. now I am trying to classify the image into good or bad based on image features. Now I want to use the features in the following paper: https://arxiv.org/pdf/1202....
1
vote
0answers
34 views

real refractive index from Kramers Kronig relation

I have a measurement of the complex part of the refractive index $k$ (where the refractive index is $m = n + i\,k$) measured at a nonlinear grid of wavelengths or frequencies that span several orders ...
1
vote
2answers
64 views

Simple way to determine square-ness of signal?

Not entirely sure if my term is correct. Feel free to edit title. I have a lot of time series, where the data quality is determined by how linear each sub-sequence is. It doesn't matter if it jumps ...
1
vote
1answer
129 views

How to remove ECG artifacts from EMG data?

I'm new to signal processing and try to analyze EMG data from pectoralis major and other respiratory muscles. Unfortunately, there are strong ECG artifacts in all recordings and I don't know how to ...
0
votes
0answers
32 views

How do I smooth a binary signal in Python?

I have a signal that is binary (a sequence of 1's and 0's). I want to be able to "smooth" the signal; that is, I want to transform the signal such that in regions where there are 0's, the signal will ...
0
votes
1answer
35 views

Time-domain LPF not showing expected behavior

I am trying to implement a simple first-order Butterworth Low-Pass filter in Python. I have some code that makes use of scipy.signal.butter and scipy.signal.filtfilt. It works fine, but I wanted to ...
0
votes
0answers
10 views

Cut two signals from a correlated signal

I have the following situation, I did ACF auto correlation between temperature and strain. I got a shifted signal in temperature and I already shifted it. Of course the shifted signal has shorter ...
2
votes
2answers
45 views

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

As far as I have read, an FFT requires that the number of original data points must be a power of 2. I'm wondering whether the tools like MATLAB or Python which have FFT functions take care of this ...
0
votes
1answer
294 views

Removing noisy lines from image - opencv - python

I want to process different type of image to extract actual text from noisy image .I am using open cv to do this job it is working fine but the problem is I need to set different lower threshold to ...
0
votes
0answers
11 views

How can I do operations only to the perticuler segment of image(non-rectangular, Ex: Triangular region) in opencv, python

I use opencv with python to implement the segmentation based on delaunay triangulation. So, I used the subdiv2d as for the triangle generation. What I want to do is,...
1
vote
1answer
44 views

zero padding shifting signal peak?

I am trying to find the fundamental frequency of a low-frequency signal. I need an estimate that is precise to .01 Hz based on only a few cycles, so I'm trying to code up a fft in Python. The signal ...
1
vote
1answer
36 views

Time signal FFT different for whole signal than half signal on high frequencies

I have a time signal of u from 0 to 1000 time units. If I chop the signal in two halves and compare the frequency spectrum of both it looks similar, as it should (...
0
votes
0answers
22 views

What are the best resources to learn feature extraction and classification of signal?

First of all, forgive me if I am posting anything wrong; I am new here. I need to learn signal processing like feature extraction and classification for my final year thesis. I asked some persons and ...
0
votes
0answers
33 views

Is there an equivalent to MATLABs zplane-function in python?

Does anyone know of a valid equivalent to Matlabs zplane function? In Matlab, it can be used to both create a pole-zero-plot and also to get the poles and zeros of a system described by its ...
0
votes
0answers
43 views

Remove a line in image with FFT

I would like to remove vertical line from an image (an example). I took a 2D FFT and try to apply a mask to suppress the line. Nonethelesse the approch is not very efficient, because i lose an ...
1
vote
1answer
42 views

Reconstruction of a signal from non-uniform samples [duplicate]

So I'm having some troubles with a signal that's been sampled but where the samples don't have consistent intervals. I've been looking into the NFFT (in python) as a starting point but I'm a complete ...
0
votes
1answer
49 views

Is there a way to obtain the transfer function from a bode plot on Python? (I know that it is possible on Matlab)

Quite simply, I have a bode plot obtained from a source signal. Now I wish to obtain the transfer function. I know it is possible with Matlab: http://www.mathworks.com/help/ident/examples/frequency-...
1
vote
2answers
51 views

wrong output using numpy fft on a tone

I am getting the wrong output with the following simple implementation of Python fft. Can someone please explain what I need to fix? ...
3
votes
1answer
90 views

Finding a signal inside another signal

I have a 1D array of 32 bit floating point numbers representing the current draw of a radio operating over a 40 minute span. The number of elements in the array is 29 million and change. There is a ...
0
votes
1answer
43 views

signal reconstruction [closed]

I'm new to DSP so the question might seem a little bit stupid: When using a low pass filter (say Butterworth filter) with Python, I came across an algorithm with which I can reconstruct my signal ...
0
votes
2answers
21 views

Window length in matplotlib's specgram

In the paper about speaker verification I can read that Two quantities have to be set: the length of the window and the shift between two consecutive windows. For the length of the window, two ...
1
vote
1answer
28 views

Reproducing paper results about a wavelet transformation using python [closed]

I have been reading this PhD theis about wavelets and I am trying to reproduce some of the results but I don't know the specific code to use to generate similar results. The original time series ...
0
votes
1answer
77 views

Computing the Power Spectrum Density (PSD) on a CSV File in Python

im quit new with signal processing and im trying to calculate the PSD of a signal im sampling. the signal is an output of a DC buck converter this is the code im using and this is the plot im getting ...
2
votes
1answer
85 views

How to Calculate the Ambiguity Function

(Maybe this should be on Stackoverflow instead ...) What is the best way to calculate the ambiguity function? There are different implementations out there for Python (like PyTFTB or from ...
0
votes
0answers
21 views

Understanding this continuous haar wavelet implementation

This is the implementation I am referring to, found here: ...
1
vote
0answers
13 views

graph display problem [closed]

I have a problem with the end of my code. I would like to display the last two curves, the problem is that at the beginning the size of YY is 288 and then after the equality with diff, my size goes to ...
0
votes
1answer
40 views

How to find the probability of Kalman filter states? [OpenCV+Python]

I am working on a video object tracking problem. I am using Kalman filter to predict and correct the object position return by an algorithm such as CamShift. I want to adjust the likelihood ...
0
votes
2answers
196 views

Spectrogram from scipy.signal with Python

To test the python spectrogram (from scipy.signal) , I've created a signal with 2 harmonics: 2 Hz and 8 Hz. Then I've added 50Hz noise and a trend (https://i.imgur.com/t1SnQck.png). I wanted to ...
0
votes
1answer
31 views

Detect gradual increase then decrease in slightly noisy data

I have data thats not too noisy and I am trying to detect a pattern where it gradually increases then decreases in a short period of time (20 ticks? it should be roughly similar per session but can ...
0
votes
1answer
152 views

How to measure acoustic pressure level under water with a hydrophone?

this is my first post here and I am also new in signal processing. Let's say I have a hydrophone with amplifier which is connected to a sound card plugged in to a computer. I gather the sounds to a ...
0
votes
0answers
18 views

What is the size of Kernel I should Keep when using Sobel filters for finding Vertical Gradient of Image?

I've trying to find the vertical gradient of OCT images of retina and extracting top 3% of images to create an image containing my point of interest ...
0
votes
1answer
58 views

Is this jumbled image due to difference between Matlab and Python slicing?

When I import an image from Matlab I get the following jumbled image rather than the (224x224x3 RGB) image of a single elephant I expected I write the image from Matlab as a binary file ...
1
vote
1answer
84 views

How to filter out those outliers

I'm struggling to filter some data from an accelerometer. I need to do it in python (and not just on the device collecting the data) to fix the data I have, so that I can build some classification ...
0
votes
1answer
46 views

How do I apply a binary mask and STFT to produce an audio file?

So here's the idea: you can generate a spectrogram from an audio file using shorttime Fourier transform (stft). Then some people have generated something called a "binary mask" to generate different ...
-1
votes
1answer
64 views

Spectral Subtraction python implementation error

I am trying to implement Spectral subtraction in python. I am new to DSP. I used this article as reference and below code is what I can come up with. Of course I did not get the expected output. I ...
0
votes
0answers
21 views

Backgroun noise in voltage vs time graph

I am analyzing a voltage vs time graph and I am coming across sinusoidal background noise in the cathode. I was wondering what the best method of getting rid of this noise would be on python. So far I ...
0
votes
0answers
34 views

How to add overlapping frames after processing a signal

I have to perform spectral subtraction on a signal in python. I have followed the steps specified in this link http://practicalcryptography.com/miscellaneous/machine-learning/tutorial-spectral-...
1
vote
1answer
102 views

Amplitude of frequency bin in FFT doesn't match time-domain amplitude

I have a sinusoidal current that I am sampling at about 357k SPS. The current signal is about 3A pk-pk @ 750hz (top figure). I am wondering why when I take the fft using numpy/scipy's fft function, ...
0
votes
0answers
105 views

Python toolboxes for state-space estimation via subspace estimation

Is there (open-source) toolboxes for state-space estimation via subspace estimation in Python? I know this is used in Matlab's n4sid function, but I didn't found any Python's implementation (even in ...
0
votes
1answer
104 views

Bandpass butterworth filter in python is not working

I've implemented this bandpass filter in matlab for the audio signals and it's working as expected. Now, I tried to implement the same thing in Python but it doesn't produced expected results, it just ...
0
votes
1answer
32 views

Extract jump location in data

I would like to extract the location of data jump (see figure below), the difficulty is that the data are noisy as you can see. I try with a median filter or a other regularization and it could move ...