# 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.

992 questions
Filter by
Sorted by
Tagged with
1answer
6 views

### lopsided Hanning Window function

I am processing sensor signals and have been looking at using window functions to smooth out the signal before I conduct a fft on it. A normal symmetrical hanning function seems to disorientate the ...
0answers
18 views

### Zero phase - Minimum phase of Butterworth filter [closed]

I am trying to implement the Zero phase - Minimum phase of Butterworth filter (1st, 2nd, and 3rd order) from scratch using python. Based on the resulting plots, it seems that I am doing something ...
1answer
31 views

### How to create a real bandpass filter?

I'm trying to create a real bandpass filter (17-point) in Python by calculating the coefficients b of a signal. This is the formula I'm using: $$b = \cos(ω(k-k_m))$$ for $k = 0,1,..,L-1$, where $k_m$ ...
0answers
16 views

### GNU Radio Stream Input-Vector Output

I successfully designed the transmitter block. I am now implementing the GNU Radio receiver block and using a Python (since it is easier for me to design a prototype) block that takes a stream of the ...
1answer
52 views

### Hankel Matrix SVD Denoising

I have performed Hankel Matrix Singular Value Decomposition de-noising to smooth out my univariate time series. It is the close price of EUR/USD exchange rate. Here is a picture: The problem I have is ...
1answer
23 views

### Creating the frequency-spectrum with VC-curves for Building Vibrations measurement

I'm very new to signal processing and can't get ahead: I'm using an Accelerometer to measure the acceleration of i.e. the building vibrations or elements/machinery etc. For creating the spectrum, I ...
1answer
65 views

### How to design a digital Butterworth bandpass filter?

I am looking into designing a Bandpass Butterworth filter in python, but, I was not sure I am designing my filter correctly. What I have are the following: High cutoff frequency = 200Hz Low cutoff ...
1answer
25 views

### Generate a PSF based on MTF Mapper's SFR measurement

Not sure if I should post this here or on Stack Overflow I have a .csv file from MTF Mapper with 2 columns from SFR measurement - frequency and contrast: ...
1answer
48 views

### Should i normalize FFT signal with z-score?

I am working with EEG data (time domain) in a machine learning task, where each input signal must be mapped to a class/frequency. I am using FFT in order to get data in frequency domain and make ...
1answer
25 views

### How to calculate magnitude of frequency response?

I'm trying to write a function in Python that calculates the magnitude of an FIR filters frequency response. I tried doing it by first calculating the Fourier transform with np.fft.fft and then ...
1answer
39 views

### How to find the shape of the highs from a noisy signal with many dips

I try to find that looks something like the red curve below and I am pretty clueless what is the best way. I tried first the Savitzky-Golay Filter, then I tried a simple fit with a second degree ...
1answer
18 views

### Self-Adjoint Filter Doesn't Work

My understanding is that a symmetrical kernel is its own self-adjoint. For example, if we had the following kernel: ...
0answers
10 views

### How to do appcoef and detcoef using pyWavelets?

I am new to signal processing and currently doing a school project in wavelet transform using Python. I want to extract all details and approximations (Example: cA2, cA1, cD2, cD1), pywt could return ...
0answers
11 views

### Multilevel DWT wavedec - How to get each coefficient (approximations and details) in the same length as the original signal?

I am doing a school project referring to the research paper https://www.tandfonline.com/doi/abs/10.1080/0952813X.2013.813976?journalCode=teta20 The overall concept of the research is as the following ...
1answer
56 views

### inverse fourier transform coefficients

Context I want to implement (real) cepstrum on stock data (for example MSFT stock) and achieve cepstral coefficients of this time series. as noted in "Cepstral-based clustering of financial time ...
1answer
24 views

### Hop size in STFT

I am reading the documentation of scipy.signal.stft function: https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.stft.html#scipy.signal.stft. My question: is the 'noverlap' parameter of ...
0answers
23 views

### How to design function for Random Decrement technique in python and implement the function?

I was looking into a technique called Random decrement technique from the following links/articles: How can I use Random Decrement Method to convert a non-stationary signal into a decay function ...
1answer
75 views

### Implementing basic high pass filter using difference equation

For the following signal, I am trying to remove the gradual positive drift but retain the spikes using a high pass filter. I am aware that I can use implement a high pass filter using difference ...
1answer
47 views

### Send real and complex signal from python to GNU radio. ZMQ Python SUB -> GNU Radio

I've been reading about this. To do this, you should use the ZMQ blocks instead of the UDP blocks because of data loss. Now when using ZMQ I have problems with the received signal, if I create a np ...
1answer
33 views

### Fourier Transform High Pass Circular Filter Intuition

The situation I need to apply a high pass filter to an image. The approach I'm following uses Fourier transform to apply a circular filter which would eliminate low frequencies. Say I have a frequency ...
0answers
48 views

### High pass filter with specific cut-off frequency

The situation I am trying to apply a high pass filter to a black&white image to enhance the texture by keeping the high frequencies. The goal is to filter from a specific frequency value obtained ...
1answer
56 views

### Object Detection using audible sonar

I am currently working on a project of identifying the position and angle of the objects in an environment using sonar (audible) about 1 to 2 m away from a desktop speaker within an angular sector of ...
1answer
56 views

### Removing Attenuator and Real Mixer influence on the received Baseband signal in Radar IQ Transmitter - De-embedding

Radar IQ Transmitter Measurement Setup: Waveform Generator + IQ Transmitter + Attenuator + Real Downconversion mixer + Oscilloscope + Post-processing (Hilbert Transform) With the above arrangement ...
1answer
35 views

...
0answers
35 views

### Sample rate vs noise floor in power spectral density measurement

I am trying to measure the noise floor of my picoscope. I want to generate a PSD in volts per root hz that I can compare with specs from other equipment, e.g. a preamp. I gathered some data from my ...
0answers
31 views

### Separating several kinds of information in a sound file

I have a 90min audio recording of a lecture using a handheld recorder. Since the recorder was in the shirt pocket of the speaker, I can clearly hear that the their voice is much louder than the ...
1answer
30 views

### Detecting & tracking an arbitrary object in a video

I have a video from a fixed (stationary) camera. Sometimes there are slight movements in the frames (e.g. tree moving a bit in the wind). Other times, some might walk into the view of the camera, a ...
3answers
396 views

### Python FIR Notch filter applied on both + and - frequency but only need + frequency

I have posted a summary of what I am seeing, I just made a pulse train and testing a notch filter on it as an example only. I also have a complex baseband signal centered on 0 Hz, this complex ...
1answer
19 views

### Does BM3D really need the noise power spectrum beforehand?

I'm at the moment trying to implement a neural network which uses BM3D as a preprocessing step. The problem is, when using the python implementation of BM3D from the paper Collaborative Filtering of ...
0answers
25 views

### FFT filtering by hand in python - iffy issue - cannot get filtering right

I am trying to filter an image by hand (with no using the image processing libraries) to understand how fft.shift works in python. No luck. I take a png an image from MNIST, e.g.. Here is the code: <...
0answers
14 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 ...
2answers
58 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 ...
0answers
11 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 ...
1answer
73 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-...
1answer
44 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 ...
1answer
36 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 ...
1answer
64 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 ...
0answers
66 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 ...
1answer
39 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: ...
1answer
64 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 ...
0answers
27 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 ω ...
1answer
84 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 ...
0answers
36 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 ...
0answers
46 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 ...
1answer
28 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: ...
1answer
38 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 ...
0answers
23 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 ...
1answer
200 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 ...
1answer
27 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 ...
1answer
224 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....