Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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
vote
1answer
27 views

Exponential Chirp

I'm trying to replicate in python the exponential chirp (here) but I cannot understand well the t and T in the formulas; here is what I wrote, but it is surely wrong, please could you help me? ...
0
votes
0answers
8 views

Online backward-looking derivative filter for robot sensor data

I have a laser rangefinder on my robot and I need to compute the speed of the detected object. I have seen many different filters for that, but all of them apply only to offline data, or introduce ...
0
votes
1answer
18 views

How to Remove the Patch Artifacts of Neural Network Denoising Process?

I have written a python script which uses the Noise2Noise: Learning Image Restoration without Clean Data implementation of the Auto Encoder which is useful to remove noise from images. In the original ...
1
vote
2answers
43 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 ...
0
votes
0answers
26 views

Detect the Beginning and Ending of a Signal

I have a signal that looks more or less like square wave signal with different phases (Like in the picture below). However, the signal fluctuates a lot, we can see in the image below: At first, I ...
0
votes
0answers
17 views

How can one calculate a signal-to-noise ratio between two spectrograms in Python?

For context, I am creating a Python program for speech de-noising / enhancement. I am doing so by first taking a clean speech recording, mixing it with a noisy signal, and using a model to estimate a ...
0
votes
0answers
14 views

How to separate spliced(photoshopped) part from the rest of the spliced image?

I'm working on a project to detect spliced images and want 128x128 patches at the boundaries of the forged regions. I have the authentic background image and the spliced(photoshopped) one. If I ...
0
votes
1answer
24 views

Reading a Wav File

I need to read two .wav files. One of them is a song, and the other one is impulse response. Then, I have to convolve them. In fact, I have read them by using ...
1
vote
1answer
30 views

Intelligent Noise Removal in Data

This question is linked to this question: I have this data: ...
0
votes
1answer
32 views

Bandpass filter for audio wav file

How do I apply a bandpass filter on an audio file which is in wav format? And write back the filtered data in a new wav file for further analysis.
0
votes
3answers
31 views

dft of sampled sine using python

I'm trying to write a python script to perform a 100-point DFT over a finite length sample of a sinewave at 1/8 the sampling frequency. I'm curious why my DFT magnitude plot has two spikes in it when ...
0
votes
1answer
43 views

PSD subtraction

I am interested seeing the difference between two power spectral densities (PSD) as a noise reduction exercise The blue line is the psd of my signal, and the the orange line is the psd of the ...
0
votes
2answers
21 views

Extracting image metadata programatically

I hope this is the right location to post this, as my question isn't really stack-overflow material but involves images. I have hundreds of SEM-Images like this: and need to track changes in certain ...
0
votes
2answers
48 views

Delay in Savitzky-Golay filtering

I am applying a Savitzky-Golay filter to a signal, using the scipy function. I need to calculate the lag of the filtered signal, and how much is it behind the original signal. Could someone shed ...
0
votes
0answers
20 views

Strange phase for gaussian beam 2D

I have a 2D Gaussian beam : After doing FFT2 and angle I get strange results: This is the code I'm using (Python 3) ...
2
votes
1answer
24 views

Microscopy crystal particle object length detection

Hi I try to detect the particle length size from this image and I'd like to get the length size of the particle Like this below. and get the histogram of the size of the particle using centroid and ...
0
votes
0answers
15 views

Need help with detecting onset of audio in wav file

I'm new to DSP and I'm learning as I go. I have an audio file with a chirp signal(2kHz). I played and recorded this chirp signal and the recording has a lot of environmental sounds. Here is my code:
0
votes
0answers
14 views

Restoration problem with numpy fft function and self-made high-pass filter

Hi, I am using numpy.fft functions to do CV assignments in univ. But while implementing the high-pass and low-pass filter, I found something wrong during the process. The difference should converge ...
0
votes
0answers
36 views

Detecting similar behaviour in audio files

Can anyone help, I'm trying to find a solution that would allow me the ability to look at a batch of .WAV files and detect ones which share a similar behaviour in the recording like the image attached....
0
votes
0answers
11 views

Is there any python code for applying a-law/mu-law on 3D numpy array?

I have 3D numpy array of probabilities between [0,1], I need to emphasize on some area with lower probabilities. I was suggested to apply a-law and mu-law. I am wondering if there is python library/...
0
votes
0answers
36 views

Remove background noise from audio signal

I am looking for a python or matlab code to take an input audio signal, process it and remove any background noise other than the infant cry such as vehicle noise or a human talking noise and get the ...
1
vote
2answers
49 views

Beat detection in Matlab or Python

Try to determine the start time and duration of each "beat" in an audio signal (circled in figure below). It looks like a simple question, and python or Matlab should have toolbox/functions to do this,...
0
votes
1answer
25 views

Discrete-time, second-order section, direct-form II filter

I found dfilt.df2sos in Matlab and trying to figure it out how do I do that in Python? Is there any function that works similarly with the Matlab function? I also ...
0
votes
0answers
37 views

How to plot real time graph using python for the signals received from RTL SDR?

Using the below python code, I am able to plot a graph. Can anyone please tell me how to modify this code to plot the graph continuously in real time? ...
0
votes
0answers
24 views

How to calculate Continuous Wavelet Transform (CWT) for specific frequency range in Python?

I am new to this topic pardon if I ask stupid questions. My first question what is a scale and how to convert it into a frequency? Secondly, I want to get cwt of a signal, but I want to have the ...
0
votes
0answers
56 views

