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

Crosstalk reducution with Independent Component Analysis (ICA)

I am working on pre processing for chromatograph for Sanger DNA sequence, each curve shows adenine (A), thymine (T), guanine (G), and cytosine (C) intensity. In one of the pre-processing step is to ...
0
votes
0answers
11 views

denoising and debluring

One of the many applications of Internet of Things (IoT) consists of continuous monitoring of temperature in an area. To that end, several temperature sensors are installed at different locations. ...
0
votes
1answer
12 views

Microphone Data Comparison for breathing data… best way to compare two files?

I am currently trying to compare the amplitude vs time data between two different microphone readings (.wav files of inhales and exhales) and detect which reading produced a louder sound, on average. ...
0
votes
0answers
35 views

FIR filtering returns “static” signal

//PROBLEM I'm trying to filter EEG trials from an array in which each trail has dimensions [8x125] = [number of channels x samples@250Hz], but the resulting signal looks static and wrong. Why is this ...
0
votes
1answer
25 views

Python- FM Modulation

I am trying to Frequency modulate a sine signal using Python. I have written the following code that should do it: ...
0
votes
0answers
9 views

Average Power Spectral Density (1D and 2D) of multiple images of different sizes in python

I am trying to calculate avg 1D and 2D PSD of multiple image with different sizes. Any idea how can I do this? Current I'm calculating 1D psd using this function. The problem here is that each image ...
0
votes
0answers
7 views

Numpy 2D FFT produces corona that is not uniform around center

Tldr: Numpy FFT creates non uniform output when output is wanted to be uniform. I want the output to be a uniform corona. I am trying to eventually run a Gerchberg-Saxton phase retrieval algorithm. I ...
2
votes
2answers
68 views

Specify minimum trigger frequency for recording audio in Python

I'm writing a script for sound-activated recording in Python using pyaudio. I want to trigger a 5s recording after a sound that is above a prespecified volume and frequency. I've managed to get the ...
0
votes
0answers
21 views

How to Amplitude Modulate a wav file

I want to AM a given sound from an audio file. The sound is 12 seconds long with 48000 sample rate, if I plot it, it looks like this: I've figured out I need the amplitude range to be from -1 to 1 ...
0
votes
2answers
24 views

Real-time FM demod results in clicking and strangely-shaped output

hardware engineer here dipping his toes into software DSP and running into some issues. I'm attempting to demodulate in realtime a simple narrowband FM signal with samples from an RTL-SDR, and play ...
0
votes
0answers
20 views

Find vertical/horizontal lines

I tried everything including the Hough Transform with different inputs; Laplacian and Sobel and Canny edge detector were run on filtered image but cv2.HoughLinesP and cv2.HoughLines both give me wrong ...
0
votes
0answers
17 views

A scaling difference between MATLAB's pwelch and Python's SciPy welch

I'm having trouble in python with the scipy.signal method called welch (https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.welch.html), which ...
0
votes
0answers
5 views

GNU Radio buffer size [migrated]

How can I set custom buffer size for OOT python block in GNU Radio? My goal is block with input parameter input_buffer_len and block's geeral_work() function works with exactly input_buffer_len ...
1
vote
0answers
25 views

Estimate respiration rate from a respiration signal

I have a respiration signal sampled at frequency 125Hz, can I estimate respiration rate signal at a frequency 1HZ from the respiration signal? Is it possible to use FFT or FFT for this purpose in ...
2
votes
2answers
73 views

Invertible low-pass (Butterworth) filter in python (scipy)?

