Questions tagged [scipy]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
32 views

spectrogram of a (strongly) downsampled file

I downsampled an audio file to a very low sampling rate, 48hz. This is because I stored some information in the file, that are not really audio information but the audio format was convenient to use. ...
0
votes
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 ...
0
votes
1answer
33 views

IIR design: SciPy CMSIS-DSP coefficient format

How do you reconcile Scipy.signal's IIR design with CMSIS-DISP's API? Scipy.signal outputs in one of 3 forms: Numerator/denominator Pole Zero Second-Order-Sections. CMSIS requires an array of length ...
0
votes
2answers
39 views

Find the equivalent of this python remez specs in C++ remez or Matlab firpm

I want to start with that I am quite new in this community, so if this question does not belong here, please point me to the right place. Thank you! Background I am learning and writing a half-band ...
2
votes
0answers
18 views

Help with setting up transfer function correct format

I have a transfer function as: H(s) = R / (sRC + 1) V is the output and I is the input so we can write: V(s) = I(s)*H(s) Now the thing is that, I want to obtain I(t) for the given V(t). So I write: I(...
0
votes
1answer
38 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
55 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 ...
1
vote
0answers
32 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
10 views

Rectified Distribution

I have a vibration signal data with 2500 data points. I want to make a rectified distribution from this signal as appear in figure 4 here to calculate the rectified skewness of the signal. From ...
1
vote
1answer
175 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 ...
1
vote
2answers
131 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 ...
2
votes
3answers
120 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
73 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
43 views

scipy.signal.stft temporal resolution

Using the STFT function from scipy.signal has produced unexpected results for me. I am performing an STFT on 10 seconds of data, sampled at 25,000 Hz. I am using STFT settings of nperseg=256 and ...
1
vote
1answer
218 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
189 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
44 views

narrow band filtering of a signal that is sampled at high frequency

I have a signal that is sampled at 2KHz. The frequency band of interest is from 1/60 Hz to 1 Hz, and I want the final signal to be downsampled to 10 Hz. What is the best way to do this? I read that ...
2
votes
2answers
153 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 ...
2
votes
1answer
36 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
56 views

Apply FFT to positive spiky signal

I have a signal that looks like this It has regularly occurring peaks 50 units apart, and offset from 0 by approximately 20. I thought I could apply the DTFT to this signal and extract the period (...
1
vote
1answer
127 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
37 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
166 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: ...
2
votes
1answer
82 views

Difference between MATLAB zp2sos and python zpk2sos functions

I am trying to port some code from MATLAB to python. The goal is to use Butterworth filter (4th order, bandpass) API and convert it to second-order sections. I get the same output between MATLAB and ...
0
votes
1answer
61 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
0answers
115 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
31 views

Periodogram/PSD from FFT amplitude

I have performed a STFT for signals and obtained the amplitude through ...
0
votes
0answers
163 views

Boundary effects with scipy.fftconvolve after convolution

I am having some numerical error in my code that propagates continuously, and has to do with the implementation of convolutions in Python; this is kind of struggling my progress and I would really ...
0
votes
0answers
20 views

Using Scipy.correlate2d output matrix to determine best image match

I'm struggling to wrap my head around how I can use the output of a correlation matrix to determine if my image is present. If I am trying to match characters, how can I compare the outputs of these ...
2
votes
1answer
651 views

Scalograms in python

I am reading this paper to learning basic concepts of dsp and I want to reproduce the following scalogram of a test signal (fig 4.2 of the paper): It has been produced from the discretization of the ...
1
vote
2answers
96 views

Designing digital low pass filter with low pass-band group delay

I'm interested in specifying a digital low pass filter with low (and near constant) pass band group delay. I tried python's spicy.signal.minimum_phase to transform ...
1
vote
1answer
166 views

Memory efficient filtering with scipy.signal in Python

I have several EEG channels that need filtering, and one channel may reach a recording length of 12 hours or potentially even more. This results in billions of data points stored which, when loaded, ...
0
votes
1answer
41 views

Is there an a method to fit a wave created from two wave?

I need to get the frequency and amplitude for a wave that consists of multiple function. for example, if I have a sine curve (created from two sine waves), How can I extract the parameters for this ...
0
votes
1answer
20 views

What is the function of init in Active Contour Model

In practice of image processing using scikit-image, I didn't understand the role of constructing init numpy array in Active Contour Model example. Is it the red section drawn in the example astronaut ...
1
vote
2answers
633 views

How to apply an anti-aliasing filter before downsampling

I have an eeg signal with two channels (f3m2 and f4m1) which is divided into epochs. I want to augment the data by taking every 5th sample. I can re-use the discarded samples to create 5 versions of ...
0
votes
0answers
140 views

Find corresponding wavenumber from FFT - Python

I have a set of data taken from a high speed camera. I've done some image processing which results in getting a pixel location at each frame. This oscillates with time and so I have performed an FFT ...
0
votes
1answer
74 views

Why use both a high pass and a low pass filter in a Butterworth implementation for noise reduction?

I am a new to audio processing . I want to develop an application that reduces audio noise using a Butterworth filter. I found some existing code doing this, but I still do not understand the use of ...
2
votes
1answer
153 views

Compute minimum phase version of a FIR

I am working with HRIR filters, in particular I am trying to interpolate them. One commod method in the literature to perform interpolation of HRIR is to use the minimum-phase decomposition and ...
0
votes
0answers
81 views

refractive index KK relation

I make Kramers Kroing relation(KK relation) with scipy.integrate.quad to change $\kappa(w)$ into $n(w)$. Their KK relation is $n(w) = 1 + \frac{1}{\pi}\int_{-\infty}^{\infty} \frac{\kappa(w^{\prime})}...
1
vote
0answers
51 views

Interpreting scipy spectrum from audio signal

I have recorded some audio and would like to obtain a spectrum from it. As the audio is a real valued signal, I figure that I could perform a FFT with some window and obtain a spectrum for that period....
4
votes
2answers
83 views

Why is FFT-based convolution efficient only for signals of large size?

According to the documentation of scipy.signal.fftconvolve This is generally much faster than convolve for large arrays (n > ~500), but can be slower when only ...
0
votes
0answers
107 views

The difference between tensorflow stft and scipy stft

I'm trying to wrap my head around stft, and checking the docs, tf.signal.stft and ...
1
vote
1answer
87 views

trying to reproduce the behavior of initial conditions for the filter delays of scipy lfilter with R

I'm trying to reproduce the behavior of lfilter and lfilter_zi (from scipy) in R (using signal package if possible). This is the example provided by ...
0
votes
1answer
47 views

Filter design for an unusual EEG experiment

I'm designing a quite unusual (in terms of signal analysis) EEG experiment, which forces me to design my own filter. I have never done this before, so kindly please check my work and suggest ...
1
vote
2answers
442 views

Scipy butter filter - remove DC offset w/ high sample rate

I am having a hard time figuring out how to employ a high pass filter to remove the DC offset of my data signal with the "scipy butter" function because my sample rate is quite high. The ...
0
votes
0answers
43 views

Why the inverse discrete fourier transform of the Ricker pulse isn't the same as the Ricker pulse in time domain?

Question I'm trying to use Python's scipy library to compute the IDFT of the Ricker wavelet function and compare it with the analytical time-domain version of the same function. When I compare the ...
2
votes
1answer
573 views

Dynamic filter in real time audio

Following my previous question: Removing cracking in real time audio, I'm trying to implement a dynamic filter in real time audio. What I want to do is to create a filter where I can change the cut-...
1
vote
1answer
169 views

Strange behavior from frequency to angular frequency in FFT

I have written a code to compute the Fast Fourier Transform of a simple complex exponential with frequency $f=50.0$, using scipy.fft. The code is written below: ...
1
vote
2answers
734 views

Difference between librosa.stft and scipy.signal.stft

I read the source code of librosa.stft and sicpy.signal.stft, and notice that the calculation results of STFT(short-time fourier transform) in these two libraries are quite different: In scipy.signal....
0
votes
2answers
219 views

Scipy Butterworth highpass filter results in distortion and bloated output

Trying to use Scipy Butterworth filter to filter frequencies below 54 Hz from audio files. Audio files are stored as WAVs. Sample rate is 44100. When I try using this filter the result is distorted (...