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.
1,373 questions
0
votes
2
answers
50
views
Why does the inverse Fourier transform return complex data?
My understanding is super basic, but as I understand it, the FFT takes in data in the time domain (amplitude over time) and returns complex data in the frequency domain (magnitude over frequency).
...
1
vote
0
answers
36
views
Confusion about energy preservation during griffin lim phase estimation
Currently I am trying to use griffin lim algorithm to generate waveform data from magnitude spectrogram input. In general everything works fine. However, I do not fully understand the effect of ...
1
vote
1
answer
91
views
Is it feasible to recover musical structure from EEG imagination data?
I am new to DSP, and I am currently working on a project whose full details I cannot disclose yet. Broadly speaking, the goal is to study the relationship between EEG signals and musical structure ...
3
votes
1
answer
100
views
Interpreting EEG spectrogram artifacts: Constant horizontal bands and periodic vertical lines after filtering
I am analyzing EEG data (CHB-MIT Scalp EEG) and generating spectrograms to visualize seizure transitions. I am trying to understand specific artifacts visible in my output to ensure my preprocessing ...
0
votes
1
answer
56
views
Why does Python skimage.transform.resize give different results from MATLAB imresize for the same array?
I'm trying to replicate MATLAB's imresize behavior in Python using skimage.transform.resize. Here's my test case:
Python
...
0
votes
0
answers
89
views
Deadlock issues with simultaneous USRP RX / TX using UHD Python API
I'm trying to set up simultaneous RX and TX using the two front-ends on a USRP B210 using the UHD Python API. This resource recommends using separate threads for RX and TX, and this one says that UHD ...
0
votes
0
answers
34
views
How do I generate proper QAM-M modulated passband and save it as WAV file?
I'm new to digital signal processing and would like to know how to make a QAM-M modem that generates proper passband signal and saves it as a WAV file.
The tool should allow me to specify the carrier ...
1
vote
0
answers
159
views
Why use Butterworth filter after MediaPipe smoothing (One-Euro) for pose landmarks?
I'm working on human pose estimation using MediaPipe (Pose or Face Mesh), which applies a LandmarkSmoothing filter (One-Euro style) to stabilize landmarks in real-time.
However, for offline post-...
0
votes
1
answer
247
views
How to detect repeating patterns in short audio clips (≈4 seconds) using Python and machine learning?
I’m working on a machine learning project where I need to classify very short audio clips (about 4 seconds each) into two categories:
repeating song: clips that contain a repeating musical pattern.
...
0
votes
0
answers
71
views
Help with Python assignment on signal processing
I'll try and detail as much as possible, please ask me if any info is missing in your opinions.
in this assigment i created the basic rect signal a[n] such that over the domain [-1000,1000] it's 1 ...
0
votes
0
answers
71
views
Classifying audio signals in real time using python
apologies for what is maybe a silly newbie question, but my problem is I have a real-time feed of audio tones from a detector, and I want to classify them into maybe 3 or 4 buckets, eg not interested, ...
3
votes
2
answers
234
views
Why FFT input has to be centered at x[0] from a algorithmic/mathematical point of view?
I am a beginner in FFT and, however, for my project, I have to process the autocovariance function and turn it into a spectral density. I am using Python for the calculations. If I center the ...
2
votes
1
answer
117
views
Help with Implementation of Extended Target Tracking via EKF and inverse-Wishart updates
I am trying to implement the research paper linked here: Converted Measurements Random Matrix Approach
to Extended Target Tracking Using X-band Marine
Radar Data
I’ve managed to code the prediction ...
0
votes
0
answers
28
views
No Doppler effect difference (5 Hz vs 50 Hz) on short-duration wideband fading?
I'm trying to apply Rayleigh fading (Jakes' model) to a wideband signal consisting of multiple subbands. The overall signal has a bandwidth of 250MHz, sampled at 500 MHz with a total signal length of ...
0
votes
0
answers
76
views
Is my Autocorrelation Function up to Par?
I am using python to play around with my own implementation of the ACF. I am aware of how the autocorrelation function can have quantization error due to integer values of lag being used to calculate ...
0
votes
2
answers
121
views
Getting the impulse response of a linear system given white gaussian noise as input and the system's output
I am having trouble with my implementation:
...
1
vote
0
answers
93
views
Resonance analysis of a driven harmonic oscillator: phase and amplitude extraction not working as expected
Some introductory remarks
I'm playing with a real-world harmonic oscillator (a torsion pendulum) of the form
$$
M\ddot x(t) + M\Gamma\dot x(t) + \frac{K}{M}x(t) = F_{\mathrm d}\cos(\omega_{\mathrm d}t)...
1
vote
0
answers
72
views
How to compute the power spectral density of a vector-valued process without mirroring the autocorrelation function?
I'm simulating a 2D Ornstein-Uhlenbeck process (Langevin equation for velocity), and I'm interested in computing the power spectral density (PSD) of the vector-valued velocity process.
Following the ...
0
votes
0
answers
55
views
Why does the reconstruction signal repeat and has artifacts near the switching points? [python assignment]
I have the discrete window signal $a\left[n\right]=\begin{cases}1 & \left|n\right|<100\\0 & 100\leq\left|n\right|\leq1000\end{cases}$ with the respective Fourier coefficients $a_k=\frac{\...
1
vote
0
answers
74
views
How to detect this zebra-like pattern without using any machine learning?
I'm trying to solve a computer vision problem where I need to determine whether a black-and-white image exhibits a certain "zebra-like" vertical striping pattern.
What I mean by "zebra-...
0
votes
0
answers
149
views
Need help to process the raw IQ file
I have a raw IQ file capture with rtl_sdr -f 1090000000 -s 2000000. I want to get the ADS-B message from it. I understand the basic of I and Q value, I normalize it ...
0
votes
1
answer
109
views
One frequency is absent from fourier transform representation of the addition of two cosine wave of same amplitude and phase
I have wrote a general python code in Sage-math to find out the Fourier transform of the addition of two different frequency cosine wave in order to plot the frequency domain in a graph. The function:
...
4
votes
5
answers
2k
views
Destripe satellite image using FFT in python
I am currently in the midst of processing a satellite image, and I've come to a point where I need to remove those faint stripes caused by the sensor, as you can see below:
The image is RGB. I ...
0
votes
1
answer
122
views
What's causing this weird jump in these phase graphs of Fourier coefficients?
from an assignment in signal processing in Python. It's all done in Python (through Google Colab) with the libraries cmath, numpy, and matplotlib alone.
Signal a is a window signal where $a\left[n\...
0
votes
1
answer
74
views
Digital signal filtering methods with different frequency responses for positive and negative changes
I'm looking for a simple digital FIR signal filtering method that is quicker to respond to increases in the signal, but slower to react to decreases in the signal. I've used scipy for several signal ...
0
votes
0
answers
58
views
why am i getting the exact opposite of what my calculations show me?
from an assigment in python about mostly the connection between a signal and its Fourier coefficients, im asked to plot the wave that stems from $b_{k=10}$ in my case it's suposed to be $b_{10}\cdot e^...
0
votes
0
answers
46
views
help with python HW about Fourier coefficients - shifting is being calculated wrongly?
can someone help me understand what I'm doing wrong here? (using python only with cmath, numpy and matplotlib)
I received a simple "window" signal (called a[n]) which I transformed into the ...
0
votes
2
answers
118
views
Poor Gabor kernel performance, need suggestions
I am doing a very basic Gabor orientation prediction for images. It works perfectly on downsampled image samples. Part of the problem might be because in the actual testing image, I can have negative ...
2
votes
1
answer
212
views
Discrete FFT Results: How to re-bin output?
I have the output of numpy.fft.fft, calculated with 15000 samples at a rate of 500Hz - giving me bins of size $\frac{1}{30}$. Rather than having 15000 samples, I'd rather have say, 50 or 100. I've ...
1
vote
1
answer
93
views
determine output of LTI system in python
i have easily implemented sinusoidal response of lti system using matlab, here is my code :
...
1
vote
1
answer
129
views
Downsampling PPG signal peaks with Python
I have a PPG data series and I have extracted the R-R peaks with 100Hz frequency. Here is a synthetic signal and the estimate the peaks using Neurokit:
...
2
votes
0
answers
76
views
Counting Aedes Mosquito Eggs Using Image Processing or Neural Networks – Seeking Advice
I have a degree in Computer Science.
Project Overview
My main challenge is counting small black dots, which are Aedes mosquito eggs. These eggs are deposited on an Aucatex panel, a material placed in ...
0
votes
1
answer
143
views
How to remove noise from obtained graph on pc?
I have obtained a graph from a pressure sensor connected to an oscilloscope.
As you can see, there is a lot of noise. I want to remove the noise from this obtained graph to clearly see the peak that I ...
0
votes
0
answers
168
views
Using STFT to extract a list of frequencies from a wav file that can be used for AM radio transmission
My goal is to end up with a text file of analogue frequency values that can then be used to playback the song. The frequency values can be used with a physical oscillator to transmit them over AM ...
2
votes
1
answer
841
views
Raspberry Pi Pico(RP2040 or RP2350) ASM PIO microPython for FFT, DSP
I am curious to how others would approach leveraging the Raspberry Pi Picos(RP2040&RP2350) PIO state machine(ASM) to generate, analyze, process and transmit audio signals. A few basic ideas I ...
0
votes
0
answers
90
views
Hann window for data whose maximum is not at the centre of the vector
I have an interferogram that has a sort of Gaussian "pulse" envelope. The centre of the pulse (or the max point) is not necessarily the centre of my vector.
I want to window the time domain ...
0
votes
1
answer
88
views
Morphological Transformations
I'm supposed to use morphological transformations to do this but couldn't come to any solution, any ideas other than brute forcing (python)?
2
votes
0
answers
64
views
Subtracting background noise and "averaging" of multiple propeller noise measurements
I am currently investigating propeller noise at relatively stable RPM as part of my research internship. The target RPM is maintained within a band of ±25 RPM, with fluctuations during the ...
2
votes
2
answers
67
views
Associativity of valid mode convolution
I have three vectors, the first one is $x$ which is of relatively long length, and two kernels $k_1$ and $k_2$ with $\text{len}(k_1) < \text{len}(k_2)$. If I perform full mode convolution (like in ...
4
votes
0
answers
253
views
How to decimate an irregularly spaced signal with heteroscedastic noise and missing data and infer confidence intervals after decimation (fast)
Summary
The question is how a signal can be decimated by a non-integer decimation factor when
it is sampled at irregularly spaced x-points
its local noise variance is a function of the x-coordinate (=...
0
votes
2
answers
131
views
Every other entry of FFT comes back negative of what I expect when doing the math by hand
I'm working with an example signal x = [4, 3, 5, 10, 5, 3]. In fftshift land, this is an even signal, because the indices ...
1
vote
1
answer
205
views
Interpolate Image from Sparse Color Blobs by Distance Metric
Image processing: I'm looking for an interpolation/fill function that takes as an input a mostly black image with some scattered color shapes (pic 1). The function should fill all black pixels based ...
1
vote
0
answers
86
views
Failing to detect clip in audio file
I am trying to find all the locations of a drum clip in a piece of audio. This drum clip is a digital sample that is repeated at intervals. I have had reasonable success at removing the clip ...
2
votes
0
answers
82
views
Rotational Raman peak removal using an FFT
Outline
I have some Raman spectroscopy data that contains features that I want to remove. I'll point them out in the figure below:
Here you can see two sets of peaks that I am interested in, with the ...
1
vote
1
answer
443
views
Best way to calculate velocity, acceleration and jerk with different temporal resolutions
I already posted my question on the Physics StackExchange and was told to come and ask the question here.
I have 3D motion tracking data of people, that I am using for my thesis. I am trying to find ...
3
votes
1
answer
256
views
How to achieve bandlimited extrapolation for a discrete noisy signal?
Summary
I'm trying to extrapolate a signal $\mathbf{y}$ sampled at equidistant time points from $-T$ to $T$. From the given experimental conditions, I know that the Fourier Transform of the $\mathbf{y}...
2
votes
1
answer
251
views
Multidimensional empirical mode decomposition in python
I am trying to perform empirical mode decomposition of two-dimensional positional data using the python code given in : MEMD python. I have two time series data for x- and y- component of position. ...
0
votes
1
answer
119
views
How to sum complex exponentials to produce a signal in python
I've got a signal with known shape (from Oppenheim and Willsky problem 3.22a.(b)). I solve for the Fourier coefficients analytically and am happy with their values, given by.
$$ a_0 = 1/2 $$
$$a_k = \...
0
votes
1
answer
116
views
Scipy lowpass filter amplifies noisefloor in stopband
I´m trying to simulate digital signals using numpy and scipy.
When trying to lowpass filter a signal of the sines the result appears to amplify the region between the frequency spikes above the level ...
1
vote
1
answer
149
views
FFT of time varying measured signal in python
I am currently trying to measure the FFT of the measured signals (shown below) at the input of my device.
I am currently following the method detailed in this article, and wrote the following code to ...