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
4 views

Signal Header:Physical Min is not less than Physical Max- after opening EDF file on the viewer

Whenever I open an EDF file on the Case Western Research University's EDF Viewer Application, I get a Scaling Warning-"Signal Header:Physical Min is not less than the Physical Max ". I am reading ...
0
votes
0answers
11 views

Extract feature points and visualize on 3d Mesh

I'm Coding with python, I have a 3d Model mesh, and I'm trying to get features and descriptors So I was able to get Zernike moments using mahotas library which gives a vector of data, I have to ...
1
vote
1answer
41 views

I want to actuate a motor based on a wav file, but it has too many samples per second

I am trying to actuate a simple DC motor based on a wav file. At the moment I am using the "cat vs dogs sounds" from Kaggle. One of the wav files in this DB looks like this: These audio files are ...
0
votes
0answers
18 views

Detect Colors in an image using opencv python

How to find different colors present in an image? Is K means clustering enough or any other simple way of doing it using opencv exist?
0
votes
0answers
6 views

wavelet packet decomposition in python

i want to write a code for wavelet packet decomposition in python. i don't understand how i ll proceed.i am trying pyWavelet library but don't understand how to save the output coefficients in each ...
-1
votes
0answers
12 views

Autocorrelation of vector of images

I have a set of images (think a ball getting bigger and smaller). I want to assess the periodicity in this string of images (each data point in my signal is an image). How can I go about doing this in ...
0
votes
1answer
23 views

How do I detect the sharp edges in the following image?

I am looking to count the sharp pointy triangular things in the image. However I was unable to do so. One approach I did try was take a convex hull of the contour and then find convex defects but it ...
0
votes
0answers
26 views

Spectrogram using SciPy - bad scaling of the timeline [duplicate]

I have a real value signal which has 197 samples (every 1 second). I made its spectrogram using the SciPy library: ...
0
votes
0answers
15 views

Sparse Bayesian Learning algorithm in Python

I am implementing SBL in python. I have plotted a graph between MSE (mean squared error) and SNR (Signal to Noise ratio) The graph must be decreasing, but mine is decreasing till the SNR is negative. ...
0
votes
0answers
43 views

How to find frequency and corresponding time for an audio signal?

I want to read in a sound file and get the frequency at each time interval of the signal. I thought that the best way to approach this is by applying FFT to small chunks of the signal. Because FFT ...
0
votes
1answer
23 views

How to find out that a wav file is edited or original in Python? [closed]

I want to verify that if a audio (.wav or any format) file is original or edited. How can it possible in python? Here, "edited" means modification of audio file using software. For example, for an ...
0
votes
0answers
12 views

Looking for next-step ideas/ IMU data

I'm in a bit of rut regarding how to get anything useful from a data set i've created. Typically i have the following features, from a few different journeys on my bike: timestamp temp_h temp_p ...
0
votes
2answers
25 views

Using different algorithms/formulas to create spectrograms

On the internet, I have seen people use Matplotlib/Python and short-time fourier transformations to create spectrograms. Are their other formula/algorithms to create spectrograms? And are they ...
0
votes
4answers
50 views

Alternatives to Spectrogram [closed]

What is a more accurate alternative to a spectrogram that can be represented in an image? Also, what is a python script/exe that can be used to convert audio into the image format then back from image ...
0
votes
1answer
28 views

Comparison of results own implementation and python signal.welch

I am trying to replicate the output of Python's signal.welch function to make an estimate of the PSD from an FFT calculation. I don't want to use the built-in function to understand better what is ...
0
votes
0answers
44 views

Understanding the magnitude of frequency response filterbank based on elliptic filters

I've implemented a 10-channels filterbank with octave-scaled second-order elliptic filters using the Python's library scipy.signal. Here is the magnitude of the frequency response: Can someone ...
0
votes
0answers
50 views

Python FFT outptut

I have a (real) array of data and am trying to analyze its frequency components. I've been using NumPy's FFT routines, but I realized there is something I don't quite understand: why does the output ...
0
votes
0answers
51 views

How to normalize PSD to get the same magnitude as FFT peak

