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

Parameter tuning for noise removal in video frames background subtraction

I’m working on motion detection using video frames background subtraction. I already reached a good result by filtering detected motions area using thresholds where I keep only reasonable motions by ...
0
votes
2answers
38 views

Why is my low pass filter decreasing the amplitude when using the inverse DTFT?

Goal: I'm trying to model a waveform in the time-domain for pattern recognition. My plan: Convert signal to frequency domain using FFT Reduce harmonics to hopefully isolate residual data, and make it ...
0
votes
0answers
10 views

How to use numpy covariance result to get a correction factor and make my second signal to exactly overlap on my first signal?

covariance = np.cov(y1_interp, y2_interp)[0][1] print('covariance is', covariance) covariance is 0.00010861874695023591 This number shows how different my signal 2 ...
2
votes
1answer
45 views

Which Programming Language Should Be Used for Deep Learning (Deep Neural Network [DNN])?

I will do voice activity detection and speech enhancement based deep neural network. However, I don't know whether to do this via matlab or pyhton. In which programming language can I find more ready-...
0
votes
1answer
22 views

Signal values explode when filtering with bandpass and wiener in Python

I have a five second audio (speech with background noise), which I want to process first with bandpass filter and then with wiener filter to reduce noise. Audio is normalized between [-1, 1] and I ...
0
votes
1answer
29 views

How to find first local maxima in an unknown dataframe

I get a Dataframe in Python with multiple maxima and minima, I want to find always the first maxima/minima in the frame and ignore the other ones. The problem is that the data has a lot of noise and ...
0
votes
1answer
54 views

implementing Prime-factor FFT algorithm

I've been trying for days to implement this algorithm to work with size N samples but I can't manage to do it. my goal is to compute FFT for 100 samples, so I need factor 5 and 2, I wrote a simple FFT ...
1
vote
0answers
56 views

FM and PM waves

I have to find the FM and PM waves corresponding to this sawtooth signal: I have found out the PM wave as: I am getting the FM wave as this : I have plotted this using Python. Can anyone please ...
0
votes
1answer
30 views

Evaluate filter matlab function on scipy

I want to reproduce the result given by filter() MATLAB function using scipy.signal functions. The result is not consistent: Matlab example: ...
0
votes
1answer
32 views

How to specify parameters in scipy.stft to reproduce published analysis

I am starting a project on this Keggle dataset containing EEG registrations (sampled at 128 Hz) of several subjects. What I am really interested in is the final ...
0
votes
0answers
16 views

Get Hilbert marginal spectrum with emd package in python

I want to get the Marginal Hilbert Spectrum in Python using the emd package. You can estimate the Marginal Hilbert Spectrum as where, and A(ω,t) is the time-dependent amplitude modulation and ω ...
0
votes
1answer
41 views

How to properly band-pass filter an autocorrelated signal?

Let's consider an example ECG time series, sampled at 360Hz: I verified that autocorrelating a signal preserves its frequency content. For instance, both original and autocorrelated data show the ...
1
vote
0answers
21 views

Unexpected results of deconvolution with scipy.deconvolve

Below I have plotted the signal (Lifetime decay) I am trying to deconvolve from a known impulse response function (IRF), as well as the IRF itself. I'm using scipy.signal.deconvolve. Please note for ...
0
votes
0answers
26 views

How to handle zeros before FFT convolution / deconvolution?

I would like to calculate the input function (unknown) by deconvolution of the output and the "system response" signals. The output is a finite signal from a measure device so it presents ...
0
votes
1answer
24 views

Kalman filter for heading estimation with magnetometerv + gyroscope only considers magnetometer

I implemented a Kalman filter to estimate the heading of a robot that is moving in 2D, given the measurements coming from a magnetometer (X, Y) and a gyroscope (Z). The code is the following: ...
1
vote
1answer
33 views

If I want to see if a specific period is present in a signal, how do I decide on the number of points we sample the Fast Fourier transform?

