Questions tagged [scipy]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
87 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
27 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
16 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
29 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
55 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
31 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
49 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
0answers
16 views

constructing and initializing a normalized lattice filter using scipy

I'd like to implement a 2nd order bandpass filter in scipy using a normalized lattice architecture. (I'm choosing a lattice because it's guaranteed stable even when changing the coefficients on a ...
0
votes
1answer
31 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 ...
0
votes
1answer
106 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
76 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
95 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
1k 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
28 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
284 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
237 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
5answers
504 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
116 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 ...
1
vote
0answers
58 views

Why are low frequency peaks not sharp in scipy fft?

I am using numpy/scipy to plot graphs of sine waves. frequencies at 15 Hz or higher give nice, sharp peaks, but at lower frequencies, the peaks are smeared and the actual peak frequency can't be seen ...
0
votes
1answer
32 views

Can't seem to get welch function in scipy work correctly

I'm trying to learn DSP through using Python's scipy package. I have measure some 200Hz signal from a machine. Now I want to inspect the spectral density of the signal. Here's the signal plotted out: ...
0
votes
2answers
731 views

Python Hilbert does not seem to calculate the envelope

I am following the example from: https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.hilbert.html And although I can replicate their example, it does not work with my data. This is the ...
0
votes
1answer
94 views

Bandpass filter with very high sampling rate

Consider a bandpass filter with Low Cut 17Hz, High Cut 22 Hz, Fs = 45000 Hz and Order = 6. When I pass a mixture of multiple sinusoidal waves through this filter (with a sine wave of frequency 20 Hz), ...
0
votes
0answers
74 views

Negative Exponential Filter SciPy

I'm trying to transform a time series with a recursive filter to model a feedback. I was able to do a simple filter like : ...
0
votes
1answer
606 views

How to convert a spectrogram back to a signal [duplicate]

I'm converting a signal to a spectrogram, manipulating that (nonlinear stuff), and then want to use the modified audio signal. I can make it so the segments are not overlapping, but am unsure how to ...
1
vote
1answer
42 views

How to pad a array representing music to pad the stft of this array?

I have an array named samples of size (2, 1321967) representing an audio file. When I pass it to scipy stft with ...
0
votes
2answers
268 views

Delay in Savitzky-Golay filtering

I am applying a Savitzky-Golay filter to a signal, using the scipy function. I need to calculate the lag of the filtered signal, and how much is it behind the original signal. Could someone shed ...
0
votes
0answers
89 views

Scipy Deconvolve help

I was playing with the deconvolve method in scipy and I can't seem to get it working properly (I am still really new to DSP/deconvolution). I convolved a gaussian with a fwhm of 2.0e-9 with a ...
0
votes
0answers
215 views

Filtering out different narrow-band frequencies at once

I have asked a closely related question on SO at https://stackoverflow.com/questions/55168460/python-implementation-for-filtering-out-multiple-distinct-narrow-band-frequencie but I am still unclear ...
1
vote
1answer
948 views

Third octave bandpass filter with python

I am very new to signal processing and coding which is why my questions might be really basic. I have a signal of the acoustic pressure p'(t) and I would like to use a third octave bandpass filter in ...
4
votes
2answers
192 views

Checking Parseval's Theorem for Gaussian Signal by Using Scipy

I'm trying to check Parseval's theorm for Gaussian signal. It's well known that fourier transform of $\exp(-t^2)$ is $\sqrt{\pi}\exp(-\pi^2 k^2)$. So I implement it by using quad and simps. I think ...
0
votes
0answers
58 views

Scipy Welch's gives different first element

I've re-implemented Welch's method and want to compare it to scipy.signal.welch. However, the first two and last elements of the resulting array are different. My ...
2
votes
2answers
410 views

Why does a higher sampling frequency mess up my bandpass filter?

I was designing a bandpass filter in python using some of the scipy.signal modules. I am plotting the frequency response of my filter to verify that my desired frequency is in the passband. However, ...
0
votes
2answers
916 views

