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
1 vote
0 answers
16 views

How can a common trends be detected and filtered from multiple spectra data?

I'm looking at spectral data collected through Cavity ring-down spectroscopy. I'm comparing a few samples of similar analytes and expect slightly different peak heights and trends. However, there are ...
user avatar
0 votes
1 answer
57 views

(Python - Scipy - Wave files) Can a float signal be written with values higher than 1?

While developing an application, I noticed strange behaviour while using scipy.io.wavfile to write audio files. The documentation says that floating-point data is written within a range between -1 and ...
user avatar
0 votes
0 answers
25 views

A python-based implementation of time-frequency block thresholding for audio signals?

I'm looking for a python implementation of the block-thresholding algorithm introduced in this classic paper. I've been searching a while but I couldn't find it :(. There is of course a Matlab ...
user avatar
  • 1
0 votes
0 answers
21 views

Doubt regarding scaling of Welch Overlap Segment Averaging with Lomb Scargle

I am doing something similar to this question Comparison of results own implementation and python signal.welch. In my case there is no Welch method associated with the scipy lomb scargle spectrum so I ...
user avatar
  • 103
1 vote
0 answers
40 views

Interpreting results of Sobel Edge Detection

I am implementing A No-Reference Perceptual Blur Metric paper. Somewhere in the prep steps they mention the use of vertical Sobel filter for finding vertical edges. The algorithm is summarized in Fig....
user avatar
0 votes
1 answer
56 views

Copy an object (along with bounding box) from one image and paste on different image (only background)

I have a dataset of images with bounding boxes. I also have another dataset of images with different backgrounds. I want to copy the images from one dataset (with their ground truth boxes) and paste ...
user avatar
  • 21
0 votes
0 answers
36 views

Weird filtering result

Im filtering some ecg data for mainly just powerline noise (50 Hz), but get some weird result between the R-peaks (main spike). I have just done some tried with some basic filtering like this: ...
user avatar
  • 1
0 votes
0 answers
28 views

Accessing first few elements of a circular buffer in real time Python

I've made a circular buffer of size 10,000 in which I'm getting real time input from the mic. Now I want to access first 1920 samples every time and do the post processing but I'm only able to access ...
user avatar
0 votes
0 answers
20 views

PSD to FFT for audio [duplicate]

I'm trying to convert a noisy input to fft and extract the signal using a local average. By the way, after the transformation of fft, it was found that the values of adjacent times of the same ...
user avatar
  • 1
2 votes
1 answer
31 views

Why fir1 from MATLAB returns one more sample than its order?

I'm starting to use both the fir1 MATLAB and firwin Scipy functions. Both are window-based FIR filter design methods. I would ...
user avatar
1 vote
1 answer
16 views

How to get the time domain of a pulse after an amplitude mask or a phase mask has been applied?

I am a chemist, and I am studying ultrafast spectroscopy. In these spectrscopies, usually a short (femtosecond) pulse of light is used to probe chemical reactions. Now, one of the topics in our ...
user avatar
  • 111
0 votes
0 answers
23 views

Changing Tempo of Audio in Python

How can I achieve speeding tempo of audio files without changing pitch in Python native way? I have found some external executables can be used in Python like rubberband to change tempo but I want to ...
user avatar
0 votes
0 answers
39 views

Long-Term Spectral Average in Python - question on sound intensity side bar

I have tried this code to find the Long-Term Spectral Average of a given signal. However, I am not sure if the side bar is correct as I was expecting negative values for them. Here are the parameters ...
user avatar
3 votes
1 answer
839 views

Signal processing in Python vs C++ (band-pass filter)

I have implemented Python signal processing code using a butter bandpass filter and order 3. It is working pretty well. I am required to implement the same signal ...
user avatar
0 votes
1 answer
120 views

Plotting the Frequency Response of Zero-Order Hold

I'm trying to find the frequency response and the DC gain, then plot the response and find the cutoff frequency from the graph. I start off with the impulse response $$h(t)= 1 ; 0\leqslant t\leqslant ...
user avatar
1 vote
0 answers
46 views

How to calculate power spectrum from mechanical vibration signal?

I am not 100% sure if this question is fit here but it seemed the best place to post. So my task is to perform power spectrum analysis on a signal measured with a sensor outputting movement speed of ...
user avatar
  • 11
0 votes
0 answers
63 views

Image processing pipeline for segmenting cell nuclei

I'm seeking a better image processing pipeline to essentially segment cell nuclei in fluorescence images. So far, I've tried a bunch of morphological operations, e.g. modifying this scikit-image ...
user avatar
  • 166