I have a time series, which I believe should have daily periodicity, the signal is sampled once every 15 minutes, which means that one period is 288 samples. When I am trying to validate this result ...
0
votes
0answers
20 views

What input is most appropriate for CFAR processing in FMCW radars and why?

I am estimating range, velocity, angle of arrival from a FMCW radar. To detect potential target candidates points in this 3D domain, I am using a OS-CFAR after the doppler-range to detect the ...
1
vote
1answer
59 views

How to calculate the envelope of a complex signal using python [closed]

I used the scipy hilbert function to calculate the envelope of my signal. The problem is that the signal is complex, so it throws an error when I use Hilbert function. I tried to just use the real ...
0
votes
1answer
23 views

How to automatically determine if there is NO seasonality from PSD/FFT of time series?

I have around 1000 different time series, and for each one of them I want to automatically determine if there is any seasonality in the time series. Given the assumption that there is seasonality ...
2
votes
1answer
169 views

Why Wiener filter is not optimal?

I am investigating Wiener filter in the frequency domain, given by $$ W(\omega) = \frac{S_{ud}(\omega)}{S_{uu}(\omega)}$$ where $S_{xy}(\omega)$ is the cross-power spectral density (CPSD), see scipy....
0
votes
1answer
42 views

Understanding the Chebyshev2 Bandpass Filter Poles-Zeros Plot

EDIT This ended up being a bug with my plotting code :) I'm relatively new to using IIR filters, I wanted a bandpass filter for the 0.5Hz -> 5.0Hz frequency range and was looking at the zero-pole ...
0
votes
0answers
24 views

Beginner Q: Methodology of processing 5 kHz accelerometer signal for event detection

I'm very new to the world of signal processing and looking for some guidance. I have 5 kHz accelerometer data from a car and looking to process this to remove some of the high frequency noise and also ...
0
votes
1answer
43 views

How to extract the dominant frequency from the audio WAV file using numpy

So, I recorded this audio on my phone while I was running a tone generator on my PC at a frequency of 13Khz, now I want to extract this frequency which is dominant from the recorded ...
1
vote
0answers
49 views

3dFFT to compute angle of arrival in FCMW radars

I hope I am not asking any already-answered question. I have a simulated doppler-range map of a 1Tx - 4Tx (azimuthally displaced) FMCW radar and I am doing something wrong to calculate the angle of ...
1
vote
2answers
71 views

Are scipy second-order Gaussian derivatives correct?

For an edge detection algorithm, I need to compute second-order derivatives of an image, and I do this with use of Gaussian derivatives. I assumed that the ...
0
votes
0answers
18 views

Calculation of ITD (Interaural time delay) using linear prediction - python

How is it possible to calculate the interaural time delay between two signals recorded underwater (ship sound signals)? Will linear prediction weight method be used for this?
0
votes
0answers
19 views

How can I extract P300 from a continuous EEG dataset?

I have a continuous EEG dataset from the MUSE EEG headset. I need to extract the p300 events from the headset. Is there any standard algorithm / open source project for the extraction of the p300 ...
0
votes
2answers
42 views

What kind of noise features should I know before removing them programmatically?

This is my first question here in DSP StackExchange and honestly speaking I don't have any experience in this field, but one of the school project I'm currently working in is building an application ...
0
votes
0answers
35 views

How to smooth wiener deconvolution result in Python?

I'm wondering if it is possible to smooth the estimated response from a Wiener deconvolution in order to have a better representation of the original signal and to remove the side lobes. (Here an ...
2
votes
2answers
251 views

Reconstruction of a Signal from Sub Sampled Spectrum by Compressed Sensing

Context Attempting to reproduce an illustrative example of compressive sampling from Candes-Wakin 2008. Specifically, the L1 recovery of a sparse signal shown on pg 5 in Fig. 2. Using my code (below), ...
0
votes
1answer
32 views

Matching short tones

