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.

Filter by
Sorted by
Tagged with
0
votes
0answers
6 views

Finding the wiggles pattern in the original dataset. (Wiggles appear after performing division by another dataset)

I have multiple measurements regarding scientific observations. The problem is that there is a subtle noise pattern caused by the instrument - the wiggles. These wiggles are invisible when looking at ...
0
votes
1answer
19 views

generating log mel spectrogram using librosa

I have come across 2 different ways of generating log-mel spectrograms for audio files using librosa and I don't know why they differ in the final output, which one is "correct" or how ...
0
votes
1answer
31 views

How to perform a phase recovery for higher order modulation schemes

My objective is to demodulate the signals with different modulation orders and schemes. In particular, I want to recover the phase first. Let us say, my signal looks like in the constellation below . ...
0
votes
1answer
32 views

Energy of a complex exponential

I want to obtain the energy of this signal $$x_i(t)= e^{j2\pi(2i-1)f_0t}$$ where $f_0 = 1$ Hz, $i= 1,...,4$ and $j$ is a complex. I think I need to use the Fourier transform or the Parseval theorem ...
0
votes
1answer
46 views

what is silence in audio .wav file and how to compute decibels?

I'm a beginner of audio signal processing, and trying to understand some basic things about audio signals. I primary work with .wav files, so please allow me to use wav as my data to describe my ...
1
vote
1answer
21 views

How can extract the cosine transform formula used for 2D by scipy.fft.dct

For the 1D cosine transform the documentation is clear in here, and I can reproduce it easily: The formula is: $$y_k= 2 \sum_{n=0}^{N-1}x_n \cos \left( \frac{\pi k(2n + 1)}{2N}\right)$$ and here it is ...
0
votes
0answers
14 views

Python library for audio filtering, gating, and sound/silence detection

Is there a Python library that can do all of the following?: Band-pass filter; Noise gate, with different parameters set for different segments of audio file; Detect and count the number of discrete ...
1
vote
1answer
86 views

QPSK demodulation

My objective is to demodulate QPSK signal. At this moment, my constellation in the best case looks like in the picture below: and the corresponding eye-pattern: Eyes are completely closed, which ...
0
votes
0answers
22 views

Problem in constructing complicated block matrix [migrated]