Question Is there an invertible low-pass filter built into scipy.signal (or other python package)? If so, what is it? If not, why not (is there something ...
3
votes
1answer
111 views

Sound activated recording and advanced filtering on Raspberry Pi

I'm making a Raspberry Pi bat detector using a USB-powered ultrasonic microphone. I want to be able to record bats while excluding insects and other non-bat noises. Recording needs to be sound-...
0
votes
2answers
29 views

Detrending PPG signal

I'm filtering a raw PPG signal sampled at 100sps After applying a bandpass filter my signal looks like this As you can see, It has a trend (a low pass component which is not in the desired signal). I ...
2
votes
1answer
51 views

ringing artifacts using FFT-based gaussian blurring

I'm trying to do an FFT-based gaussian blur on a grayscale image, and it works, however it seems to introduce ringing artifacts to the result when compared to the expected direct filter. What can I do ...
0
votes
2answers
29 views

Should upsampling impact the amplitude of an autocorrelated signal?

I want to autocorrelate a signal using numpy's correlate method. Let us consider a 10 minutes long signal sampled at 2,000SPS: ...
0
votes
0answers
16 views

How to get an accurate edge value of gaussian scipy

i am new to this forum and I am not sure which topic I have to use. But I think my problem belongs to signal processing. My problem is the following one. I try using filter to find the actual momentum ...
0
votes
2answers
58 views

Why does my amplitude change upon inverse Fourier Transform when I am only randomizing the phase of the fourier transform using Python numpy?

I am trying to make a surrogate time series of a discrete data series using python, basically I wish to keep the amplitude same and change the frequency I take a Fourier Transform of the data I ...
0
votes
0answers
13 views

EEG Data Analysis

I have recorded EEG data using openBCI which is in the range of -15000 to 15000 micro volts. I want to reduce this to the range of -100 to 100 micro volts. How do I do it?
1
vote
2answers
107 views

Transfer functions for Scipy and Matlab's Butterworth filter don't seem to match theory

The squared transfer function for a Butterworth filter of order $n$ should be $$ |H(f)|^2 = \frac{1}{1+\left(\frac{f}{f_c}\right)^{2n}} $$ where $f_c$ is the cut-off frequency. (Here's one of many ...
0
votes
1answer
42 views

How is sampling affecting this sine wave?

I am trying to create a sine wave in python, but when I graph it, it looks like this: here is the code I used to make the signal: ...
2
votes
1answer
26 views

Getting error while performing upsampling of an audio signal processing using low pass filter in python

I want to perform upsampling of an audio signal introducing zeros between samples to create a longer signal with factor of N=2. The sampling rate is 44100Hz, time = 5sec. ...
0
votes
1answer
52 views

Dealing with normalized cut-off frequencies larger than 1.0

I am trying to create an FIR bandpass filter in python using scipy with the following characteristics: $$f_{c_{low}} = 310\,Hz$$ $$f_{c_{high}} =600\, Hz$$ giving me a bandwidth of: $$Bandwidth = f_{...
0
votes
1answer
24 views

Is there a way to find the contours of instances in a binary mask image by color?

I need to find the contours for each of the instances of microscopic cells in a binary image mask of dimensions 256 x 256 shown below. My approach involves thresholding the image to get a binary mask ...
1
vote
1answer
53 views

How to compute convolution using the Discrete Hartley Transform

It's easy to compute the Discrete Hartley Transform of a 1D signal: ...
0
votes
0answers
17 views

Stack audio frames for classification

I have audio files for which I extracted the mfcc features, and I ended up with train dataset of size 3082092 frames by 30 mfcc: torch.Size([3082092, 31]). What is ...
1
vote
2answers
78 views

Deconvolution of system response in Python/Matlab

I had two sets of data, the output function of the system (time series with a length of 1292 entries) and the transfer function (similar to a gaussian with a length of 681 entries). I would like to ...
1
vote
1answer
59 views

Compare two Fourier transforms of two signals by calculating the coherence

My overall aim is to compare the edges of two images by comparing their Fourier Transforms (FFT) and to calculate one number as a key performance indicator that describes how much they are similar to ...
0
votes
1answer
53 views

How to get rid of noise in audio files?

Is there any method to get rid of noise in wite circles of the spectrogram? I have done the high pass filter for a cut-off frequency of 1 kHz. And I'v also done a adptive noise reduction in adbobe ...
0
votes
1answer
26 views

Problem wih (diverging?) digital IIR filter for an online acquisition system

I am trying to plot windows of acquired data from an LSL-compatible system. For the example below, let's consider 1-second window of a 64 channel EEG system. In practice, I use shorter 0.2-window, but ...
0
votes
1answer
42 views

How to correctly set the zi parameter (initial condition) for a scipy IIR filter

Let's take as an example an IIR filter using the 'sos' output, as this is what I use the most. To apply a bandpass filter, you can do: ...
0
votes
1answer
26 views

How to get coordinates(x(time),y(frequency),z(intensity(db))) from spectrogram?

I have created this spectrogram from a wav file. Please have a look: enter image description here I want to get the x = time, y= frequency, z=intensity(db) of every pixel of the spectrogram. How can ...
0
votes
0answers
27 views

Filter 3D volumetric image with a Butterworth filter in Python

I have been looking for a way to filter a 3D volumetric image in python with a Butterworth filter, but I haven't found any good solution. I have tried this: ...
0
votes
1answer
23 views

I want to perform aec on a wav file and calculate erle

I am trying to evaluate the performance of an AEC by comparing the i/p and output wav file. I want to calculate echo return loss enhancement to predict how much(db) echo has been attenuated but i am ...
0
votes
1answer
33 views

Extraction of the phase lag form cross-correlation function

I would like to find out the phase offset that my signal contains at the receiver side. For this, I use the cross-correlation function, where I cross-correlate signal before and after matched filter. ...
2
votes
2answers
70 views

End of chirp in phase 0

I would like the chirp to end in phase zero. Chirp time or end frequency may vary slightly. Now I'm checking the maplot output. I observe the same thing at the output of the sound card. In this ...
1
vote
0answers
46 views

Software implementation of Gardner Loop

My objective is to create a Gardner loop to remove the timing offset present in my signal. To achieve best timing SNR, I downsample my signal to 2 samples per symbol. It is depicted below: where blue ...
0
votes
0answers
40 views

The timing offset remains after Gardner loop

I would like to use Gardner loop to remove the timing offset in order to demodulate the signal. My signal contains the frequency offset, however I know that the Gardner loop can handle substantial ...
1
vote
2answers
95 views

The FFT of a sine wave with varying frequency and constant amplitude does not show a plateau, why?

I want to use python to see what the audio response of a speaker is. This would be done by comparing the output of the speaker measured with a microphone to the given input. That means that for both ...
0
votes
1answer
43 views

Obtaining real numbers from FFT with same length as original signal

In this article the real valued time domain signal is transformed to the frequency domain to extract some features like mean or variance. But after transform to the frequency domain I calculate ...
0
votes
1answer
31 views

Doubling of the scipy.signal's bandpass filter order during the design [duplicate]

I am trying to extract filter coefficients for a bandpass, using the "scipy.signal.iirfilter" function: ...
0
votes
0answers
30 views

How to make a definite integral in python?

Helo! I have this exercise to do but I don't understand how to define the integral. $$ v(t) = \int_{-\infty}^{t} y( \lambda) d \lambda $$ considering $$y(t) = 10 \Lambda \left( {t-1 \over 1} \right)$$ ...
1
vote
1answer
104 views

Symbol timing recovery in Python

My objective is to demodulate QPSK signal. At the receiver I apply RRC filter and interpolate the signal to get the values of the signal (approximately) at the sampling instances. Then I am concerned ...
0
votes
0answers
33 views

Trying to implement matlab pwelch function in python using scipy welch

I am trying to port the statistics toolbox function pwelch from matlab into python, but when I am trying to implement it using scipy.signals.welch, it does not return the same results as it does in ...
0
votes
0answers
8 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
64 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
41 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 . ...

1
2 3 4 5
19