I have a series of tones, that are no more than a second long each (around 0.6/7 seconds each), I am recording them through a soundcard and want to be able to match which tone has been played. I am ...
0
votes
1answer
55 views

FFT of a Time series data

...
0
votes
0answers
16 views

mne EvokedArray topomap multiple topomaps, want to use same colormap mapping

SOLVED It turns out I should be using mne.viz.plot_topomap, and not mne.plot_topomap, which is expecting snapshots in time thanks for reading this post. I have a data vector whose components ...
2
votes
3answers
83 views

scipy.signal.spectrogram() - how to handle gaps in the timeseries data

Looking at the magnitude of variable stars - the dataset is from here: https://dogwood.physics.mcmaster.ca/Cepheid/URL/MW/BD-10d4669.html The magnitude plot: ...
0
votes
1answer
31 views

scipy.signal.spectrogram() with noverlap=nperseg-1, what are the possible side-effects?

I'm using a simulated data set which can be downloaded from the link in the fist paragraph on this page (it's an Excel file): https://www.analyticbridge.datasciencecentral.com/forum/topics/challenge-...
0
votes
1answer
23 views

Infinity values in statistical analysis of minute frequency data

I'm trying to extract statistical features from power spectral density values in Python. My data is actigraphy data with sampling rate 1/60 Hz (once per minute). This is a sample from my data, "...
0
votes
2answers
28 views

Interpolation from discrete time fourier transform in python

I have a function that I sample from over one period. I want to use the Fourier Transform to learn the function and then predict unsampled values. Please see the code below: ...
4
votes
2answers
70 views

Understanding the Bilateral Filter (Image Filtering)

I asked this question already on StackOverflow and was told to ask it here instead, so I will just copy the content of my question. I do understand the general concept of bilateral filtering and I did ...
1
vote
1answer
80 views

scipy cross-correlation: interpretation

I want to compute the phase shift between two 1-D signals of same frequency, but before I'm trying to compute the time shift between. The cross-correlation function seems to be ideal for that but I'm ...
2
votes
1answer
60 views

Deconvolution with Python in real life

I have measured a signal which is convolved with the profile of the measuring apparatus. Now I want to remove this contribution to get the "real" signal. I am trying to do this with Python. ...
0
votes
1answer
63 views

FFT on impulse response: phase doesn't look right, Python

I want to analyze an arbitrary impulse response. Basically, a list of tap coefficient. In general, "tap1" will give me a BW limitation. I want to add more taps and see what it does to the ...
1
vote
2answers
68 views

Phase spectrum interpretation

I have an analog signal alternatively captured by two probes. Sometimes the signal is periodic and depending on the physical conditions the two periodic signals might be in phase or out of phase. Also,...
0
votes
0answers
21 views

Plotting the difference in magnitude and phase between two signals using specgram

I have two synthesised audio signals that I've convolved with impulse responses from a multi-channel microphone and I'm wanting to plot the difference in phase and magnitude using matplotlib's ...
0
votes
1answer
39 views

FFT behaving weirdly for frequencies below 100Hz

I've written a simple program to take an audio file, and calculate the most prominent frequency for every 0.1s interval. My audio file has a sampling rate of 48000, and am taking datapoint windows of ...
0
votes
1answer
55 views

Averaging two channels with Python

I am trying to convert a stereo audio into a mono one by averaging both channels with Python. My audio is stored in sound and I calculate the average using ...
0
votes
0answers
23 views

Peak Sharping of multi-signal data

I have multi-signal data and as a processing step want to apply peak sharping of signal as shown in fig below. is there any way I can achieve this in python ? Literature :Paper 1(Peak sharping section ...
0
votes
0answers
24 views

Analysing of CSI Matrix from received from ESP32 antennas

I am working on a project to sense human occupancy in a room. For that, I have been recommended to use the CSI signals from the WIFI. I have followed https://github.com/StevenMHernandez/ESP32-CSI-Tool ...
0
votes
1answer
19 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
39 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
241 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: ...

1
2 3 4 5
20