I am trying to use FFT and power spectra density estimation with python (np.fft.fftand scipy.signal.periodogram). And trying to ...
0
votes
0answers
41 views

Splitting an audio signal into multiple audio signals based on frequency range in Librosa

Using the Librosa package in Python, how may I separate an audio signal into multiple audio signals based on frequency range? I have a file music.mp3. I used HPSS ...
0
votes
1answer
45 views

inverse discrete fourier transfor with plain python

I am trying to calculate inverse discrete fourier transform for an array of signals. I am using the following formula: And my python code looks as follow. ...
1
vote
1answer
93 views

Why resampling change this FFT output?

I have been studying the following code but still unable to explain its output. I really hope someone could shed some light. Let me begin with the baseline. Suppose I have a 20 seconds sinusoid with ...
1
vote
1answer
171 views

Spectrogram of a single tone complex signal has two dark lines?

I am trying to plot the spectrogram of a complex signal I generated. I have written code to generate this signal and plot the spectrogram. It works. However I see that there are two dark lines present ...
0
votes
1answer
38 views

OpenCV warpPerspective implementation

I've implemented the least squares method to find the homomorphic image to fix the rotation and projection in an image. Now I'm trying to implement the OpenCV warpPerspective method in order to "fix" ...
0
votes
1answer
47 views

STFT Spectrum Analyzer: power drops over 15 kHz with songs, not with pure signals

I'm developing an audio file spectrum analyzer for a University Project. My main goal is to have an application that plots the Db Spectrum of a 16 Bit WAV PCM audio file (at this time only mono files) ...
0
votes
0answers
28 views

Once spines recognized, how do I find each individual book?

I want to make a system like the Book Spine Recognition on Youtube. So I read research paper and I built this system. According this paper, I use Hough transform, then I recognize book boundary ...
0
votes
0answers
8 views

Adjustments to get better result appyling hough circles

I have the aboveimage and wanted to detect circles spread around the image. I can detect the circles in the middle through hough circles but it does not work out for the left-most circles which exists ...
0
votes
0answers
32 views

Low-pass filtering with DCT produces blocky, high-frequency results?

I have a grayscale image, available at https://pasteboard.co/IdX7NfA.png. Now I want to low-pass filter this image in the Discrete Cosine Transform (DCT) spectrum. Specifically, I centered the image ...
0
votes
1answer
58 views

How to convert a spectrogram back to a signal [duplicate]

I'm converting a signal to a spectrogram, manipulating that (nonlinear stuff), and then want to use the modified audio signal. I can make it so the segments are not overlapping, but am unsure how to ...
0
votes
0answers
51 views

Frequency range for STFT in Librosa

I am currently looking at the STFT for Librosa. I was wondering how to understand the output of the STFT function, specifically what kind of frequencies the different values represent. Say I have a ...
1
vote
0answers
15 views

How to harvest the highest amount of information from an image?

I wrote a script that detects objects, crops the part of the image where an object is located and tries to increase the quality of cropped image. The object detection runs tensorflow. To increase ...
0
votes
1answer
75 views

High frequencies disappear when applying discrete wavelet transform

Trying to decompose and reconstruct a signal using a to some extent self-made implementation of DWT for some reason fails. The result looks highpass filtered and/or shifted. I wanted to write the code ...
0
votes
0answers
28 views

Losing lowest Frequencies in frequency modulated signal, rest of spectrum is fine

For several reasons I am attempting to re-modulate a de-modulated FM (as in WFM Radio) signal using python. Demodulating the initial signal goes well, it produces the PSD chart below which looks just ...
0
votes
0answers
24 views

delayed result in sinc upsampled signal

I have implemented an infinite kernel sinc interpolation. For some signals I notice an artifact, visible at the right end of the plot. I am wondering: is it a bug in my code or a phenomenon usual for ...
1
vote
1answer
51 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
21 views

derivative filter for computing speed from robot rangefinder

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 ...
1
vote
1answer
31 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
4answers
71 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
42 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 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
43 views

Reading a Wav File [closed]

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
45 views

Intelligent Noise Removal in Data

This question is linked to this question: I have this data: ...
0
votes
1answer
322 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
56 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
67 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
47 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
79 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
22 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
53 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
16 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: