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.

262 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
6k 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
3k 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 ...
3
votes
0answers
62 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
677 views

Evaluate Fourier coefficients at arbitrary point using Python

Lets say I have a sinusoidal function $s$ that looks like ...
3
votes
0answers
9k 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
60 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
1answer
37 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$$ ...
2
votes
0answers
47 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
57 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
0answers
126 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 ...
2
votes
2answers
137 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
1answer
249 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
252 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
731 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
605 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
216 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
705 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
301 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
83 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
796 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
122 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
655 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
694 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
917 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
956 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
554 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
62 views

MUSIC algorithm for DOA with floating point input signals

I am writing a Direction of Arrival (DOA) estimator using the MUSIC algorithm in python and am having trouble getting the correct spectrogram output. Specifically, my resulting graph comes out aliased ...
1
vote
0answers
47 views

Plot Spectrogram and FFT plots from samples collected by Atheros AR9271

I'm entering the world of signal processing, and as one of my first projects I've decided to plot a spectrogram and FFT Plot. The samples comes from an Atheros AR9271. More details can be found here: ...
1
vote
1answer
30 views

Map time/scene differences between two similar videos

Goal: Given two videos that are episodes from series but in different format (one Bluray/one TV for example), map the time differences between the two (which scenes are not in one of the two) and be ...
1
vote
0answers
22 views

Red Color selection in Python and Skimage

I'm trying to load an image from the disk and then to extract just the red channel of it and display it in grayscale with grey colormap but I don't know what I'm doing wrong.. The image should be ...
1
vote
1answer
39 views

How to reprocess SDR data to be equal to that captured with a higher RBW

I have a data set that consists of max hold frequency vs intensity data from an SDR at a specific RBW. I want to reprocess the data as if I sampled it with the larger resolution bandwidth so I can ...
1
vote
0answers
15 views

What is the order of the output of HoughCircles in OpenCV, when having several circles on a frame?

So I am trying to use stereo vision to calculate the depth of several red balls. With the function HoughCircles, I get an output at one frame from one of the cameras like for example: ...
1
vote
0answers
85 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
2answers
57 views

My 3x3 Weighted Median Filter doesn't seem to be improving my image quality

In order to reduce noise in my training dataset,I attempted a WMF whose weights are shown in a 2-D array as follows(values finally get normalized by division by 15: ...
1
vote
0answers
21 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
140 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
26 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
2 3 4 5 6