Questions tagged [python]

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 packages often used for SP computations.

211 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
10
votes
1answer
13k views

Discrete Wavelet Transform - Visualizing Relation between Decomposed Detail Coefficients and Signal

I'm trying to directly visualize the relation between discrete wavelet transform (DWT) detail coefficients and the original signal/its reconstruction. The goal is to show their relation in an ...
6
votes
1answer
1k views

Issues with the smoothing operator in coherence estimation using the complex Morlet (Gabor) wavelet

The goal I wish to compute the coherence estimate using the continuous wavelet transform (CWT) of a real-valued signal with the complex Morlet (a.k.a. Gabor) wavelet. I compute the cwt of the signal ...
5
votes
1answer
4k views

Demodulating FSK audio in Python

I am trying to write a Python script that can demodulate an FSK modulated audio file and return the data encoded in the audio. The data being transmitted is GPS NMEA strings which are embedded as the ...
4
votes
1answer
2k views

How can we know the geometry of a blob detected by OpenCV

I am performing blob analysis using connectedComponentsWithStats, which returns elementary statistics about the blobs (AABB and area). It is also possible to ...
3
votes
0answers
52 views

How to compare imaginary coherence values?

High, I am currently writing my Master's thesis on susceptibility for hypnosis. I am comparing EGG signals of lowly and highly susceptible individuals. The imaginary coherence is given by: $$ \...
3
votes
0answers
337 views

Evaluate Fourier coefficients at arbitrary point using Python

Lets say I have a sinusoidal function $s$ that looks like ...
3
votes
2answers
812 views

Determine if two signals are the same?

I'm pretty new to signal processing. My data is the $(x,y,z)$ acceleration of someone walking with a smartphone in his/her pocket. Goal Given two signals, determine if it's from the same person ...
3
votes
0answers
7k views

Downsampling and upsampling of a signal in Python

If I want to downsample a signal in Python, is it better to use method resample from SciPy Signal Processing module or method decimate from the same module? What is the difference between these two ...
3
votes
0answers
9k views

numpy.correlate and autocorrelation; audio signal

I want to calculate delay between an input and an output audio signal of my audio processing system. The input and output signals are available as signed 16 bit integers. To try out, I tried the ...
2
votes
0answers
350 views

Plotting a scalogram of a signal's Continuous Wavelet Transform (CWT) in python

So I've been learning about wavelets for a few weeks because I'd like to use them in a research project I'm working on and I've been trying to grasp the general ideas behind them.I've been struggling ...
2
votes
1answer
87 views

get poles and zeros of frequency response

I am working on a python based LTSPICE project. I would like to get poles and zeros of AC simulation data. Is there a way to get them under use of the magnitude and phase out of the frequency ...
2
votes
1answer
78 views

KalmanFilter EM estimation of covariances

The question might be very simple, but I get a strange result from Kalman Filter. Let us consider the simplest state-space model, the random walk plus noise: $$ y_{t} = x_{t} + \varepsilon_{t}\\ x_{t} ...
2
votes
1answer
185 views

Extract approximation and detail coefficients

I am a student and would like to know how to extract the approximation and detail coefficients (A5, D5, D4, D3, D2 and D1) after an applied DWT decomposition dB5 (Daubechies 5, level = 5)?
2
votes
0answers
357 views

Basics of Normalizing Cross-Correlation with a View to Comparing Signals

I'm trying to understand how cross-correlation is used determine the similarity of two signals. This tutorial offers a very clear explanation of the basics, but I still don't understand how to use ...
2
votes
0answers
444 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 ...
2
votes
0answers
190 views

Skewed rectified aerial images

I have a series of aerial images from which I would like to get disparity maps for every consequent pair. In order to do that I do a stereo rectification. The problem is that sometimes rectified ...
2
votes
0answers
634 views

Executing a command based on a Short-Time Fourier Transform Output