So, Here I want to solve this above equation and determine $(W|a_1 a_2 a_3)$ in Python. However, most of the part I can possible do but I am totally clueless how could I construct such a Block Matrix (...
0
votes
1answer
35 views

Is there a Python method to calculate moving RMS of a signal? How to calculate the moving RMS using the discrete signal formula? [closed]

I'm trying to calculate a moving RMS of an acceleration signal. One of the answers in the post, shows the formula for calculating moving RMS for discrete signal. The formula they suggest: I have a ...
0
votes
0answers
27 views

Removing feature matched outliers within same image using RANSAC

I'm a student working on a copy move forgery detection algorithm. I have a forged image. By far I have, Found keypoints and descriptors from the image Matched the descriptors using 3 Nearest ...
0
votes
1answer
25 views

Pywavelets CWT returning 0 after scale 64

I am running continuous wavelet transform in mexican hat wavelet basis on a data set (with millions of samples) using pywavelets. The command used is ...
0
votes
1answer
21 views

How to filter out noise from non-stationary signal

I have this non-stationary signal. the mean is roughly constant but the second moment (autocorrelation) does not depend only on the time lag $tau$. Correct me if I am wrong in the above statement. ...
0
votes
1answer
47 views

IIR implementation - RuntimeWarning: overflow encountered in double_scalars [closed]

I have implemented a butter filter in python using this function: ...
0
votes
1answer
53 views

Calculate average from a power spectrum

I want to calculate the average of a power spectrum in the complete frequency range. I have done a stft and want to calculate power in dB and then the average. Please let me know from the code below ...
0
votes
1answer
14 views

mne raw plot looks like vertical lines instead of the usual signal

I have a data from a single eeg channel. When I plot it with plt, it looks like a regular signal. However, when I'm trying to plot with mne raw object's method plot, it looks very strange, like ...
3
votes
1answer
50 views

Wave Digital Filter Bridge-T Resonator implementation, gives expected cutoff frequency but incorrect gain and roll-off

Trying to implement the WDF in Fig 5(a) of this publication. The response of the ideal op-amp implementation is given by the black curve in Fig 7: Here is the plot I get when trying to implement the ...
0
votes
0answers
27 views

Python - preparing wav file so speech recognition (google) can return accurate results

I am trying to convert my wav files from playing tennis into text. I intend to use Google Cloud so ideally this would work with their Speech Recognition tool. TLDR: Tried denoising Tried slowing ...
0
votes
0answers
12 views

Is my interpretation of CAR filter correct?

I am a computer scientist working on a Brain-Computer Interface (BCI) project. So, i am using EEG data from a dataset and classifying them with the use of machine learning algorithms. Initial results ...
-1
votes
1answer
35 views

How to convert a signal form time domain to frequency domain using python [duplicate]

I'm a newbie of DSP and I have some problems when trying to convert this signal: ...
-2
votes
2answers
70 views

What is the formula to calculate the frequency response?

I'm newbie of dsp so i have a question for u guys: signal= [ -0.0018225230, -0.0015879294, +0.0000000000, +0.0036977508, +0.0080754303, +0.0085302217, -0.0000000000, -0.0173976984, -0.0341458607, -0....
0
votes
0answers
31 views

Efficient STFT computation

I am calculating the STFT using scipy, and then reducing it in size, flattening and then normalising it. Code is below. It's incredibly slow, given I'm trying to ...
5
votes
1answer
65 views

How to detect rectangular images inserted into another image?

It's just for a simple binary classification, so it's not needed to find the location of the inserted image or the content. I'm only interested in checking whether something like that is present or ...
0
votes
0answers
32 views

Pre-Processing Wi-Fi Channel State Information (CSI) Data

I was successfully able to collect some CSI data using the existing tool(s) on GitHub (https://github.com/StevenMHernandez/ESP32-CSI-Tool). The CSI data is a pair of imaginary and real number which ...
0
votes
0answers
30 views

Generating new 2D data using power spectrum density function from spatial frequency domain via ifft?

This is my first post so apologies for any formatting related issues. I also tried posting in stackoverflow but I'm more optimistic that I might get a response here. So I have a dataset which was ...
0
votes
0answers
52 views

Second order dynamic system identification from step response data

I’m doing a project on System Identification that will determine my future employment. I have used commercially available software before but I can’t afford this time and that includes Matlab too. I ...
1
vote
1answer
27 views

T1 Mapping in Python?

I'm trying to write a simple program to perform T1 mapping of a few MRI Images. My understanding is that all I need is to plot the pixel intensity values by inversion time then fit a curve. The output ...
0
votes
0answers
18 views

Read microphones connected to 4x1 USB Hub using Python

I'm working on a sound source localization project which needs an array of microphones. I have 4 microphones with an Audio Jack plug which is connected to a USB Audio adapter. Last I use a 4x1 USB Hub ...
0
votes
1answer
22 views

image processing find liquid level (only with images processing, no AI)

I want some ideas to get the level of a water/liquor in a cup. i tried many ideas (contours, edges,...) but nothings is working. So any ideas that i can explore.
0
votes
0answers
37 views

PyWavelets SWT versus MODWT

I'm just learning about wavelets and the PyWavelets package. I saw a reference to MODWT, which led me to the SO post here and then to this Python package: https://github.com/pistonly/modwtpy What ...
1
vote
1answer
60 views

How do I interpret an image of a spectrogram of an audio wind signal?

I am running the following code in python to get the spectrogram of a audio signal of wind: ...
1
vote
2answers
50 views

Adding noise to frequency response

I have the dynamics of a 2nd order system, mass-spring-damper for example, in the transfer-function format. For the analysis that I am doing, I am calculating the frequency response of the system by ...
0
votes
0answers
30 views

difference beetween decimate an array and decimate function

i'am actually comparing data and i got a question that i cannot anwser, here is what i understand. nanometrique move X[::256] : decimate and take 1/256 point in the vector (blue) decimate(X, 256, ...
0
votes
0answers
27 views

Integration of FTIR Absorbance Spectrum in Python

Hello I have a FTIR (fourier transform infrared) absorbance spectrum of a sample, Integrating the single lines is correlated to the quantity of substance present in the sample. The spectrum part I'm ...
0
votes
0answers
16 views

How to calculate the magnitude while calculating Blur in an image using using OpenCv based on Fast Fourier Transformation

I am working on image blur detection and found 3 methods for it. One is Laplacian Method but it works good with Gaussian, average, median and other distribution ...
2
votes
0answers
62 views

Edge artifacts in frequency-domain Moving Average filter

I am currently trying to implement in python an algorithm to identify and filter out one specific periodic EEG artifact -- the grad fMRI artifact -- as described in this paper, and I am incurring in ...
1
vote
1answer
59 views

Memory efficient filtering with scipy.signal in Python

I have several EEG channels that need filtering, and one channel may reach a recording length of 12 hours or potentially even more. This results in billions of data points stored which, when loaded, ...
0
votes
0answers
13 views

Does Kalman Consensus Filter have any public implementations?

I am trying to solve a problem using the KCF described here: https://ieeexplore.ieee.org/document/5399678 Does there exist an implementation of this (preferably in python) which is available openly? I ...
0
votes
1answer
28 views

Is there an a method to fit a wave created from two wave?

I need to get the frequency and amplitude for a wave that consists of multiple function. for example, if I have a sine curve (created from two sine waves), How can I extract the parameters for this ...
0
votes
0answers
21 views

Audio-Processing for DeepSpeech model

I try to understand audio signal processing from Deep Speech: Scaling up end-to-end speech recognition paper. Quote: Since the Switchboard and Fisher corpora are distributed at a sample rate of 8kHz, ...
1
vote
0answers
51 views

Why does numpy FFT only work for samples of 10,20,30 sec?

I'm using numpy FFT functions to find the amplitude, frequency and phase of low frequency signals. focusing between 0-10 hz.Part of my project is to vary the time over which the sample is taken and ...
0
votes
0answers
28 views

Signal “seasonality” detection

I am wanting to do a seasonality detection on a signal, but am struggling big time to find a solution. I have tried several different things, including statsmodels STL/seasonal_decompose. It seems ...
0
votes
1answer
38 views

Python how to detect white image [closed]

I am searching for python code or library to detect blank/white images like [png ,jpg ,bmp].
0
votes
2answers
65 views

How can I create a histogram showing the RMS amplitude for each frequency bin of an audio file

Using Python or Matlab, how can I create a histogram in which each bin is equal to a proportional frequency range (e.g. one octave) and the data added to each bin is a count of the number of samples ...
0
votes
2answers
44 views

Is there a way to use decimation or linear interpolation to shrink or stretch an audio signal in the time domain?

I am able to shrink/stretch an audio signal using Python code for a phase vocoder, as well as the stretchAudio function from Matlab's Audio Toolbox. Although both methods do indeed alter the audio ...
1
vote
0answers
49 views

Splitting Arabic speech by letter

I have the audio stream below, which is a recording of Arabic. I am trying to split the stream into individual letters. I have manually marked the ideal locations with black lines in the image below. ...
1
vote
1answer
43 views

What is causing my ANC LMS update to diverge?

I'm trying to implement a simulation of an ANC system with python, using this model here. My simulation keeps diverging, and I honestly don't know why. I'm using a source for LMS adaptive filter from ...
0
votes
1answer
50 views

What is the x and y axis showing for this matplotlib.pyplot histogram of a .wav file?

The python code below generates a histogram from a .wav file, but what exactly does the histogram show? Is the x axis amplitude binned by sampling rate? Is the y axis a count of how many samples are ...
2
votes
0answers
28 views

How to determine which measurements cause which?

Suppose I have two sequences of measurements, $x_1[n]$ and $x_2[n]$ for $0 \le n \le N-1$. How do I determine if there is a causal relationship between the two? My first thought was, well... I can ...
1
vote
1answer
89 views

Negative instantaneous frequency with hilbert transform using scipy hilbert

When I produce a chirp signal with a duration of 2 sec, sampling frequency of 200Hz, with frequencies ranging from 20Hz-100Hz, I get negative instantaneous frequencies using the scipy(Python) Hilbert ...

1
2 3 4 5
19