How to calculate the PSD from the complex calculated STFT?

I have calculated the STFT with scipy python library: ...
0
votes
0answers
89 views

How to know the time of my window to calculate the STFT with python knowing only the length?

I am trying to implement a work presented in an IEEE paper where they have mentioned that the STFT was performed on the signal measurements to obtain a spectrogram with no overlap window of 3 min : I ...
0
votes
0answers
85 views

how to detrend a carrier phase with butterworth filter?

I am new with detrending techniques, I have a carrier phase measurements and I want to detrend it by 6th order butterworth digital filter. After creating the digital filter I get its numerator (...
1
vote
1answer
6k views

Write a 440 Hz Sine Wave to .wav-File using Python and SciPy [closed]

This is my first post on DSP.SE! I'm a student in Computer Sciences and am just getting started with Signals and Systems, thus getting in touch with discrete signals and analyzing them. I wanted to ...
5
votes
1answer
2k views

Scipy resample, “fourier method” explanation

I am seeking explanation of what "Fourier method" is that is described for resampling in documentation of resample() method. I want to downsample an array. I know what decimation is and how it works, ...
2
votes
0answers
543 views

real refractive index from Kramers Kronig relation

I have a measurement of the complex part of the refractive index $k$ (where the refractive index is $m = n + i\,k$) measured at a nonlinear grid of wavelengths or frequencies that span several orders ...
1
vote
1answer
3k views

How to filter out those outliers

I'm struggling to filter some data from an accelerometer. I need to do it in python (and not just on the device collecting the data) to fix the data I have, so that I can build some classification ...
2
votes
1answer
2k views

Amplitude of frequency bin in FFT doesn't match time-domain amplitude

I have a sinusoidal current that I am sampling at about 357k SPS. The current signal is about 3A pk-pk @ 750hz (top figure). I am wondering why when I take the fft using numpy/scipy's fft function, ...
1
vote
1answer
787 views

How to Apply Gaussian Filter to Raw Audio Files in Python?

I am recording raw files in python to later break them into phonemes, but the noise in the surrounding environment is hampering the result. So, there is a need to apply a filter to the recorded raw ...
3
votes
3answers
614 views

Decreasing Sample Rate in DFT (FFT) for Audio Analysis

I'm working with audio data analysis through FFT algorithm. My example audio is a sine wave at 440 Hz and 44100 Hz sampling rate. FFT methods in programming, like ...
6
votes
1answer
319 views

Morphing between two FFTs

I'm a musician and I'm making a script that takes a wave file and snaps each of its frequencies from the fourier transforms to the nearest musical harmonic. Thanks to help from another question I ...
0
votes
1answer
66 views

Unexpected peaks in power density following downsampling and filtering

I first applied a 100 Hz lowpass filter to my data, which was recorded at 30000 Hz: ...
0
votes
1answer
500 views

Should scipy.signal.coherence be 1 for single input and output signals?

I am trying to calculate the coherence between input and output signals. I thought I could work with a single input and a single output time series and calculate the coherence $\gamma^2$ between them. ...
1
vote
1answer
137 views

Help generating coefficients for basic FIR LPF

I'm trying to generate coefficients for a FIR low pass filter to be used in an FPGA. I'm using python (scipy.signal) to attempt to do this, but am having trouble getting coefficients in a usable form....
0
votes
1answer
312 views

Outlier Detection after Detrending a Time Series With Missing Values or NaN

Goal Substitute outliers in a time series by most recent valid data Problem The time series (end-of-day stock prices) has several 'uncomfortable' properties: It is non-stationary and can have ...
4
votes
1answer
1k views

How to generate random samples of Gaussian distribution directly in the frequency domain?

One can easily draw (pseudo-)random samples from a normal (Gaussian) distribution by using, say, NumPy: ...
0
votes
2answers
131 views

Can I combine an IIR (an EWMA) with a maximum?

I'd like to have a exponentially weighted moving average (EWMA) which is raised to the value of the input signal whenever this is higher than the filter output. This taking of the maximum shall take ...