I am currently calculating a Short-Time Fourier Transform (STFT) in Python using scipy.signal.stft. I am producing the image of the STFT shown below in real-time, ...
2
votes
0answers
2k views

3D image segmentation

Re-written more specific question For the details of my segmentation algorithm, see the original question below. I have managed to improve the segmentation considerably by using a different strategy ...
2
votes
0answers
241 views

stones' detection in jewel image

The project I am doing is to detect stones in an image of a jewel, so as to get the idea of the deduction to be made in the gross weight of the jewel. I have done image-segmentation in the HSV color ...
2
votes
0answers
2k views

Windowed Sinc filter in python

I designed a 1st order Delta Sigma converter in PSpice, except for the decimation filter. I want to implement said decimation filter in Python, rather than in PSpice. Being new to both Python and ...
2
votes
0answers
82 views

Is there a way to extract the difference between the 2 signals? Fitting?

I'm very new to signal processing and have been struggling this far. I have a device that measures the signal due to the magnetization of iron particles. In order to calculate the response of the ...
2
votes
0answers
1k views

Blind deconvolution implementation, Python, Shalvi-Weinstein

I'd like a 1D blind deconvolution implementation in Python. I read Shalvi and Weinstein 1990 (on the recommendation of Yair Weiss) and it appears relatively simple. However I can't find an existing ...
2
votes
1answer
4k views

Calculate 1D Power Spectrum from 2D Images

Imagine satellite images, these are irregular sampled in X and Y direction and the shapes are of course are oddly off. We now want to estimate a 1D power spectrum from the whole image to estimate the ...
2
votes
0answers
1k views

Yule-Walker PSD Estimate of an AR Process

I am trying to implement a Yule-Walker PSD estimation in Python but my results are not up to the expectations. In MATLAB, I would normally implement my functionality as follows: ...
2
votes
0answers
758 views

How to remove a common noise signal from a set of signals?

I have 2D measurement results which seem to have a constant non-trivial background as shown here: For every column in this image, there seems to be a similar oscillation. I'd like to distinguish this ...
2
votes
0answers
91 views

Classify areas of an image based on color

I have some tree canopy images that I would like to process, but not sure how to get started as image processing is a little outside my area of expertise. Any help would be appreciated. I have tree ...
2
votes
0answers
113 views

How many different filters are needed for in an iterated filter bank?

I'm trying to implement an iterated filter bank as described in the Subband coding chapter of the Really Friendly Guide to Wavelets. However, the text seems to suggest that The advantage of this ...
2
votes
0answers
579 views

How do I interpolate between bins on an FFT in python?

I have four frequency peaks, which I have after applying FFT. Now I want to know precise values of these frequency peaks. there are different interpolation methods. How can I use this method of ...
2
votes
1answer
635 views

(python+opencv) haar cascade training using cloud computing

I will train my own cascade, using python and opencv. I want it to be as precise as possible, so as I read it is common that training takes one or two weeks to compile. I want to use cloud computing ...
2
votes
0answers
775 views

Extracting the phase of a jittering sine wave using python

The background: I conducted an experiment where I rotated an object (with three-fold symmetry) many times and recorded the projection of the object. I should be able to tomographically reconstruct ...
2
votes
0answers
2k views

How can I specify the scale parameter of the wavelet in PyWavelets (pywt)?

When computing wavelet transforms with PyWavelets (Discrete Wavelet Transform in Python), e.g. ...
2
votes
0answers
518 views

Shifting of Shift-Invariant Wavelet Transforms

Main Question: Why would iterative wavelet/inverse-wavelet transforms cause a shift along the x-axis for undecimated (shift-invariant) wavelet transforms? I am attempting to remove backgrounds from ...
2
votes
0answers
2k views

Ricean Multipath channel model implementation

I'm trying to implement a multipath ricean channel model. I had found several resources but I'm kind of lost with too much information. What I have from now is the following step: ...
2
votes
0answers
206 views

