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.

246 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
5k 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
55 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
575 views

Evaluate Fourier coefficients at arbitrary point using Python

Lets say I have a sinusoidal function $s$ that looks like ...
3
votes
0answers
8k 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
1answer
40 views

Change the melody of human speech using FFT and polynomial interpolation

I'm trying to do the following: Extract the melody of me asking a question (word "Hey?" recorded to wav) so I get a melody pattern that I can apply to any other recorded/synthesized speech (...
2
votes
0answers
52 views

Filtering a square signal with a median filtering to preserve the edges

If needed, you can find my first post for this problem here. I am trying to clean the following signal: As proposed in the comment, I tried to use this post proposing 2 methods: median filtering and ...
2
votes
0answers
39 views

Autocorrelation not as expected

I am trying to find the autocorrelation function on the intensity of a pixel over time stored in an array "Intensity". Usually one would expect the highest point to be at t = 0 and then decay. I am ...
2
votes
0answers
49 views

Friendliest python library for fixed point algorithm simulation

My primary programming language is python. Is anyone aware of solid python libraries to simulate fixed point algorithms in python? A quick google search revealed this: https://pypi.org/project/...
2
votes
2answers
88 views

what is the difference between the convolution and differentiation over image in image processing?

In image processing the differentiation and convolution are the terms that are used interchangeably. What is the difference between applying convolution and differentiation over the image? How we ...
2
votes
0answers
2k 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
160 views

Kalman Filter 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
232 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
587 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
557 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
208 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
691 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
274 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
1answer
1k views

Are there any signal processing libraries that implement TD-PSOLA?

For such a popular and old algorithm, I've had surprisingly little luck finding implementations. I've got it working in MATLAB, but am curious if any other languages have libraries containing it (...
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
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
786 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
92 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
120 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
644 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
670 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
864 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
883 views

Lowpass then Inverse filtering in python

I wrote a simple lowpass filter in python to run against lena. Now I'd like to add Gaussian noise to the lowpass filtered data and then run an inverse filter against the lowpass and try to get the ...
2
votes
0answers
542 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
24 views

ModuleNotFoundError: No module named 'custom_OFDM' with custom Python OOT Block

I am using gnuradio to develop custom OFDM blocks using Python. I have used gr_modtool to create my blocks and import them into gnuradio. When I try to run my flow graph using one of my blocks I get ...
1
vote
1answer
15 views

Calculating the peak power of a signal on python

As far as I've researched, the energy and power of a given (discrete) signal are given by $$E = \sum_n \left|x_n \right|^2$$ $$P = \lim_{N\rightarrow\infty}\frac{1}{2N+1}\sum_n \left|x_n \right|^2$$ ...
1
vote
0answers
48 views

Implementation of Cepstrum in Python

Actually I want to denoise a signal. I know how can I implement FFT in python to denoise it. This is the implementation which I use(From this Kaggle notebook): But I don't know : How can I use ...
1
vote
0answers
18 views

Is my implementation of Generlized Pencil-of-Function correct?

I have a time-series data that should be of the form $$ f(t) = \sum_nA_n(e^{\alpha_n t}+e^{-\alpha_n(T-t)});\;\alpha_n=\eta_n+i\omega_n;\;i=\sqrt{-1} $$ and I want to find parameters $A_n$, $\eta_n$, ...
1
vote
0answers
75 views

Is rotation of a Fourier transform the same thing as Fourier transform of a rotation?

I'm working on an image processing problem and wondering if DFT(rotation(image)) == rotation(DFT(image)) (1). My final goal is to apply rotations in the Fourier domain then do an inverse Fourier ...
1
vote
0answers
45 views

Signal processing

I am quite new to signal processing and I have got the signal in picture. I'm working with Python. The central part has some sort of periodicity and it is the one I want to retain, whereas I want to ...
1
vote
0answers
51 views

How to take the inverse FFT of Welch's power spectral density in Python?

I have calculated the power spectral density of a weakly-stationary signal using Welch's method (as implemented by scipy.signal.welch in Python), and am looking to take the inverse Fourier transform ...
1
vote
0answers
23 views

Difference between these two Continuous Wavelet Transforms?

I am porting Synchrosqueezing to Python, and came across an implementation difference on CWT between mine and PyWavelets' - details below. The idea is to merge this implementation to PyWavelets if ...
1
vote
0answers
60 views

SIS Particle Filter Python Implementation

Lets say I have some time series data which I generated like this: ...
1
vote
1answer
35 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
31 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
18 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
77 views

How to filter out noise in high frequency signal?

I am trying to filter this signal (download-zip): ...

1
2 3 4 5