Questions tagged [scipy]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
12 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
60 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 ...
0
votes
2answers
40 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
46 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
27 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
19 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
62 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
37 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
41 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 ...
1
vote
1answer
86 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
12 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})}...
0
votes
0answers
33 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
40 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
38 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
43 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
37 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
49 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
25 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 ...
1
vote
1answer
85 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-...
0
votes
1answer
44 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
1answer
311 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
96 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 (...
0
votes
2answers
149 views

Scipy fourier transform zero frequency spike (from DC offset) - de-meaning and hanning window have no effect

I am trying to plot the FFT of essentially a random signal that has a non-zero mean shown below. The FFT of the signal is peaked over the zero frequency which usually indicates a DC offset. Although ...
1
vote
3answers
174 views

How to practically correct for group delay imposed by a digital filter (Python)

I'm using Python to filter a signal using a Butterworth filter (scipy.signal.butter) and subsequently passing this through a forward-backward filter with cascaded second order sections (scipy.signal....
1
vote
1answer
75 views

Ripple in a SciPy Butterworth SOS Filter

I have a script using SciPy for checking the RMS of various Butterworth Bandpass Filters of varying orders. I would expect the RMS values to increase and decrease linearly and consistently as you get ...
1
vote
1answer
132 views

CWT at low scales: PyWavelets vs Scipy

Low scales are arguably the most challenging to implement due to limitations in discretized representations. Detailed comparison here; the principal difference is in how the two handle wavelets at ...
0
votes
1answer
54 views

How to calculate PSD if i have power vs freq spectrum?

i have a signal something like this how to calculate PSD? i have freq from 191000200 to 196500000 time gap or delta t = 1 or 2 sec, (what i mean is [tn] - [tn-1]) i will be computing in python any ...
0
votes
0answers
21 views

Python, Is there a way to find the properties of a subregion within a larger image region?

The goal: I have images with particles that I need to find the area of. Each particle also has four to five sub-regions that I need to know the area of. Think of a bunch of stripped shirts in a ...
3
votes
2answers
500 views

Are IIR filters (and specifically Butterworth filter) causal?

I am new to signal processing. I am learning now about filtering and I am trying to implement high pass filter (HPF),and later band-pass filter (BPF). I implement the filters in ...
2
votes
0answers
66 views

Filtering a square signal with a median filtering to preserve the edges

If needed, you can find my first post for this problem here. I am trying to clean the following signal: As proposed in the comment, I tried to use this post proposing 2 methods: median filtering and ...
1
vote
1answer
57 views

How do I set window length and shift length for computing STFT on Scipy?

Does nperseg=32, noverlap=16 mean the window length is 32mS with a shift of 16mS? Refer here for more details
0
votes
1answer
39 views

Showing specific values in an STFT plot

I have a short term fourier transform plot that I plot using matplotlib's pcolormesh() function: If I zoom in the plot, I see this: Now, I want the plot to just ...
0
votes
2answers
206 views

Complex Samples (IQ) - Baseband Filtering

We are currently analyzing a large set of IQ samples in a desktop application and we are interested in implementing many different bandpass filters dynamically. We realized, that working with scipy ...
3
votes
0answers
30 views

Are there any tools for generating fixed point filter implementations?

It's very easy to make a filter in Scipy or many other tools, but implementing this filter in fixed point in C or VHDL/Verilog is always a chore. I mean, in theory it's just a matter of adequately ...
0
votes
0answers
70 views

scipy.signal.deconvolve not working, Blind deconvolution in python

I am trying to deconvolve my original signal with a given wavelet (Ricker wavelet). But scipy.signal.deconvolve is not giving any output to the signal. Impulse signal can be generated by below code. ...
0
votes
1answer
144 views

Difference between freqz vs freqresp in scipy?

I'm always confused that scipy has scipy.signal.freqz, but also scipy.signal.lti.freqresp / ...
1
vote
2answers
155 views

Hilbert transform with scipy.signal

I'm coding with python and I just started to use the Hilbert transform from scipy.signal. Consequently, to check the result I got I tried to verify a property of ...
0
votes
0answers
44 views

Why is there a difference in the spectrum of an audio file between Sonic Visualizer and my Python script?

I am working on a script which is creating a spectrum analysis from an audio file using SciPy and NumPy. Before I started, I analyzed the file using Sonic Visualizer, which got me the following result:...
0
votes
0answers
57 views

Lowpass Butterworth filter equation

I am using a 5th order lowpass Butterworth filter with a varying cutoff frequency, $f_c$, to smoothen some data coming from a spectrometer. An example of a spectrum, plotted with the filtered data, ...
0
votes
1answer
64 views

How to Save FFT output for fast read-in?

For a project, I'm reading in hundreds of short (4 sec) wavefiles and giving them to scipy fft for the frequency information for further processing/experimenting in various ways. Problem is, I want to ...
1
vote
1answer
414 views

Why is the number of frequencies decomposed in scipy.signal.stft() equal to the hop size?

I asked this over on StackOverflow first but figured you fine people might know more about signal processing (duh). I'm trying to calculate the spectrogram of an audio file in python. There's a nice ...
0
votes
1answer
264 views

Decimating Non-Uniform large time-series data

I'm working with accelerometer data that is sampled at a non-uniform rate. There are major gaps in the data. Below is a scatter plot of the data I can also give a sense of the frquencies at which ...
1
vote
0answers
33 views

SciPy - Distinguish between two group of periodic samples [closed]

First of all, I'm sorry for my bad English writing, plus, I'm new to DSP. Background We have got motion data of 20 cows. 10 cows are healthy and 10 cows are slightly lame. Lameness is an abnormal ...
2
votes
2answers
124 views

Why is my signal attenuated after applying a HighPass-filter?

I am new to DSP, but I've been attempting apply a butterworth high-pass filter on a 1D array (Values peeking at 300~) to eliminate any noise, yet when applying a high pass filter, I'm ending up with ...
1
vote
3answers
4k views

downsample signal to a specific number of samples in Python

The Python Scipy library provides several functions to downsample signals, but they all have limitations: The resample function is based on Fourier method, which means it assumes periodic signals. ...
0
votes
0answers
59 views

Is there a way to get output in second order sections (SOS) format from Scipy's signal.firwin

I am using Scipy's signal.firwin to implement a lowpass filter. Using the rule of thumb formula(s) to estimate the order of the filter, I am getting a very high number. I looked into this question, ...
0
votes
1answer
548 views

Demodulation of FSK signal

What kind of FSK signal is this and what demodulation technique can I use to demodulate it. Why is the phase of the 1's changing like that and how does that effect how it needs to be demodulated. I ...
1
vote
1answer
583 views

SciPy Lfilter issue

For one of my DSP projects, I decided to use python to perform signal processing. While I am new to python, I understand that it is a very powerful and versatile language. For my processing, I opted ...
3
votes
6answers
937 views

What Are The Semantics Of Wav-File Sample Values?

The title is the question. To make this concrete, assume I have a standard 16-bit single channel wav file, with (although it doesn't matter) a 16000 Hz sampling rate. Each sample magnitude will be a ...
0
votes
1answer
271 views

How to implement Matlab welch in python with the same result?

I want to implement Matlab pwelch function in python. The Matlab code is shown blew: [PSD,f] = pwelch(data,length(data),[],[],2000); which data is a row vector ...