There are other shape properties scale-rotation invariant except HuMoment?

There are other shape properties scale-rotation invariant except HuMoment? There are example that show me how can i implement them? I find this example in c++ https://stackoverflow.com/questions/...
1
vote
0answers
34 views

How to spatially transform differently magnified images for spectral analysis?

I'm working with an imaging spectrometer that takes images with different filters that cause each image to have a different magnification, while the image size stays constant. I want to do spectral ...
1
vote
1answer
18 views

linear-expansion filter for image (2D array)

I am working in python analyzing 2D arrays and I am looking for a filter or some other routine that would provide a linear expansion of an region boundaries in a 2D array with binary regions (i.e. a ...
1
vote
0answers
27 views

How to create different Time frequency images from a data

I'm new to Python. I have a time series in a CSV file that has about 5000 rows and 3 columns. I have split the data into training and testing in ratio 70:30 respectively. However, I have a problem ...
1
vote
0answers
14 views

Looking for a way to fill holes in objects, and break bridges between them

I am trying to extract building footprints from satellite images. Using a series of morphological operations i.e erosion and opening by reconstruction, I'm able to obtain the footprints, albeit with a ...
1
vote
0answers
162 views

Problem using pitch shifting with TD-PSOLA and formant preservation

I tried out this implementation of TD-PSOLA (https://github.com/sannawag/TD-PSOLA) and even though I know how the algorithm works, I can't understand why I get NO audible differences in the output ...
1
vote
0answers
63 views

How to filter out noise in high frequency signal?

I am trying to filter this signal (download-zip): ...
1
vote
0answers
190 views

SNR computation in frequency domain with scipy.fftpack.fft

I have a noisy time series (gaussian coloured noise) to which I add a signal. I call the sum of noise+signal a segment. In the picture you can see an instance: I want to compute the signal-to-noise ...
1
vote
0answers
74 views

Sparse Bayesian Learning Algorithm in Python - MSE vs. SNR

I am implementing SBL in python. I have plotted a graph between MSE (mean squared error) and SNR (Signal to Noise ratio) The graph must be decreasing, but mine is decreasing till the SNR is negative. ...
1
vote
0answers
17 views

How to harvest the highest amount of information from an image?

I wrote a script that detects objects, crops the part of the image where an object is located and tries to increase the quality of cropped image. The object detection runs tensorflow. To increase ...
1
vote
4answers
156 views

Detecting a three-tone signal in real-time

I'm new to digital signal processing, and I've been looking into FFT, filtering, Matlab etc. What I'd like is to build a program which will detect when a certain BEEP is transmitted through a trunked ...
1
vote
1answer
634 views

Third octave bandpass filter with python

I am very new to signal processing and coding which is why my questions might be really basic. I have a signal of the acoustic pressure p'(t) and I would like to use a third octave bandpass filter in ...
1
vote
0answers
43 views

How to account for number of electrodes in EEG data while converting to frequency domain?

I have raw data from 64 electrode EEG in CSV format where there are multiple rows and 64 columns. I am using the following Python code to separate the data into frequency bands: ...
1
vote
0answers
144 views

Generate time domain signal from frequency domain filter

I am familiar with using the Fourier transform to take a signal from the time domain to the frequency domain. What I would like to do is the reverse: describe a signal in the frequency domain and then ...
1
vote
0answers
674 views

How to envelope a non periodic Impulse signal?

I want to analyse a trc oscilloscope file, find impulses and envelope them. In the end I want to plot the envelope. data file (trc): https://ufile.io/z4m4d Code: (Python) ...
1
vote
0answers
53 views

Frequency bins too powerful at the start and at the end of each sample computed DFT data

I've taken the following link http://coding-geek.com/how-shazam-works/#comments as a project to start practising and learning signal processing and python programming for me to get started in speech ...
1
vote
0answers
666 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 2 3 4 5