How enhance amplitude of audio signal without distortion?

After FFT I've set to zero some frequencies and I'd like to enhance the amplitude in order to recover the leak. I'd like to do a normalization in order to avoid distortion. I've done in this way but ...
0
votes
0answers
21 views

Using Wavelet Transform on a 1D signal while updating the values

I'm working on a NN that uses Wavlet Transformed signals (with different wavelets and levels) and combines them with an additional Statistical Features input (input_4) to provide one step ahead ...
0
votes
0answers
34 views

Filtering out different narrow-band frequencies at once

I have asked a closely related question on SO at https://stackoverflow.com/questions/55168460/python-implementation-for-filtering-out-multiple-distinct-narrow-band-frequencie but I am still unclear ...
0
votes
1answer
26 views

How do I differentiate between signals from an unknown program?

I believe this question is on topic for this site under Algorithm debugging questions, but if not, I would appreciate a suggestion about where to post this question....
0
votes
1answer
25 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)?
0
votes
0answers
18 views

Accelerometers (again…) using appropriate transformation for drifting signal returning back to x-axis (0 m/s)

Quick question on processing velocity results from accelerometer data. I'm aware of the unreliability of the data, but I'm willing to tolerate a fair amount of error. Also willing to perform lots of ...
0
votes
1answer
33 views

Extrapolate a 2D array using Fourier Transform

I need to extrapolate a given 2D array to a larger domain, keeping the spatial frequency. This is the original field: (the data file in numpy npz format and a Jupyter notebook to plot it can be found ...
0
votes
0answers
36 views

How to Extract frequency bands from Short-time Fourier Transform?

I am reproducing the results reported by the author in a research paper. In which he takes the STFT of EEG signals. The input data has a shape of (1 X500) and I used Scipy library built-in function to ...
0
votes
0answers
5 views

TEO-CB-AutoEnv implementation on python?

I'm trying to search for an implementation proposed as the nonlinear critical band based TEO auto correlation envelope area (TEO-CB-AutoEnv). If anyone knows of a library or such can you please link ...
0
votes
1answer
24 views

For discrete wavelet transforms, is redundancy needed to ensure perfect reconstruction?

So I was using pywt and I noticed that in the padding mode documentation they explain the following: DWT performed for these extension modes is slightly ...
0
votes
1answer
28 views

Is there a reason why with symmetric padding, the inverse wavelet transform is not the adjoint of the wavelet transform?

I recently stumbled upon a bothering fact when using the pywavelet library in Python. When we use the default "symmetric" ...
0
votes
0answers
19 views

Butterworth Method using Python

I want to use the Butterworth filter in python on my data set. I want to plot it and compare it to the original line. This is my code: ...
0
votes
1answer
59 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 ...
3
votes
0answers
58 views

Evaluate Fourier coefficients at arbitrary point using Python

Lets say I have a sinusoidal function $s$ that looks like ...
1
vote
0answers
25 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
votes
1answer
562 views

Remove background noise from audio file (python or matlab)

I am implementing a project for infant cry detection and the audio set contains background noises. So for preprocessing i need to remove the background noise from the audio.I am not able to get a ...
0
votes
1answer
54 views

FFT: do I need to include gaps in data in my FFT domain?

I am currently doing an FFT on a very large amount of vibration data, which I am going to sample with no pattern which I want to PSD eventually My question is in essence can I go from my data ...
0
votes
1answer
24 views

Choppy output when trying play through a callback buffer

I am trying to make a keyboard in python where every note's frequency is a ratio of the previous note but my output is strangely choppy for some reason. Here's an example of what I mean. I'm using ...
0
votes
0answers
46 views

LMS adaptive filter noise suppression- question about my implementation

I am writing LMS filter to suppress noise in wav file (I know there are many modules to do this but I need to write LMS manually now as I will translate it into C later). According to this answer[1], ...
0
votes
0answers
116 views

Filter ECG signal with Wavelet and Python

I have to filter the signal of an ECG with the wavelet method with Python. The data is in a txt file. I can create my dataframe with pandas, display that with seaborn, but can not find a way to apply ...
-1
votes
1answer
37 views

Displaying Cosine Signal in Python [closed]

I am new to signal processing concept, so this can be easy question. Actually, I want to display cosine signal by using python scipy.signal module. The method <...
0
votes
0answers
14 views

Looking for a analytical formula to compute the central frequency of a signal analyzed by a discrete wavelet at a given scale

I am reading this paper by Han et al. (2014). In this article, the authors extract detailed information from geomagnetic data sampled at 1Hz using a daubechies 5 (db5) wavelet: they reconstruct the ...
0
votes
0answers
26 views

Python scipy firwin2 has a low frequency error when designing arbitrary amplitude filter

I've been trying to design an arbitrary amplitude FIR filter which has a specific attenuation for each frequency. However I get an error at low frequency when comparing the results to my expected ...
2
votes
1answer
68 views

How to set STFT-parameters to visualize woodpecker / Sawtooth Signal? ​

I always wanted to work with FFTs and Spectrograms to characterise sounds and their frequencies using python. Lately I recorded a woodpecker at his work. Woodpecker Wav File To know where to look ...
0
votes
1answer
98 views

Audio/speech detection, verification

I would like to write a program to compare two '.wav' files, one of which is the original played file with human speech and the other is a recorded '.wav' file. The program I wish to write in python ...