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.

0
votes
0answers
13 views

Convex Optimisation and Python

I was tweaking with CVX Toolbar in MATLAB. While running a simple example (available on CVX Documentation), I keep getting errors. I am writing a MWE below: ...
-1
votes
0answers
19 views

Signal to noise ratio in python [on hold]

How do I compute Signal to noise ratio on Python ? After some research in Google, I found a deprecated function signaltonoise on scipy.stats package.
0
votes
0answers
4 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" ...
-1
votes
0answers
9 views

How to implement Just Noticeable Difference(JND) of an Image [on hold]

I want to implement the algorithm of 'Just Noticeable Difference'(JND) of an Image with python-opencv or c++.
0
votes
1answer
34 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
13 views

Decoding and playing FM from async RTL-SDR [on hold]

I am trying to write a Python code to demodulate an FM signal using pyrtlsdr's ayncio features. As well as, to playback the FM signal with pyaudio using loopback. Here are my codes: main program: <...
0
votes
0answers
17 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
7 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
10 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
27 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
11 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 ...
0
votes
0answers
12 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
32 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
17 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
22 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
40 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
18 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 ...
0
votes
1answer
20 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
60 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
31 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
16 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
34 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
38 views

Intelligent Noise Removal in Data

This question is linked to this question: I have this data: ...
0
votes
1answer
93 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
46 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
53 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
22 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
58 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
36 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
25 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
38 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
13 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
55 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
64 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
32 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
42 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
43 views

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

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 option to choose the frequency range to work on. I found ...
0
votes
0answers
58 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
44 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
37 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
28 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
49 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
19 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
68 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
72 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
33 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
29 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" ...