0 votes
2 answers
39 views

Impact of STFT window function and FFT length on computation time

I have been doing a study which part of it includes a comparison of computation time vs window type and length (among some other things in the computation time, however I speak in terms of relative ...
user avatar
  • 77
0 votes
1 answer
92 views

FFT of a gaussian signal in Python

I've been trying to get the FFT of a gaussian in Python. When I use the following parameters, the FFT goes hand in hand with the theoretical FT of the gaussian, but if I increase $\sigma$ they rapidly ...
user avatar
  • 101
15 votes
4 answers
2k views

When concatenating sine waves, how do I phase shift in order to prevent "pops" caused by sudden jumps in amplitude?

I'm writing a synthesizer using numpy and python. I've run into a problem where concatenating sine waves causes 'pops' or 'clicks' when they are outputted to audio, say, via ...
user avatar
  • 151
-1 votes
1 answer
56 views

Why is this Python implementation of trigonometric interpolation not working properly?

Consider a signal $u_j, j = 0, 1, \dots, N-1,$ sampled on an evenly-spaced grid of points, $x_j$. Define the discrete Fourier transform of $u_j$ by $$U_k := \frac{1}{\sqrt{N}} \sum_{j=0}^{N-1}u_je^{-(...
user avatar
  • 3
0 votes
0 answers
56 views

How to remove noise from audio and convert the audio to text

This is a video link https://www.youtube.com/watch?v=78YHir50N4o I have used the audio from this video. I am using SpeechRecognition library to transform it to text but because of the noise it is not ...
user avatar
1 vote
0 answers
49 views

Labels in speaker verification

I'm a beginner. If I am using a Convolutional Neural Networks with Triplet Loss as a loss function (also combined with GAN and a Classifier) for building a model that performs Speaker Verification, ...
user avatar
  • 11
2 votes
0 answers
59 views

How to improve my FFT output?

I am to reproduce the figure below but with a different blue line (source), which shows the ideal normalized frequency spectrum (grey) of a spectral ripple with 0.7 ripple-per-octave and an electric ...
user avatar
1 vote
0 answers
68 views

Getting envelope of noisy signal

I am analyzing some interferometry data and have a time signal that looks like this: Our temporal resolution is unfortunately not enough to resolve the fringes. I need to get the upper envelope of ...
user avatar
  • 11
0 votes
1 answer
31 views

Simulation of Lock-In Amplification in Python makes no sense

I would like to simulate a basic lock-in amplification for post-processing some data. I wrote a basic Python script for this purpose but the output of the lock-in amplification does not seem to make ...
user avatar
0 votes
0 answers
32 views

Mono FM radio demodulation

I am trying to demodulate an IQ file containing a sample of a FM radio signal using two methods. First, I tried reading the whole file and demodulate all data at the same time. Second, I tried ...
user avatar
0 votes
0 answers
108 views

What is going wrong with the plot of 2D spatial spectrum at a specific frequency?

I've a set of 09 sensors in the following arrangement and the script for the sensor positions as follows: ...
user avatar
  • 21
0 votes
0 answers
18 views

Python EEG Sampling more than Sampling rate

Im using Python pylsl to recive EEG data from Muse. If I run sample, timestamp = inlet.pull_sample() more than 256 times a ...
user avatar
0 votes
1 answer
90 views

Are there any order analysis functions in Python?

I would like to perform the following order related tasks in Python: Convert tachometer pulse signal to RPM signal (tachorpm) Convert RPM signal to even-angle signal (orderwaveform) Time synchronous ...
user avatar
  • 11
6 votes
2 answers
196 views

Can the deconvolution Wiener filter reduce noise without having a blurred image?

I am trying to denoise many several noises with several filters for a research i have, i found a deconvolution Wiener filter made by "mr.tranleanh" on Github, as you can see here . what I ...
user avatar
  • 63
0 votes
0 answers
52 views

FFT Data - How to get frequencies?

I have some python code running an FFT on EEG data, I now want to be able to read frequencies, for example something like x = fftdata(10hz - 50hz). This is my code ...
user avatar
0 votes
0 answers
69 views

High Pass Filter for Image using C++ and Python

I was assigned to optimize the HPF using C++. Fyi, the original image is 512x512. By getting the .dat file that is produced by using Python script, I applied a 5x5 HPF on it with 2 zero-pad with ...
user avatar
0 votes
2 answers
43 views

Butterworth filter cutoff attenuation is not exactly 0.707(-3dB)

The documentation of scipy Butterworth filter says its cutoff attenuation is 0.707(-3dB). To validate this, I created a square wave signal, performed FFT and implemented a bandpass filter with a band ...
user avatar
  • 11
0 votes
0 answers
34 views

Python Bode plots frequency response of transfer function

...
user avatar
0 votes
1 answer
58 views

How to achieve a periodized Mexican hat wavelet with period L by using Python?

Now I have a scaled Mexican hat wavelet, i.e. $$ \psi(a,x)=\frac{1}{\sqrt{a}}…\left(1-\frac{x^2}{a^2}\right)e^{-x^2/(2a^2)}, $$ which decays quickly along the x-axis. Here I want to define a ...
user avatar
  • 145
0 votes
0 answers
35 views

3D Convolution with sum of multiple 2D Convolution operation

Probably this is a simple question, but I quite don't understand the reasons why I can replicate a 3D convolution operation with the sum of multiple 2D convolution operations. Is it a property of ...
user avatar
  • 135
0 votes
1 answer
126 views

Order analysis on sample vibration data to detect unbalance in python

My main goal is to figure out how to do an order analysis in Python. For this I'm trying to do an order analysis in python to some sample vibration data I found here (with and without unbalance). I ...
user avatar
1 vote
0 answers
93 views

Spectrogram of x,y,z data from accelerometer

Using scipy.signal.spectrogram for creating spectrogram and matplotlib's pcolormesh for plotting. I'm working on a project where I'm using a spectrogram to visualize the frequencies of the ...
user avatar
  • 11
0 votes
0 answers
49 views

How can I generate long time series data of band limited gaussian white noise in Python?

...
user avatar
0 votes
0 answers
19 views

Why there is a difference from amplitude calculated from PSD and the real one? [duplicate]

I make a script in python to extract amplitude from power spectral density. I try to verif it but I have a difference between the real amplitude and the amplitude extracted from PSD. To calculate the ...
user avatar
0 votes
0 answers
51 views

How to take amplitude and frequency from the power spectral density?

I try to take the amplitude and the frequency from the power spectral density. So I make a time series with a 5 component waves, then I draw the PSD with the welch method. Now I need to take the ...
user avatar
0 votes
1 answer
24 views

What are my time values for a Lomb Scargle analysis?

I have data that is sampled every 5 minutes(or every 300 seconds)from an automated instrument that measures temperature outside. The data is available on a monthly basis i.e every 1 month . That is ...
user avatar
  • 103
0 votes
0 answers
72 views

Getting Frequency Bands from EEG using Python

I am using pylsl to inlet EEG data from my Muse headset, and it returns data from each induvidual sensor as a number around every millisecond. Is there a way to use this data to accurately get ...
user avatar
1 vote
1 answer
57 views

Standardize fft amplitude with different encodings

I'm trying to "standardize" the results of the fast Fourier transformation. I've one wav with two peaks (3000 and 3300 Hz) saved with three different encodings(int16, float32, int32). And ...
user avatar
  • 13
1 vote
0 answers
20 views

Mann-Kendall Trend Test

I'm using the pyMannKendall package in Python to detect the presence of slope of any given waveform. More details of the package here: https://github.com/mmhs013/pyMannKendall I'm not exactly able to ...
user avatar
  • 11
0 votes
1 answer
42 views

Why does fourier transforming an analytic signal gives me negative frequency components?

I consider an array: import numpy as np from scipy.fft import fft from scipy.signal import hilbert a=np.random.rand(5) First I manually compute the fourier ...
user avatar
1 vote
0 answers
41 views

Implementing optimization part of blind deconvolution in Python

I am trying to implement the paper Qi Shan, Zhaorong Li, Jiaya Jia, Chi-Keung Tang - Fast Image/Video Upsampling and need some help with implementing minimizing an energy function (7) shown below. ...
user avatar
  • 111
0 votes
1 answer
37 views

How to inject a 2D plane sine wave to the array of seismic sensors?

I've several sensors positioned at various points in the $X$,$Y$-Cartesian coordinate system, and I've experienced a problem to inject a planar Sine wave to the spatially positioned sensors, the ...
user avatar
  • 21
2 votes
1 answer
71 views

Performing STFT after Butterworth Filter Seems Lower in Resolution

I have a signal recorded at 2MHz sampling rate. Before any decimation might be required, I first looked for peaks in my periodic recorded signal using STFT/spectrogram. From here, I can clearly see ...
user avatar
  • 77

1
2 3 4 5
22